ci(security): harden CI/CD supply chain with SHA pinning and least-privilege permissions#650
Merged
Merged
Conversation
…ivilege permissions - Pin all GitHub Actions to full SHA with version comments - Add top-level permissions: contents: read to test.yml - Add top-level permissions: contents: read to release.yml (write only at job level) - Upgrade pypa/gh-action-pypi-publish from release/v1 tag to v1.14.0 SHA - Add pip ecosystem tracking to dependabot - Add commit-message prefixes and labels to dependabot config
7ee5423 to
b2b3275
Compare
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 changed
Action pinning
All GitHub Actions SHA-pinned to full 40-char commits with
# vX.Y.Zcomments, preventing tag-hijacking attacks:actions/checkout@v6@de0fac2...(v6)actions/setup-python@v6@a309ff8...(v6)pypa/gh-action-pypi-publish@release/v1@cef2210...(v1.14.0)peaceiris/actions-gh-pages@v4@4f9cc66...(v4)Least-privilege permissions
permissions: { contents: read }(previously defaulted to broad read/write).permissions: { contents: read }; write permissions granted only at thepublishjob level where needed.Dependabot
pipecosystem tracking (weekly).ci/chore) and labels for easier triage.open-pull-requests-limitto both ecosystems.Why
Supply-chain attacks on GitHub Actions (e.g., codecov, tj-actions) exploit mutable tags and overly broad tokens. SHA pinning + least privilege are the standard mitigations recommended by GitHub and OpenSSF.