Skip to content

ci: fix trivy scan alerts not resolving by setting SARIF category per image - #223

Merged
Soner (shyim) merged 1 commit into
mainfrom
fix/security-scan-sarif-category
Jul 27, 2026
Merged

ci: fix trivy scan alerts not resolving by setting SARIF category per image#223
Soner (shyim) merged 1 commit into
mainfrom
fix/security-scan-sarif-category

Conversation

@shyim

Copy link
Copy Markdown
Member

Problem

The security workflow runs trivy scans across a matrix of 4 PHP versions x 8 image variants (32 jobs), and every job uploaded its SARIF with no category set. GitHub groups code-scanning analyses by (tool, category, ref), so all 32 uploads shared one analysis — the last job to finish became the "current" one. On every nightly run, alerts from all other images got resolved and then reopened, producing constant churn and alerts that never stayed fixed (1,296 stale open alerts accumulated).

Fix

Set a unique category per matrix combination (php-version-variant) in the upload-sarif step, so each image has its own analysis and its alerts auto-resolve once the vulnerability is actually gone from the published image.

Note

The existing open alerts were created under the old empty category and are orphaned — they have been bulk-closed manually. Alerts for CVEs still present in the current images will be re-reported by the next scan, this time under the correct category.

All 32 matrix jobs uploaded trivy SARIF results with no category, so
they shared a single code-scanning analysis. The last job to finish
became the 'current' analysis, causing alerts from the other images to
be resolved and reopened on every run - nothing ever stayed fixed.

Give each matrix combination (PHP version + variant) its own category
so alerts resolve automatically once the vulnerability is gone from
the published image.
@shyim
Soner (shyim) merged commit 35fffaf into main Jul 27, 2026
14 checks passed
@shyim
Soner (shyim) deleted the fix/security-scan-sarif-category branch July 27, 2026 06:40
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