Skip to content
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

[REQ] Patch from Trivy SBOM scan results #446

Open
1 task done
duffney opened this issue Dec 15, 2023 · 4 comments
Open
1 task done

[REQ] Patch from Trivy SBOM scan results #446

duffney opened this issue Dec 15, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@duffney
Copy link

duffney commented Dec 15, 2023

What kind of request is this?

Improvement of existing experience

What is your request or suggestion?

Trivy allows you to generate an SBOM for a container image and then use the SBOM to produce a vulnerability report. My request is that Copa be able to use the vulnerability report generated by the trivy sbom command to patch the container image instead of relying on scans of the container image directly.

Here's an example:

# generate sbom in spdx format
trivy image --format spdx-json --output spdx.json alpine:3.16.0
# create vuln report from sbom
trivy sbom spdx.json --exit-code 0 --format json --output ./patch-from-sbom.json
# patch container image from sbom report
copa patch -i ${IMAGE} -r ./patch-from-sbom.json -t v0.1-alpha-1

Currently, when I follow this path I get the following error:

Error: failed to solve: failed to load cache key: no match for platform in manifest: not found

Are you willing to submit PRs to contribute to this feature request?

  • Yes, I am willing to implement it.
@duffney duffney added the enhancement New feature or request label Dec 15, 2023
@sozercan
Copy link
Member

@duffney can you tell a bit more about this? any distinctions or advantages over using trivy report?

@duffney
Copy link
Author

duffney commented Dec 24, 2023

I was envisioning using the SBOM to patch images instead of scanning results. If the SBOM was already available in the referrers of the container image, it would make scanning unnecessary. One of the promises of an SBOM is to assist with vuln management, but after a bit more research it might be a bit early. However, it could make a good backlog feature. :)

@sozercan
Copy link
Member

sozercan commented Jan 2, 2024

it would make scanning unnecessary

wouldn't you still need to scan it (what trivy sbom does)? it just scans the sbom, rather than the image itself

@duffney
Copy link
Author

duffney commented Jan 11, 2024

That's correct. However, the report that trivy generates with trivy sbom is in a slightly different format and Copa can't use it to patch. So, another trivy scan report would need to be created in order to use Copa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants