feat: scan every image with Trivy before it is pushed #97

Merged
cjournois merged 1 commit from feat/image-scan into main 2026-11-09 12:54:16 +00:00
Collaborator

The lockfile audit never sees the OS packages a base image brings, so a known-critical libc or zlib in a pushed image goes unnoticed.

  • Before any push (and on a PR, in place of the cache-only build) the image is exported for the runner's platform and Trivy scans it; a critical vulnerability with a fixed version fails the job.
  • Suppressions use the unit's .audit-ignore with the same reason and expiry rules; the parser moved to lib.sh and serves both gates.
  • The Trivy databases come from ghcr.io (mirror.gcr.io was refused from Ergon's egress) and are cached per day.

Verified: just lint test (514 bats) green; the exact Trivy flags against a real alpine:3.16.0 layout fail on CVE-2022-37434 (exit 1), pass with an unexpired ignore entry and fail again once it expires.
Breaking: none for callers, but the runner must ship trivy first: devops/image#212.

Session: 60ac4614-d609-4e43-a004-27bdaf30476c

The lockfile audit never sees the OS packages a base image brings, so a known-critical libc or zlib in a pushed image goes unnoticed. - Before any push (and on a PR, in place of the cache-only build) the image is exported for the runner's platform and Trivy scans it; a critical vulnerability with a fixed version fails the job. - Suppressions use the unit's `.audit-ignore` with the same reason and expiry rules; the parser moved to lib.sh and serves both gates. - The Trivy databases come from ghcr.io (mirror.gcr.io was refused from Ergon's egress) and are cached per day. Verified: `just lint test` (514 bats) green; the exact Trivy flags against a real alpine:3.16.0 layout fail on CVE-2022-37434 (exit 1), pass with an unexpired ignore entry and fail again once it expires. Breaking: none for callers, but the runner must ship `trivy` first: devops/image#212. Session: 60ac4614-d609-4e43-a004-27bdaf30476c
feat: scan every image with Trivy before it is pushed
All checks were successful
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 54s
ci: reusable-pipeline / CI Pipeline (push) Successful in 5m16s
eac6108f2e
The lockfile audit never sees the OS packages a base image brings; a critical one with a fixed version now fails the build before the registry gets it.
Suppressions share the unit's .audit-ignore and its expiry rules, now read by one parser in lib.sh.

Session: 60ac4614-d609-4e43-a004-27bdaf30476c
bot-claude changed title from WIP: feat: scan every image with Trivy before it is pushed to feat: scan every image with Trivy before it is pushed 2026-11-09 12:53:48 +00:00
cjournois deleted branch feat/image-scan 2026-11-09 12:54:16 +00:00
Sign in to join this conversation.
No reviewers
No labels
needs-human
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cjournois/reusable-pipeline!97
No description provided.