-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for scan-type: 'sbom' #173
Comments
Hey @luafanti. The "generating SBOM" feature was added by #129. It's not exactly what you asked for, but here's the documentation. Note that Instead of |
Hey @luafanti So, it's a little bit hacky but you can create & scan SBOMs even though it's not listed as something you can do using the action in the same way you would using Trivy on the CLI. My case was that I wanted to replicate the cli command for generating an SBOM for an image as shown here: `https://aquasecurity.github.io/trivy/v0.39/docs/sbom/spdx/ I've found using I could use a combination of Syft and Grype for this but I'm a Trivy guy and the CLI supports this so I dug through the Generate an SBOM for an image
This works because defining a format of
You can then scan the SBOM by passing the file in as the image-ref because again, there are no actual checks done against the
Due to how the CLI works and the script behind this action works, the image just gets dumped at the end of the command so this ends up generating this command:
It'd be nice if this was built into the action and maybe if I have time I'll contribute this but for now, it's something that we can do. Even something as simple as changing the |
@drew-viles thanks for the time-saving hack! Much appreciated! |
It would be nice if trivy-action could support vulnerability scanning based on a pre-generated SBOM file. Using the Trivy CLI it is possible
trivy sbom /path/to/cyclonedx.json
https://aquasecurity.github.io/trivy/v0.32/docs/sbom/cyclonedx/
I tried the below configuration with trivy-action but it fails.
Looks like the
scan-ref
value withscan-type: sbom
is not passed to the final trivy command. See attached image for detailsThe text was updated successfully, but these errors were encountered: