Skip to content

Set restrictive GitHub Action permissions#1985

Merged
agners merged 4 commits intodevfrom
fix-gh-action-permissions
Jun 24, 2022
Merged

Set restrictive GitHub Action permissions#1985
agners merged 4 commits intodevfrom
fix-gh-action-permissions

Conversation

@agners
Copy link
Member

@agners agners commented Jun 24, 2022

Replaces #1942 with the latest reviews implemented.

neilnaveen and others added 4 commits June 24, 2022 09:05
 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: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
With restrictive settings in the global GitHub Action permission settings
those permissions are given implicitly.
@agners agners changed the title Fix GitHub Action permissions Set restrictive GitHub Action permissions Jun 24, 2022
@agners agners added build Build and CI related issues REL-8 labels Jun 24, 2022
@agners agners merged commit d9beee9 into dev Jun 24, 2022
@agners agners deleted the fix-gh-action-permissions branch June 24, 2022 16:46
agners added a commit that referenced this pull request Jul 7, 2022
* chore: Set permissions for GitHub actions

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.

* Remove global permissions which are set implicitly

With restrictive settings in the global GitHub Action permission settings
those permissions are given implicitly.

Co-authored-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Stefan Agner <stefan@agner.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build and CI related issues cla-signed REL-8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants