Skip to content
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

Set GitHub Workflow permissions to read only #190

Closed
joycebrum opened this issue Feb 27, 2023 · 1 comment · Fixed by #191
Closed

Set GitHub Workflow permissions to read only #190

joycebrum opened this issue Feb 27, 2023 · 1 comment · Fixed by #191

Comments

@joycebrum
Copy link
Contributor

Hi, I'm also from Google and I'm working with the openSSF to help open source project to increase their supply chain security posture.

The first improvement I would like to suggest is to set permissions for GITHUB_TOKEN on the github workflows, because the default behavior of github when handling workflows is to grant them write-all permission. That's why it is a good practice recommended both by the OpenSSF Scorecard and the Github itself to always use credentials that are minimally scoped.

This can be easily done by setting the top level permission as contents: read (usually enough to most actions) or even read-all, and grant any write permission at the job level.

This way, even in the case of a compromised workflow, the attacker won't be able to do much.

Let me know if that's ok to submit the PR and I'll do it ASAP.

@floitsch
Copy link
Collaborator

floitsch commented Feb 27, 2023

Sounds good to me.
I would be happy to merge a pull request. If you don't have the time, I will try to look into it over the next few days/weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants