Harden GitHub Actions workflows and add zizmor audit#242
Merged
Conversation
- Pin all third-party actions to full commit SHAs with version comments - Add least-privilege `permissions` blocks at workflow and job level - Set `persist-credentials: false` on checkouts that don't push to git - Disable uv cache in release workflows to avoid cache-poisoning risk - Add a `zizmor.yml` workflow that runs the zizmor security audit on push and PR
Kludex
commented
Apr 5, 2026
.github/workflows/zizmor.yml
Outdated
Comment on lines
+17
to
+18
| contents: read # Only needed for private repos. Needed to clone the repo. | ||
| actions: read # Only needed for private repos. Needed for upload-sarif to read workflow run info. |
|
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. |
- Pin pypa/gh-action-pypi-publish to the actual commit SHA for v1.13.0 (the previous value was the annotated tag object SHA, which zizmor flagged as having no history in the referenced repository) - Drop contents/actions read permissions from the zizmor job since this repository is public and zizmor-action only needs them for private or internal repos
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
permissionsblocks at the workflow and job level.persist-credentials: falseon checkouts that don't push to git (thedocs.ymldeploy job keeps credentials becausemkdocs gh-deploypushes togh-pages; theartipackedfinding is suppressed inline).zizmor.ymlworkflow that runs the zizmor security audit on every push tomasterand on every pull request.Modeled after Kludex/uvicorn@042ffeb.
Test plan
zizmor .github/workflows/reports no findings locally.