Repository navigation
Declare token permissions in ci.yml and crossvalidate.yml - #7
Merged
Merged
Conversation
CodeQL's actions queries flagged both: neither declared a permissions block, so the GITHUB_TOKEN they run with is whatever the repository default happens to be. That default is currently read, so nothing was actually over-permitted, which is the reason this is worth fixing rather than urgent: the workflows were relying on a setting elsewhere staying what it is, and a change to it would widen them without anyone touching them. Both only check out the code and run things over it, so contents: read is the whole list. These were the first two findings from the CodeQL setup added a few commits ago, and they were in workflows I wrote, which is roughly the argument for having a machine read them.
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.
Closes the two open CodeQL alerts, both
actions/missing-workflow-permissions.Neither workflow declared a
permissions:block, so each runs with whatever the repository default is. That default is currentlyread, so nothing was over-permitted in practice. What the alert is really about is the dependency: the workflows were relying on a setting elsewhere staying what it is, and flipping the repository default to write would widen both without anyone touching them.Both only check out the code and run things over it, so
contents: readis the whole list.The other eight workflows already declared theirs. Worth noting these two were files I wrote, and CodeQL's
actionsqueries are exactly what caught them.