Skip to content

feat(cve): run Grype alongside Trivy and merge findings - #21

Merged
rjd15372 merged 6 commits into
mainfrom
feat/grype-alongside-trivy
Nov 17, 2026
Merged

rjd15372 merged 6 commits into
mainfrom
feat/grype-alongside-trivy

Conversation

@rjd15372

Copy link
Copy Markdown
Collaborator

Why

Trivy reports no OS vulnerabilities on RHEL 10 images (checked with 0.69.3 and 0.76.2, and on Red Hat's own ubi10/ubi-minimal), so every ubi10 image shows as clean. Grype finds them, but misses Python packages installed by an RPM, which Trivy finds. On RHEL 8 and 9 the two agree almost exactly.

What

  • Each image/arch scan runs Trivy, then Grype, and stores one merged list. Findings are merged on CVE ID + package name + path; when both report a finding, Trivy's record is kept.
  • Grype findings get Src, Vendor and Owner from Trivy's package list, so the CVEs tab classifies them like Trivy's.
  • If either scanner fails, the scan fails and the previous result stays.
  • Each finding has a scanners field (trivy, grype or both) in the API. No UI change.
  • The runtime image ships the Grype binary. Trivy stays on latest.

Design: docs/superpowers/specs/2026-11-17-grype-alongside-trivy-design.md

Testing

  • go test ./... and go vet ./... pass.
  • Scanned releases/18/containers/ubi10/percona-distribution-postgresql:18 through the new code: 14 HIGH findings, where Trivy alone gave 0.

Notes

  • Scan time roughly doubles, since each scanner pulls the image itself.
  • Grype downloads its vulnerability database at run time; an outage of that download fails scans.
  • Existing images pick up Grype findings at the next nightly rescan.

Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
@rjd15372
rjd15372 merged commit 57f04d1 into main Nov 17, 2026
5 checks passed
@rjd15372
rjd15372 deleted the feat/grype-alongside-trivy branch November 17, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant