chore(ci): govulncheck - use official golang/govulncheck-action for SARIF analysis#4599
Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 9341efc | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-03-27 11:54:41 Comparing candidate commit 9341efc in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 215 metrics, 9 unstable metrics.
|
42b3d61 to
f5cf6b9
Compare
4ba424d to
b8999e7
Compare
…#4605) ## Why The `govulncheck-analysis` job (non-blocking SARIF upload) only scanned core packages. Contrib module vulnerabilities were caught by `govulncheck-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-analysis` job that scans every contrib module and uploads results to GitHub Code Scanning. ## What - **New script**: `govulncheck-contribs-sarif.sh` — mirrors `govulncheck-contribs-v2.sh` but 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 via `jq`. - **New job**: `govulncheck-contribs-analysis` — sets up Go, installs govulncheck, runs the script, and uploads the merged SARIF under the `govulncheck-contribs` category. - **Updated comment** in `govulncheck-analysis`: replaces the `TODO` with a reference to the new job. - **Updated `paths` filter**: adds `govulncheck-contribs-sarif.sh` so changes to the script trigger the workflow. ## Design decisions **Why merge SARIF with `jq` instead of uploading per-module files?** The `upload-sarif` action 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 single `govulncheck-contribs` category. **Why not sandbox this job?** The `govulncheck-contribs-analysis` job is non-blocking and informational, consistent with `govulncheck-analysis`. The sandboxed `govulncheck-tests` job provides the security boundary for blocking checks. ## Stack This PR is part of a stack: ``` main └── #4595 kakkoyun/govulncheck (base) └── #4597 kakkoyun/govulncheck-persist-credentials └── #4598 kakkoyun/govulncheck-sandboxed-step └── #4599 kakkoyun/govulncheck-action-allowlist └── this PR kakkoyun/govulncheck-contrib-sarif ``` Merge order: #4595 → #4597 → #4598 → #4599 → this PR. ## Test plan - [ ] CI passes on this branch (all three jobs green) - [ ] `govulncheck-contribs-analysis` job appears in the Actions run - [ ] SARIF upload succeeds (check `upload-sarif` step output) - [ ] GitHub Security tab shows findings under `govulncheck-contribs` category after merge to main
f5cf6b9 to
aa79d34
Compare
…lysis Replaces manual go install + govulncheck -format sarif with the official Go Security Team action (golang/govulncheck-action@v1.0.4). The action handles Go setup internally and always uses the latest govulncheck. This PR will fail CI: golang/govulncheck-action is blocked by the DataDog enterprise action allowlist (it internally uses actions/checkout@v4.1.1 and actions/setup-go@v5.0.0). This PR exists to start the discussion for adding it to the allowlist. Ref: https://github.com/golang/govulncheck-action
528e489 to
ddeee11
Compare
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.
What does this PR do?
Replaces the manual
go install govulncheck@latest+govulncheck -format sarifin thegovulncheck-analysisjob with the officialgolang/govulncheck-action@v1.0.4maintained by the Go Security Team.Motivation
The official Go Security Team action provides:
go installmaintenance--format sarifflag internallysetup-go+go install+govulncheck)The manual approach (from #4595) works correctly but requires us to maintain the invocation ourselves.
Note: The
govulncheck-testsjob (blocking CI check) retains direct invocation via the sandboxed-step from #4598, sincegolang/govulncheck-actiondoesn't support the multi-module scanning pattern needed for the 65+ contrib modules.CI failure context
When we first tried this action in #4595, CI failed with:
The action itself is from the
golangGitHub org (official Go project). The only blocker is that its internal transitive dependency on older SHA-pinned action versions triggers the allowlist check.To merge this PR: request adding
golang/govulncheck-actionto the DataDog enterprise GitHub Actions allowlist.References
persist-credentials: falsegeomys/sandboxed-step(stacked below this PR)Reviewer's Checklist