-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify on SARIF report which Dockerfile/image is being scanned #708
Comments
hi @WolfangAukang - good question! Currently GitHub Code Scanning requires the service (Trivy Github Action) to specify a source of the vulnerability that is being flagged. For the initial release of the Trivy Github Action we went in with assumption that the user is scanning an image that they've built from a Dockerfile. And that the said Dockerfile is present inside the repo being scanned (so we can use it to flag it as the source). As of now, Trivy doesn't have the capability to show you which layer in the Dockerfile the vulnerability originated from. This would be handy when making annotations that are more specific, for e.g. Line 123 in Dockerfile is introducing this vulnerability. This further can be shown in the SARIF output as you mentioned. It is something we're considering on adding, so stay tuned. Hope that helps! |
Thank you @simar7! Will stay tuned for sure |
This issue is stale because it has been labeled with inactivity. |
Another use case for having the image or Dockerfile specified is when one is scanning many images inside of a single repo. Currently the sarif does not specify what image was scanned, so all images inside a repo appear to have the same vulnerabilities. This feature seems like low hanging fruit, and crucial information that keeps context within the report. I'd love to see the priority on this bumped up. |
We've also been bitten by this. However, some SARIF results show paths within the Docker images which can have many duplicates across different Dockerfiles. This makes it very hard to manage the full results for the entire repository and forces us to resort to hunting for which Dockerfiles are reporting the bugs/CVEs. |
I want to implement Trivy Github Action on a repo that contains multiple variants of a container image. The idea is that I am running a workflow for each version, like:
myimage:variantX
and scan itmyimage:variantY
and scan itThe problem I'm having currently and I don't know if a solution is already available is that on the Security > Code Scanning Alerts > Trivy section at the repo, I can see the issues are referring to a Dockerfile, which is okay.
But in the case we are doing a scan for each image variant, I want to see to which image/Dockerfile specifically is the alert referring to.
I see the sarif template at
contrib/sarif.tpl
has the following section:Which I would believe it is where it specifies the name.
Is that factible to be done?
The text was updated successfully, but these errors were encountered: