10000 CI: add permission to GH actions. by tupui · Pull Request #17138 · scipy/scipy · GitHub
[go: up one dir, main page]

Skip to content

CI: add permission to GH actions. #17138

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 1 commit into from
Oct 5, 2022
Merged

CI: add permission to GH actions. #17138

merged 1 commit into from
Oct 5, 2022

Conversation

tupui
Copy link
Member
@tupui tupui commented Oct 3, 2022

Following NumPy in numpy/numpy#22367 (and prior to that Cython)

Adds permission to GH actions.

This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted.
It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.

@tupui tupui added CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure github Items related to the code repository labels Oct 3, 2022
[skip azp] [skip circle]
@rgommers rgommers added this to the 1.10.0 milestone Oct 5, 2022
Copy link
Member
@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea, and it's all green. So in it goes. Thanks @tupui

@rgommers rgommers merged commit 964ddce into scipy:main Oct 5, 2022
@tupui tupui deleted the ci_readonly branch October 5, 2022 18:23
ev-br pushed a commit to ev-br/scipy that referenced this pull request Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure github Items related to the code repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0