Skip to content

Set minimal workflow permissions #53297

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

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

pnacht
Copy link
Contributor

@pnacht pnacht commented Mar 16, 2023

Fixes #53296

As per the linked issue, this PR sets top-level read-only permissions on all workflows. This reduces risks in case any workflow dependencies are compromised in a supply-chain attack.

Some of the workflows seem to require contents: write permissions to push directly to the repository. These have been given read-only top-level permissions and then write permissions at the job level. This is for future proofing, in case additional jobs that do not require write access are added to the workflow.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 16, 2023
@jakebailey
Copy link
Member

Is there a reason to do it this way as opposed to changing the global settings (on our end) to start as read-only and then explicitly grant permissions?

@jakebailey
Copy link
Member

So, seems like well take this, flip the repo root setting, then remove all of the top-level ones as they will be redundant.

@jakebailey
Copy link
Member

Sent #53298 now that the repo has changed (which reverts some of this PR); let me know if it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grant minimal permissions to workflows
3 participants