Add zizmor to CI and stop double-running the security scan - #6251
Merged
Conversation
security-scan.yml has its own pull_request trigger and was also called as a reusable workflow from run-on-pr.yml, so Grype and govulncheck ran twice for every PR. Drop the call from run-on-pr.yml and let the direct trigger cover PRs; its branch filter is removed so coverage matches what run-on-pr.yml gave. The same duplication existed on main, where the push: trigger overlapped with the call from run-on-main.yml. That call is kept, because image-build-and-push gates on its result, and the push: trigger is dropped instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Grype and govulncheck cover our dependencies and our Go code, but nothing checks the workflows themselves, so anti-patterns accumulate with no signal. Advisory to start with: --no-exit-codes stops findings failing the job and continue-on-error stops a tool or network failure doing so, while the existing backlog is worked through. Both come off once it can gate. Findings are written straight to SARIF and never printed. Workflow logs and job summaries are world-readable on a public repository, so echoing them would publish them; the SARIF upload keeps them in the Security tab. The upload is skipped for fork PRs, whose token is read-only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
The zizmor job's checkout now sets persist-credentials: false — it only reads workflow files and never pushes, so leaving the token in .git/config served no purpose. Both upload-sarif pins move to the commit the v4 tag actually points at. They were pinned to f205ea1c, which is a releases/v4 branch commit (v4.37.4) that no tag references, so the trailing "# v4" comment was misleading and the pin was 56 commits behind v4. The Grype job's pin is updated alongside the new one so the two agree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6251 +/- ##
==========================================
+ Coverage 72.72% 72.75% +0.03%
==========================================
Files 742 742
Lines 77281 77299 +18
==========================================
+ Hits 56199 56238 +39
+ Misses 17122 17080 -42
- Partials 3960 3981 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
10 tasks
stacklokbot
approved these changes
Aug 10, 2026
10 tasks
ChrisJBurns
added a commit
that referenced
this pull request
Aug 10, 2026
The Grype and govulncheck jobs only read the tree — anchore/scan-action scans the filesystem and govulncheck-action runs with repo-checkout false — so neither needs the token left in .git/config. These were held back from the previous commit only because #6251 also edits this file. A trial merge of the two branches is clean, so there is no reason to defer them further. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChrisJBurns
added a commit
that referenced
this pull request
Aug 10, 2026
The Grype and govulncheck jobs only read the tree — anchore/scan-action scans the filesystem and govulncheck-action runs with repo-checkout false — so neither needs the token left in .git/config. These were held back from the previous commit only because #6251 also edits this file. A trial merge of the two branches is clean, so there is no reason to defer them further. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ChrisJBurns
added a commit
that referenced
this pull request
Aug 10, 2026
* Stop persisting git credentials in CI checkouts actions/checkout writes the job token into .git/config and leaves it there for the rest of the job unless told otherwise. None of these jobs push, so the credential is available to every subsequent step and every tool they invoke for no reason. Covers the CI workflows only. Excluded: the release workflows, which no pull request can exercise; the three running claude-code-action, which has broad shell access and may need to push; api-compat.yml, which does a `git fetch` and is the repository's only required status check; and security-scan.yml, whose checkout is handled in the zizmor PR. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Stop persisting credentials in security scan checkouts The Grype and govulncheck jobs only read the tree — anchore/scan-action scans the filesystem and govulncheck-action runs with repo-checkout false — so neither needs the token left in .git/config. These were held back from the previous commit only because #6251 also edits this file. A trial merge of the two branches is clean, so there is no reason to defer them further. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
security-scan.ymlruns Grype and govulncheck, which cover our dependencies and our Go code — nothing looks at.github/itself, so workflow anti-patterns accumulate with no signal. This adds zizmor as a job in the existing security scan.security-scan.ymlhas its ownpull_requesttrigger and was called as a reusable workflow fromrun-on-pr.yml, so Grype and govulncheck each ran two full times on every pull request. The same overlap existed on main, between thepush:trigger and the call fromrun-on-main.yml. This keeps exactly one path each and reclaims the duplicate runs.zizmor is deliberately advisory to start with. It reports 111 findings against the current tree, and gating on that today would just block every PR.
--no-exit-codesstops findings failing the job andcontinue-on-errorstops a tool or network failure doing so; both come off once the backlog is worked through, which is inventoried in #6253.Closes #6250
Type of change
Test plan
task test)task test-e2e)task lint-fix)No Go code changes, so the repo's own test tasks aren't meaningful here. What was verified locally:
actionlintpasses clean on both changed files.zizmor 1.29.0runs to completion against.github/and emits valid SARIF, exit code 0 with--no-exit-codesdespite 111 findings.run-on-pr.ymlhadneeds: security-scan, so removing that job strands nothing.run-on-main.ymlstill calls the workflow andimage-build-and-pushstill gates on it vianeeds, so the main-branch path is unchanged.CRD Schema Compatibility— moving which workflow reports the security scan won't leave PRs waiting on a check that never runs.pipxis present on theubuntu-24.04runner image, so no extra setup action is needed.The zizmor job itself won't run on this PR —
security-scan.ymlhas to be on the base branch before itspull_requesttrigger applies. Its first execution will be post-merge, or viaworkflow_dispatchfrom this branch if you'd like to see it before approving.Does this introduce a user-facing change?
No.
Special notes for reviewers
.github/is public and zizmor is open source, so anyone can already run it against us; it just avoids handing over a pre-baked report.pull_requestis intentionally unfiltered by branch.security-scan.yml's own trigger wasbranches: [main], butrun-on-pr.ymlfired on all PRs — leaving the filter in place would have quietly narrowed coverage.upload-sarifline copies the existing pin from the Grype job. That pin's# v4comment doesn't match a real tag, which zizmor itself flags; left consistent with the existing line rather than fixed inline, and tracked in zizmor findings backlog: pins, expressions and checkout credentials #6253. (Since fixed on this branch — see below.)Generated with Claude Code