Add zizmor GitHub Actions static analysis - #148
Merged
Conversation
Also applies zizmor --fix=all to existing workflows: pins previously unpinned/mutable action refs to commit SHAs and adds persist-credentials: false to checkout steps, clearing every pre-existing high-severity finding. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The missing pull-request trigger leaves workflow changes from forks untested.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds zizmor-based static analysis to harden GitHub Actions security.
Changes:
- Adds CI and pre-commit zizmor checks.
- Disables persisted checkout credentials across workflows.
- Pins and documents action versions.
File summaries
| File | Description |
|---|---|
.pre-commit-config.yaml |
Adds the zizmor hook. |
.github/workflows/actions-static-analysis.yml |
Adds workflow security analysis. |
.github/workflows/ci.yml |
Hardens checkout credentials. |
.github/workflows/canary.yml |
Hardens checkout credentials. |
.github/workflows/plugin-compat.yml |
Hardens both checkout steps. |
.github/workflows/settings-verify.yml |
Hardens both checkout steps. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Balanced
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
…h to main Bot reviewers (Copilot, Sentry) correctly flagged that a push-only trigger misses fork-based PRs and can't act as a required merge-gate status check. Scoping push to the default branch avoids the original double-run problem (push firing on every commit to a same-repo PR branch, redundant with pull_request) while restoring PR-gate coverage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ings - Added `permissions: contents: read` to the fast-checks job in ci.yml. The job only checks out code and runs ruff/mypy/pytest/pre-commit checks — no writes anywhere, so read-only contents access is sufficient. - Lowered min-severity from high to medium in actions-static-analysis.yml and in the zizmor pre-commit hook args in .pre-commit-config.yaml, now that the medium-severity finding above is fixed. - yamlfmt reformatted the zizmor hook block indentation in .pre-commit-config.yaml as part of the pre-commit run (no semantic change). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What are the relevant tickets?
N/A
Description (What does it do?)
Hardens the supply-chain security posture of this repo's GitHub Actions workflows by adding zizmor, a static analysis tool for GitHub Actions YAML that catches issues like script injection via untrusted input, overly broad
permissions:blocks, unpinned/mutable action references, and other common workflow misconfigurations. Mirrors the pattern already rolled out tomitodl/mit-learn,mitodl/ol-django,mitodl/ol-keycloak, and others.New CI workflow —
.github/workflows/actions-static-analysis.ymlruns zizmor viazizmorcore/zizmor-action(pinned tov0.6.2by commit SHA) onpushto anything under.github/workflows/**. It scans.github/workflows/and fails on findings athighseverity /mediumconfidence or above. The workflow itself follows least-privilege practice: top-levelpermissions: {}with onlycontents: readandactions: readgranted to the job, and the checkout step usespersist-credentials: false.New pre-commit hook —
.pre-commit-config.yamlgains azizmorcore/zizmor-pre-commitentry (pinned tov1.29.0) using thezizmorhook ID, so contributors get the same linting feedback locally before pushing, not just in CI.Existing workflows fixed — ran
zizmor --fix=allagainst this repo's pre-existing workflow files, which auto-applies zizmor's safe fixes (pinning unpinned action refs to commit SHAs, addingpersist-credentials: false). This cleared every high-severity finding zizmor reports against this repo. Remaining findings are medium severity or below and don't trip the new workflow'smin-severity: highgate.Screenshots (if appropriate):
N/A - no UI changes.
How can this be tested?
.github/workflows/actions-static-analysis.ymldirectly — confirm it only triggers on changes under.github/workflows/**, uses SHA-pinned action references, and grants the job onlycontents: readandactions: read.Additional Context
Part of an org-wide zizmor rollout; this repo was in the first wave, scoped to repos with GitHub Actions workflows that had the most recent push activity.