fix: cache the image scan's two databases apart, and show what each scan covered #101
No reviewers
Labels
No labels
needs-human
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
cjournois/reusable-pipeline!101
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/trivy-db-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Image jobs re-downloaded Trivy's databases far more than needed: one cache key held both and was saved only on a passing job, so the first image of the day decided its content. Java images (ci-runner, cluster-ops) re-fetched the Java database every run, about 5 minutes each, and a scan that found something threw its download away.
trivy-db-<day>andtrivy-java-db-<day>are separate entries, restored from the newest; each is saved only when Trivy actually fetched it (scan.sh downloads), even when the scan fails.trivy scanned: <type> <count>, …from Trivy's report and warns about any target it has no data for; the docs list which database covers which language.Verified:
just lint test(548 bats) green; live on devops/image#217 — see comment.Session: 60ac4614-d609-4e43-a004-27bdaf30476c
6a2daeb3023ffeaad256Live on devops/image#217 (3 runs, ci-runner / cluster-ops / squid):
trivy downloaded: db,java-dbon ci-runner,dbon squid); 3 parallel saves of one key all succeeded.trivy downloaded: none, both entries restored, scans 0-2 s instead of up to 414 s.trivy scanned: debian 1, gobinary 6, node-pkg 144, python-pkg 2on ci-runner.The retry path did not trigger live (no ghcr break in these runs); it is covered by bats only.
Session: 60ac4614-d609-4e43-a004-27bdaf30476c
WIP: fix: cache the image scan's two databases apart, and show what each scan coveredto fix: cache the image scan's two databases apart, and show what each scan covered