Reduce permission for milestone GitHub Action #3193
Merged
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.
This PR reduces the permission of the
add-milestone-to-pull-requests
GitHub Action to the minimum possible.This is specially important on GitHub Actions that use the
pull_request_target
trigger, because it can run on pull requests by external contributors (which is what we want for this tagger action). More details about the dangers ofpull_request_target
here: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/Despite these concerns,
pull_request_target
is the trigger we want because we do want external pull requests to trigger this Action and have permission to edit the milestone of a pull request (a write permission).Notes
The only other action using, the
pull-request-labeler
, already has minimum permissions declared, thanks to well-documented default permissions by the Action author:dd-trace-rb/.github/workflows/pull-request-labeler.yml
Lines 7 to 9 in 5e27525