Skip to content

Conversation

@sashashura
Copy link
Contributor

@sashashura sashashura commented Sep 2, 2022

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.


This change is Reviewable

@sashashura
Copy link
Contributor Author

Ready to merge?

@rthadur
Copy link
Contributor

rthadur commented Sep 20, 2022

We need one more approval , @mattsoulanille could you please help review this PR.Thank you!

Copy link
Member

@mattsoulanille mattsoulanille left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! We should also update deploy-benchmark-preview.yml, which runs on PRs and is therefore more dangerous.

@sashashura
Copy link
Contributor Author

sashashura commented Sep 25, 2022

LGTM. Thanks! We should also update deploy-benchmark-preview.yml, which runs on PRs and is therefore more dangerous.

It is triggered on pull_request only, which has restricted permissions. But it doesn't hurt to have explicit read-only permissions there too just for the consistency.

dydavidkim added a commit to CodeSmithDSMLProjects/tfjs that referenced this pull request Sep 26, 2022
Update deploy-benchmark-prod.yml (tensorflow#6814)
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 this pull request may close these issues.

5 participants