Harden CI: SHA-pin all actions, add persist-credentials: false#2
Merged
Conversation
- SHA-pin every uses: line across all 15 workflow files to prevent supply chain attacks via mutable tags - Add persist-credentials: false to all checkout steps (except docs.yml which needs credentials for mkdocs gh-deploy) - Add top-level permissions: contents: read to every workflow to enforce least-privilege token scope
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
uses:line across all 15 workflow files to immutable commit SHAs, preventing supply chain attacks via mutable tagspersist-credentials: falseto allactions/checkoutsteps (17 of 18 -- docs.yml exempted becausemkdocs gh-deployrequires stored git credentials)permissions: contents: readto every workflow to enforce least-privilege token scopeActions pinned
actions/checkoutde0fac2e4500dabe0009e67214ff5f5447ce83ddactions/setup-node48b55a011bda9f5d6aeb4c2d9c7362e8dae4041eactions/setup-pythona309ff8b426b58ec0e2a45f0f869d46889d02405actions/setup-go4a3601121dd01d1626a1e23e37211e3254c1c06cactions/setup-javabe666c2fcd27ec809703dec50e508c2fdc7f6654actions/cache27d5ce7f107fe9357f9df03efb73ab90386fccaepnpm/action-setupb906affcce14559ad1aafd4ab0e942779e9f58b1Files changed
All 15 workflow files under
.github/workflows/.Test plan
docs.ymldeploy still works on merge to main (credentials preserved formkdocs gh-deploy)