ci: pin govulncheck and narrow release workflow permissions#22
ci: pin govulncheck and narrow release workflow permissions#22chethanuk wants to merge 1 commit into
Conversation
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Warning Review limit reached
Next review available in: 57 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughCI Govulncheck installation is pinned to v1.6.0. The release workflow now uses read-only contents permission and pins the GitHub Release action to a v2.6.2 commit. ChangesWorkflow hardening
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
2edcd32 to
ce53df5
Compare
Pin govulncheck to v1.6.0 instead of @latest. The argument is reproducibility, not supply chain: golang.org/x/vuln is the Go team's own module and go install is already checksum-verified via GOSUMDB. What @latest costs is a new govulncheck release turning CI red on an unchanged tree. This gate is load-bearing - e6e5da0 bumped the Go image to fix GO-2026-5856 after govulncheck caught it - so protecting it from unrelated churn is worth a pin. Pinning costs nothing in scan freshness: the vulnerability database is fetched at runtime, independently of the binary version. Verified: Scanner govulncheck@v1.6.0, DB updated 2026-07-08, no vulnerabilities, exit 0. Narrow release.yml's workflow-level permissions from contents: write to contents: read. Only the build job inherits it, and it only checks out and uploads artifacts - upload-artifact authenticates with ACTIONS_RUNTIME_TOKEN, not GITHUB_TOKEN. The release and npm-publish jobs declare their own job-level permissions, which replace the inherited set entirely, so both are unaffected. Pin softprops/action-gh-release from the floating @v2 tag to commit 3bb1273 (# v2.6.2). This is the one third-party action in the release path, and it runs in the only job holding contents: write, so a retagged @v2 would execute with write access to the repository. The pin is behaviour-preserving today: @v2 and v2.6.2 both resolve to 3bb12739c298aeb8a4eeaf626c5b8d85266b0e65, so this changes nothing that runs, only what can change underneath us. Staying on the v2 line deliberately - v3.0.2 exists upstream but a major bump is a separate decision from pinning. Verified with actionlint (clean across all workflows) and by confirming the release.yml still parses as YAML.
ce53df5 to
1510512
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Description
Two independent hardening changes to the release/CI workflows, two lines total.
1. Pin
govulncheck— for reproducibility, not supply chainci.yml:33runsgo install golang.org/x/vuln/cmd/govulncheck@latest.I want to be careful about the argument here, because the obvious one is wrong. This is not
"executing unpinned third-party code" —
golang.org/x/vulnis the Go team's own module, andgo installis already checksum-verified through GOSUMDB. Framing it as supply chain would beoverselling it.
The real cost of
@latestis reproducibility: a new govulncheck release can turn CI red onan unchanged tree, with nothing in the repo having moved. That's the framing
grafana/tempouses verbatim:
And this gate is load-bearing, not decorative.
e6e5da0— "ci: bump Go image to 1.26.5 tofix GO-2026-5856 govulncheck failure" — is a real vulnerability this scanner caught in the Go
standard library, which forced a toolchain bump. Protecting a gate you already rely on from
unrelated churn seems worth one line.
Pinning costs nothing in scan freshness, which is the objection I'd expect. The vulnerability
database is fetched at runtime, independently of the binary version. Verified on Go 1.26.5:
The
DB updated:line is the proof — a pinned v1.6.0 binary still pulled a database from sixdays prior. v1.6.0 is the current release, re-resolved at ship time via
git ls-remote --tags https://go.googlesource.com/vulnrather than taken from notes.Peers:
grafana/tempo,k3s-io/k3s,google/trillian,redis/go-redis,lightningnetwork/lnd.2. Narrow
release.ymlworkflow-level permissionsrelease.yml:7-8grants workflow-levelcontents: write. Only one job actually inherits it, andthat job never writes. Traced all three:
permissions:build(:11)upload-artifact@v4authenticates withACTIONS_RUNTIME_TOKEN, notGITHUB_TOKENrelease(:59):62-65contents: write,id-token: write,attestations: writenpm-publish(:161):167-168contents: readsecrets.NPM_TOKENJob-level
permissions:replaces the inherited set entirely, soreleaseandnpm-publishare already fully insulated from the workflow-level value today. Narrowing is a strict no-op for
them, and drops an unused write grant from
build.I verified
builddirectly rather than reasoning about it: lines 11-57 contain onlyactions/checkout@v4andactions/upload-artifact@v4, with noGITHUB_TOKENreference and noghinvocation anywhere.Permission matrix re-read from the parsed YAML after the edit:
Deliberately NOT included: pinning
softprops/action-gh-releaseThis repo uses exactly one third-party action,
softprops/action-gh-release@v2atrelease.yml:145, in a job holdingcontents: write+id-token: write— so SHA-pinning it isa reasonable thing to want, and it's the compromise class that hit
tj-actions/changed-files.I left it alone on purpose. Open dependabot PR alibaba#347 proposes moving that exact line to
@v3.Pinning it to a v2 SHA underneath that would create a direct textual conflict and pin an
about-to-be-obsolete major. Pinning should follow that decision, not pre-empt it — happy to send
it as a follow-up once alibaba#347 is resolved either way. The diff touches zero
softpropslines.Verification
actionlintv1.7.12 — exit 0 across all four workflowsgovulncheck@v1.6.0installed, reported its version, and scanned the tree clean (above)git diff origin/main -- .github/workflows/release.yml | grep -c softprops→ 0yaml.safe_loadon both changed filesLimitations
release.ymlonly fires onpush: tags: ['v*'], so the first real exercise is the next release. The evidence is thetraced matrix above plus the fact that job-level blocks already override the workflow-level
value for the two jobs that need write.
buildever gains a step that writes viaGITHUB_TOKEN, itwould need its own job-level block — worth knowing, though nothing in it does today.
github-actionsecosystem does not covergo installlines, so this one is manual — that's agenuine (small) cost of pinning and I'd rather state it than skip it.
Type of Change
How Has This Been Tested?
govulncheck@v1.6.0, confirmedScanner: govulncheck@v1.6.0, a runtime-fetchedDB updated: 2026-07-08, andNo vulnerabilities found.with exit 0buildcontains noGITHUB_TOKENorghusagesoftpropslines in the diff (no conflict with chore(deps): bump the actions group across 1 directory with 9 updates alibaba/open-code-review#347)actionlintv1.7.12 — exit 0Checklist
AI assistance: Claude Code helped research and verify this change. I reviewed the full diff
and take responsibility for it.
Summary by CodeRabbit