Skip to content

fix(ci): limit Trivy SARIF severities to CRITICAL,HIGH#101

Merged
marevol merged 1 commit into
mainfrom
fix/trivy-sarif-severity-filter
May 21, 2026
Merged

fix(ci): limit Trivy SARIF severities to CRITICAL,HIGH#101
marevol merged 1 commit into
mainfrom
fix/trivy-sarif-severity-filter

Conversation

@marevol

@marevol marevol commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

The trivy vulnerability scan job in .github/workflows/docker.yml was triggered by the v2.0.0a0 tag push and failed with exit code 1, even though the only fixable finding was a MEDIUM severity CVE (CVE-2026-45409 in idna 3.13).

Root cause: when format: sarif is used without limit-severities-for-sarif: true, aquasecurity/trivy-action overrides TRIVY_SEVERITY to include every severity ("Building SARIF report with all severities" in the log) so that the SARIF uploaded to the GitHub Security tab is complete. The side-effect is that exit-code: 1 then evaluates findings of every severity — silently disabling the explicit severity: "CRITICAL,HIGH" input.

Change

Add limit-severities-for-sarif: true to the Trivy step so that:

  • The SARIF report contains only CRITICAL/HIGH findings.
  • exit-code: 1 fires only on CRITICAL/HIGH (which is the original intent).
  • The fixable MEDIUM idna CVE no longer breaks tag/main builds; it should still be addressed by a regular dependency bump.

Test plan

  • CI green on this PR (the workflow change runs against the PR build).
  • After merge, the next push to main and the next semver tag complete the trivy vulnerability scan job successfully.
  • GitHub Security tab continues to receive SARIF uploads (only CRITICAL/HIGH now).

Without `limit-severities-for-sarif: true`, the trivy-action overrides
`TRIVY_SEVERITY` to all severities when `format: sarif`, which causes
`exit-code: 1` to fire on MEDIUM/LOW findings as well — the explicit
`severity: CRITICAL,HIGH` input is effectively ignored.

The v2.0.0a0 build went red on a MEDIUM idna CVE-2026-45409 for this
reason; with the new flag, both the SARIF report and the exit-code gate
honour the configured CRITICAL/HIGH filter.
@marevol marevol merged commit e86e5d1 into main May 21, 2026
5 checks passed
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