security: pin third-party GitHub Actions to commit SHAs + least-privilege permissions#81
Merged
Merged
Conversation
…lege permissions Pin all third-party actions to full 40-char commit SHAs (version comments retained) and add a top-level least-privilege 'permissions: contents: read' block to pure-CI workflows. dtolnay/rust-toolchain gains an explicit 'toolchain: stable' input so the SHA pin preserves channel selection. From the 2026-06-22 workspace GitHub Actions security audit. Assisted-With: Claude Opus 4.8 <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
Supply-chain hardening of GitHub Actions workflows:
# versioncomment for readability.permissions: contents: readblock to pure-CI workflows that have no existing top-level permissions block and use no privileged features.First-party
actions/*andgithub/*actions are intentionally left tag-pinned per group convention.Why
Pinning third-party actions to immutable commit SHAs protects against tag-hijacking / mutable-tag supply-chain attacks. Least-privilege default permissions limit the blast radius of a compromised action. From the 2026-06-22 workspace GitHub Actions security audit.
Pins applied
prefix-dev/setup-pixi@v0.9.65185adfbffb4bd703da3010310260805d89ebb11peter-evans/create-pull-request@v85f6978faf089d4d20b00c7766989d076bb2fc7f1pypa/gh-action-pypi-publish@release/v1cef221092ed1bacb1cc03d23a2d87d1d172e277b(v1.14.0)(4 occurrences total across 3 files: setup-pixi appears in all three files — twice in
package.yml.)Permissions
unittest.yml— added top-levelpermissions: contents: read(pure CI, no privileged features).package.yml— not modified (release pipeline usesid-token,anaconda upload,gh-action-pypi-publish); keeps its existing job-levelid-token: write.update-lockfiles.yml— not modified (already has a top-levelpermissions:block and usespeter-evans/create-pull-request).Notes
dtolnay/rust-toolchainortaiki-e/install-actionusages exist in this repo, so those special-case rules did not apply.🤖 Assisted with Claude Code