diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index caac62d..ca80354 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -9,6 +9,7 @@ on: - motd.txt - scripts/** - .hadolint.yaml + - .trivyignore - .github/workflows/** concurrency: @@ -64,3 +65,27 @@ jobs: - name: Smoke test run: scripts/smoke-test.sh k8s-debug:pr + + # Vulnerability scan (the vulnerability DB is arch independent, so one + # arch is enough). Report everything fixable at HIGH+, but only block the + # PR on fixable CRITICAL so an upstream HIGH disclosure cannot wedge + # unrelated PRs. Add justified exceptions to .trivyignore. + - name: Trivy report (HIGH+, fixable) + if: matrix.arch == 'amd64' + uses: aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0 + with: + image-ref: k8s-debug:pr + severity: HIGH,CRITICAL + ignore-unfixed: true + exit-code: "0" + trivyignores: .trivyignore + + - name: Trivy gate (CRITICAL, fixable) + if: matrix.arch == 'amd64' + uses: aquasecurity/trivy-action@a9c7b0f06e461e9d4b4d1711f154ee024b8d7ab8 # v0.36.0 + with: + image-ref: k8s-debug:pr + severity: CRITICAL + ignore-unfixed: true + exit-code: "1" + trivyignores: .trivyignore diff --git a/.trivyignore b/.trivyignore new file mode 100644 index 0000000..452a742 --- /dev/null +++ b/.trivyignore @@ -0,0 +1,3 @@ +# Trivy exceptions. One CVE id per line, each with a justification and an +# expiry date so that suppressions do not live forever, e.g. +# CVE-2025-12345 exp:2026-12-31 # no fix upstream; not reachable (reason)