chore(ci): govulncheck - extend SARIF upload to cover contrib modules#4605
Conversation
Add govulncheck-contribs-analysis job that scans each contrib module (each with its own go.mod) with govulncheck in SARIF format, merges the per-module results into a single SARIF file via jq, and uploads it to GitHub Code Scanning under a distinct 'govulncheck-contribs' category. This resolves the gap where contrib vulnerabilities were caught by the blocking govulncheck-tests job but never appeared in the Security tab. Both core and contrib findings are now visible in GitHub Code Scanning. The new govulncheck-contribs-sarif.sh mirrors the logic of the existing govulncheck-contribs-v2.sh but uses -format sarif and merges outputs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 2198ae3 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
BenchmarksBenchmark execution time: 2026-03-26 10:50:36 Comparing candidate commit 2198ae3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 75 metrics, 0 unstable metrics.
|
528e489
into
kakkoyun/govulncheck-action-allowlist
The contrib SARIF gap is addressed by govulncheck-contribs-analysis (PR #4605), which scans each contrib module and uploads results to GitHub Code Scanning under a distinct category.
Why
The
govulncheck-analysisjob (non-blocking SARIF upload) only scanned core packages. Contrib module vulnerabilities were caught bygovulncheck-tests(blocking, sandboxed) but never appeared in the GitHub Security tab / Code Scanning. This created a gap: a contrib CVE would fail the PR check but leave no trace in the Security dashboard.This PR closes that gap by adding a parallel non-blocking
govulncheck-contribs-analysisjob that scans every contrib module and uploads results to GitHub Code Scanning.What
govulncheck-contribs-sarif.sh— mirrorsgovulncheck-contribs-v2.shbut uses-format sarif. It scans each contrib module, writes a per-module SARIF file to a temp directory, then merges all runs into a single output file viajq.govulncheck-contribs-analysis— sets up Go, installs govulncheck, runs the script, and uploads the merged SARIF under thegovulncheck-contribscategory.govulncheck-analysis: replaces theTODOwith a reference to the new job.pathsfilter: addsgovulncheck-contribs-sarif.shso changes to the script trigger the workflow.Design decisions
Why merge SARIF with
jqinstead of uploading per-module files?The
upload-sarifaction accepts a directory, but uploading N files (one per contrib module) would create N separate tool runs in Code Scanning, making the Security tab noisy. Merging runs into one SARIF file keeps results grouped under a singlegovulncheck-contribscategory.Why not sandbox this job?
The
govulncheck-contribs-analysisjob is non-blocking and informational, consistent withgovulncheck-analysis. The sandboxedgovulncheck-testsjob provides the security boundary for blocking checks.Stack
This PR is part of a stack:
Merge order: #4595 → #4597 → #4598 → #4599 → this PR.
Test plan
govulncheck-contribs-analysisjob appears in the Actions runupload-sarifstep output)govulncheck-contribscategory after merge to main