-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add minimal permissions to GitHub workflows #262
Comments
I have changed this at the org level, and confirmed that it propagated to all repo settings. But this is not visible to anyone outside, is it? So how did you know... Are you filing these issues with the assumption that folks have left read/write enabled? |
It isn't transparent to outsiders, no, but it can be sniffed out! Just need to look at the workflow logs, in the "Set up job" step there's a "GITHUB_TOKEN permissions" section which lists all permissions granted to that particular job (example). Though, if I'm being honest, I could just as easily assume people left things as write-all... exceptions are rare! |
Heh, well that's pretty transparent, just in a hidden place. :) Is there much value left in changing the individual workflow settings? In #263 it looks like that does have further effect, dropping |
The value is mainly in redundancy (in case someone gets confused and changes the setting) and config-as-code, which makes it easier for users to see your workflows are secure. So the absolute best practice would be to do both, but just changing the setting already gets you 99% of the way there, so totally understandable if you'd rather skip the explicit permissions. |
Also, some tools (for example, the OpenSSF Scorecard) score projects' supply-chain security posture, and they check this sort of thing. For token permissions, they scan for explicit permissions since hunting through logs is too convoluted. |
Closing this since the repo default was already changed! |
GitHub workflows run with write-all permissions. This makes repositories vulnerable to supply-chain attacks.
Given num-traits' workflows are mainly for testing, they don't require such broad permissions. I'd therefore like to help the project close this vulnerability.
This can be done in two ways:
I'll send a PR along with this issue setting the top-level permissions on the workflows.
Or, if you'd rather (or also wish to) change the repository's default settings:
Disclosure: My name is Pedro and I work with Google and the Open Source Security Foundation (OpenSSF) to improve the supply-chain security of the open-source ecosystem.
The text was updated successfully, but these errors were encountered: