ci: pin least-privilege token permissions on the ci workflow - #86
Open
cargo-affected-bot wants to merge 1 commit into
Open
ci: pin least-privilege token permissions on the ci workflow#86cargo-affected-bot wants to merge 1 commit into
cargo-affected-bot wants to merge 1 commit into
Conversation
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.
Nightly survey finding on
.github/workflows/ci.yaml.ci.yamlis the only workflow in this repo with nopermissions:block —release.yamland all eighttend-*.yamlfiles pin their own. Without the key theGITHUB_TOKENinherits the repository-wide default, which on apushtomaincan carry write scopes across contents, packages, and more.None of the three jobs needs any of that.
actions/checkoutis the only step in the file that touches the GitHub API, andcontents: readcovers it.Swatinem/rust-cacheuses the Actions cache service (its ownACTIONS_*credentials, not theGITHUB_TOKEN),baptiste0928/cargo-installbuilds from crates.io, and nothing in the workflow referencesGITHUB_TOKENorsecrets.*at all.This is the same change the maintainer already landed for
release.yamlin #66, applied to the last workflow still missing it.No regression test. This is workflow configuration with no code path a test could exercise; the change is verified by CI on this PR running green under the restricted token. I confirmed the YAML parses and that the three jobs are unchanged apart from the added key.