ci: scan the kargo image for CVEs with Grype at build and release time#6410
ci: scan the kargo image for CVEs with Grype at build and release time#6410EronWright wants to merge 3 commits into
Conversation
Adds hack/cve-scan.sh and wires it into the image pipelines: - ci.yaml build-image: the multi-platform build previously stayed in buildx cache (push: false); it now pushes to the job-local registry service (nothing leaves the runner) so the built image can be scanned. - release.yaml publish-image: scan the just-pushed digest. VEX lookups use the canonical ghcr.io/akuity/kargo path so unstable builds share the release dispositions. The scan fetches Akuity's published VEX statements from vex.akuity.io (tolerating their absence until publishing goes live) and is report-only: findings go to the job step summary plus a warning annotation with Critical/High counts. Setting FAIL_ON=high later turns a call site into a hard gate. The download-grype action is pinned to a full commit SHA. Signed-off-by: Eron Wright <eron.wright@akuity.io>
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6410 +/- ##
==========================================
+ Coverage 58.32% 58.34% +0.02%
==========================================
Files 500 500
Lines 41939 42015 +76
==========================================
+ Hits 24462 24515 +53
- Misses 16010 16029 +19
- Partials 1467 1471 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CI verificationThe
Context for the counts: a large batch of |
GitHub Actions parses workflow commands from stderr as well, so the ::error:: annotations still render. Signed-off-by: Eron Wright <eron.wright@akuity.io>
Sync cve-scan.sh: per-location Critical/High table from grype artifact paths, and report-only mode no longer fails the build when grype can't produce a report (warns instead; still fails closed when FAIL_ON set). Signed-off-by: Eron Wright <eron.wright@akuity.io>
Adds
hack/cve-scan.sh— the CVE scan recipe used across Akuity image pipelines — and wires it into the two places the kargo image is built:ci.yaml/build-imagepush: false; it now also pushes to the job'sregistry:3.0.0service — nothing leaves the runner)release.yaml/publish-imageBehavior:
::warning::annotation with Critical/High counts.FAIL_ON: ""at each call site; setting it tohighlater turns the scan into a hard gate (one-line diff).https://vex.akuity.io/pkg/oci/ghcr.io/akuity/kargo/vex.jsonviagrype --vex, so findings assessed as not-affected are suppressed. A 404 is tolerated until VEX publishing goes live — scans tighten automatically once it does.-unstablebuilds use the canonicalghcr.io/akuity/kargopath for VEX lookups, sharing the release dispositions.download-grypeis pinned to a full commit SHA (v7.4.0) with DB caching.The same recipe is live in Akuity's other image repos; this PR's own
build-imagejob exercises the CI scan path end-to-end.