ci(security): narrow Trivy code scanning upload

This commit is contained in:
Daniel Radl 2026-08-20 19:25:33 +02:00
parent f706f3a402
commit 12dadba5a8
2 changed files with 10 additions and 6 deletions

View File

@ -200,19 +200,21 @@ jobs:
summary.write("\n") summary.write("\n")
PY PY
- name: Upload Trivy results to code scanning on main - name: Upload v16 amd64 build results to code scanning on main
if: >- if: >-
${{ ${{
always() && always() &&
inputs.version == '16' &&
matrix.arch == 'amd64' &&
github.ref == 'refs/heads/main' && github.ref == 'refs/heads/main' &&
(github.event_name == 'push' || github.event_name == 'schedule') && github.event_name == 'push' &&
hashFiles('trivy-results/*.sarif') != '' hashFiles('trivy-results/build.sarif') != ''
}} }}
continue-on-error: true continue-on-error: true
uses: github/codeql-action/upload-sarif@v4 uses: github/codeql-action/upload-sarif@v4
with: with:
sarif_file: trivy-results sarif_file: trivy-results/build.sarif
category: trivy-${{ inputs.version }}-${{ matrix.arch }} category: trivy-v16-amd64-build
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v7 uses: actions/setup-python@v7

View File

@ -77,7 +77,9 @@ During the initial rollout, Trivy is report-only:
- SARIF reports are retained as workflow artifacts for 30 days - SARIF reports are retained as workflow artifacts for 30 days
- pull requests show a capped findings list in the workflow summary and retain - pull requests show a capped findings list in the workflow summary and retain
the complete SARIF reports as artifacts the complete SARIF reports as artifacts
- results are uploaded to GitHub Code Scanning only on pushes to `main` - only the version 16 AMD64 `build` image report is uploaded to GitHub Code
Scanning, and only on pushes to `main`; complete reports for every image and
architecture remain available as workflow artifacts
This provides visibility before deciding which vulnerability classes should This provides visibility before deciding which vulnerability classes should
become blocking. become blocking.