project-zot / zot

zot - A scale-out production-ready vendor-neutral OCI-native container image/artifact registry (purely based on OCI Distribution Specification)
https://zotregistry.dev
Apache License 2.0
864 stars 93 forks source link

[Feat]: support CVE scans using SBOM when available #2415

Open rchincha opened 4 months ago

rchincha commented 4 months ago

Is your feature request related to a problem? Please describe.

zot has support for OCI artifacts (v1.1.0) and when a SBOM is pushed, we can leverage the SBOM scanning ability from trivy to do:

  1. a lightweight scan
  2. CVE scans even when storage is remote (since no unpacking is needed)

Describe the solution you'd like

If remote storage is detected and a SBOM artifact is found, then use that for CVE scans.

Describe alternatives you've considered

No response

Additional context

No response

rchincha commented 3 months ago

trivy sbom <sbom-file>

rchincha commented 3 months ago
  1. If an SBOM is available via referrer for an image, then "download" it
  2. Else, cannot scan the image
  3. If 1. then CVE scan against SBOM

^ first cut, for remote cloud storage case.

ADorigi commented 1 month ago

Hi @rchincha

I am willing to work on this issue.

From what I can understand, we have a ScanImage method which has been implemented for trivy.

I think the following logic flow will satisfy this requirement:

Please let me know if I can proceed with the implementation.