-
-
Notifications
You must be signed in to change notification settings - Fork 62.8k
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
security(workflow): Set permissions for GitHub actions #6820
security(workflow): Set permissions for GitHub actions #6820
Conversation
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. Signed-off-by: naveensrinivasan <[email protected]>
With #6202 permissions needs be extended to read. I also have in mind autotag PR with |
Can that be a separate one?
That is probably within your code in JS. I couldn't figure that out. You can set permissions specific to the Job using this https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions
|
Thanks for your all support @naveensrinivasan!
Of course. It only was linked to take in mind this changes. Let's wait what tell us other members with a bit more experience with GH actions. @SethFalco @borgified is this PR suitable and usefull? |
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.
LGTM after reading the documentation and some other @SethFalco 's messages about Actions security
- ci(workflow): post build result as comment #5564 (comment)
- build(fpb-lint): linting errors as PR comments, resolved #4416 #6914 (comment)
It ensures same behavior across forks/origin with zero config
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.
Signed-off-by: naveensrinivasan [email protected]