Skip to content

fix(ci): ignore unfixed image CVEs#146

Merged
kvithayathil merged 2 commits into
mainfrom
fix/backend-trivy-ignore-unfixed
Jun 26, 2026
Merged

fix(ci): ignore unfixed image CVEs#146
kvithayathil merged 2 commits into
mainfrom
fix/backend-trivy-ignore-unfixed

Conversation

@kvithayathil

@kvithayathil kvithayathil commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the remaining docker-build CI failure after PR #145 by changing image vulnerability scanning to gate only actionable CVEs.

Changes:

  • Upgrade Debian packages during backend image builds before installing Python tooling.
  • Add APT_CACHE_BUST to backend CI builds so the apt-get update && apt-get upgrade layer is not restored stale from BuildKit cache.
  • Set all Trivy image scans to ignore-unfixed: true while keeping exit-code: 1.
  • Add always() to the docker-build job condition so backend-only PRs still run Docker checks when frontend jobs are skipped.

Root Cause

docker-build failed on main because Trivy reported HIGH/CRITICAL Debian 13.5 CVEs in the backend image. Local verification showed those findings currently have no fixed Debian package versions available, so apt-get upgrade alone cannot remediate them.

The intended gate is now:

  1. Apply available OS package fixes during image build.
  2. Ignore unfixed distro CVEs that cannot be patched yet.
  3. Continue failing CI for HIGH/CRITICAL CVEs when a fixed version exists.

Verification

Local verification:

docker build --pull --build-arg APT_CACHE_BUST=local-verify --file backend/Dockerfile --tag votecatcher-backend:trivy-check backend
trivy image --ignore-unfixed --severity CRITICAL,HIGH --exit-code 1 votecatcher-backend:trivy-check

docker build --pull --build-arg APT_CACHE_BUST=local-verify-prod --file backend/Dockerfile.prod --tag votecatcher-backend:prod-trivy-check backend
trivy image --ignore-unfixed --severity CRITICAL,HIGH --exit-code 1 votecatcher-backend:prod-trivy-check

.agent-workspace/.local/bin/actionlint -ignore "SC2129" .github/workflows/ci.yml .github/workflows/code-quality.yml

GitHub Actions verification:

Notes

Raw actionlint still reports pre-existing ShellCheck SC2129 style warnings in summary shell blocks. Those warnings are unrelated to this PR and were ignored for workflow syntax validation.

ignore-unfixed: true is a deliberate CI policy change: known but currently unpatchable distro CVEs remain visible in Trivy output, but they do not block CI until fixed package versions exist.

@kvithayathil kvithayathil requested review from a team as code owners June 26, 2026 02:25
@kvithayathil kvithayathil merged commit 3835dc5 into main Jun 26, 2026
14 checks passed
@kvithayathil kvithayathil deleted the fix/backend-trivy-ignore-unfixed branch June 26, 2026 02:58
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