Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

GitHub Workflows security hardening #5503

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

sashashura
Copy link
Contributor

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.

Signed-off-by: sashashura <[email protected]>
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

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

Thanks for this! And for going through and shepherding this same change on so many widely-used projects!

@haltman-at
Copy link
Contributor

What does contents actually cover? I'm having trouble finding documentation on this.

@sashashura
Copy link
Contributor Author

sashashura commented Sep 8, 2022

What does contents actually cover? I'm having trouble finding documentation on this.

Here is the mapping of GitHub app contents to api calls. This is the best I can find, otherwise it is not documented.

Copy link
Member

@cds-amal cds-amal left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@cds-amal cds-amal merged commit 444d064 into trufflesuite:develop Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants