Restrict permissions for GitHub actions#2334
Conversation
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. - 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/) Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
|
In all the links you provided, I didn't see any need or example for adding |
This has the https://github.com/styfle/cancel-workflow-action permissions https://github.com/styfle/cancel-workflow-action#advanced-token-permissions HTH.
I don't know. Probably asking the owner of the action would help. |
Codecov Report
@@ Coverage Diff @@
## master #2334 +/- ##
=======================================
Coverage 98.04% 98.04%
=======================================
Files 118 118
Lines 10458 10458
=======================================
Hits 10254 10254
Misses 140 140
Partials 64 64 Continue to review full report at Codecov.
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @naveensrinivasan - LGTM.
Merging.
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.
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
Signed-off-by: naveensrinivasan 172697+naveensrinivasan@users.noreply.github.com