-
Notifications
You must be signed in to change notification settings - Fork 2.2k
gha/sync-release-branch: Use actions write permission #7102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,7 +29,7 @@ jobs: | |||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||
| permissions: | ||||||||||||
| contents: write | ||||||||||||
| workflows: write | ||||||||||||
| actions: write | ||||||||||||
| outputs: | ||||||||||||
| base_sha: ${{ steps.sync.outputs.base_sha }} | ||||||||||||
| has_changes: ${{ steps.sync.outputs.has_changes }} | ||||||||||||
|
|
@@ -120,7 +120,7 @@ jobs: | |||||||||||
| environment: docker-releases | ||||||||||||
| permissions: | ||||||||||||
| contents: write | ||||||||||||
| workflows: write | ||||||||||||
| actions: write | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [medium/security] The
This job runs in a Suggested fix: Remove
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah not sure if that will work, but Kevin said there's a chance and I trust him!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah not sure if that will work, but Kevin said there's a chance and I trust him!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough to be cautious! The good news is that If there's concern about breaking the workflow, you could test it on a separate PR or branch first. But based on the code here, |
||||||||||||
| timeout-minutes: 10 | ||||||||||||
| steps: | ||||||||||||
| - name: Checkout | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[medium/security]
actions: writeis broader than required for this job's git-only operationsBoth this job's steps (
git push origin HEAD:refs/heads/$temporary_branch) only requirecontents: write, which is already granted. Theactions: writescope was added as a replacement for the previously-invalidworkflows: write, but it grants significantly more than is needed:If this workflow were compromised (e.g. via a malicious pinned action), the
actions: writetoken could be used to tamper with other workflow runs or wipe CI audit logs.Suggested fix: Remove
actions: writeentirely —contents: writealone is sufficient for all git operations this job performs.