fix: withhold the forge token from Trivy, and tell a scan error from a finding #99

Merged
cjournois merged 1 commit from fix/trivy-github-token into main 2026-11-09 14:07:47 +00:00
Collaborator

Every image job on 8.0.0 fails before scanning: Trivy's ghcr keychain sends GITHUB_TOKEN, which on Forgejo is the forge job token, and ghcr refuses it (DENIED: denied, games run 358). The pipeline already strips it for mise (setup.sh); scan.sh missed it.

  • Trivy runs without GITHUB_TOKEN.
  • A Trivy that cannot run now says so ("trivy could not run (exit N)") instead of reporting a critical vulnerability; findings use exit code 10.

Verified: just lint test (540 bats) green; mutants dropping the token removal or the exit-code split are both caught; live Image job on games#92 (spike) — see comment.

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

Every image job on 8.0.0 fails before scanning: Trivy's ghcr keychain sends `GITHUB_TOKEN`, which on Forgejo is the forge job token, and ghcr refuses it (`DENIED: denied`, games run 358). The pipeline already strips it for mise (`setup.sh`); `scan.sh` missed it. - Trivy runs without `GITHUB_TOKEN`. - A Trivy that cannot run now says so ("trivy could not run (exit N)") instead of reporting a critical vulnerability; findings use exit code 10. Verified: `just lint test` (540 bats) green; mutants dropping the token removal or the exit-code split are both caught; live Image job on games#92 (spike) — see comment. Session: 60ac4614-d609-4e43-a004-27bdaf30476c
fix: withhold the forge token from Trivy, and tell a scan error from a finding
Some checks failed
ci: reusable-pipeline / CI Pipeline (pull_request) Successful in 41s
ci: reusable-pipeline / CI Pipeline (push) Has been cancelled
331dd58560
Trivy's ghcr keychain sends GITHUB_TOKEN, which on Forgejo is the forge job token that ghcr refuses with DENIED, so every image job failed to download the database.
That failure was also reported as a critical vulnerability; findings now use their own exit code.

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

Live check: games#92 pointed ffxiv-strats at this fix; its Image job passed (ok image-export (7s), ok trivy (16s) — DB downloaded, image scanned). Spike closed.

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

Live check: games#92 pointed ffxiv-strats at this fix; its Image job passed (`ok image-export (7s)`, `ok trivy (16s)` — DB downloaded, image scanned). Spike closed. Session: 60ac4614-d609-4e43-a004-27bdaf30476c
bot-claude changed title from WIP: fix: withhold the forge token from Trivy, and tell a scan error from a finding to fix: withhold the forge token from Trivy, and tell a scan error from a finding 2026-11-09 14:01:35 +00:00
cjournois deleted branch fix/trivy-github-token 2026-11-09 14:07:47 +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!99
No description provided.