Skip to content
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

Set minimum permissions to workflows #76

Closed
gabibguti opened this issue Mar 16, 2023 · 1 comment · Fixed by #77
Closed

Set minimum permissions to workflows #76

gabibguti opened this issue Mar 16, 2023 · 1 comment · Fixed by #77

Comments

@gabibguti
Copy link

Setting minimum permissions to workflows is important to keep your repository safe against supply-chain attacks. GitHub grants a GITHUB_TOKEN with higher permissions than necessary by default for workflows. With higher permissions, if your workflow suffers an attack, the attacker would be able to push malicious code to your repository for example. To avoid that, we set minimum permissions.

I see both workflows, fossa.yaml and go.yml, don't need much permissions, so setting contents: read should be enough. If you agree with the changes, I can open a PR!

This is considered good-practice and recommended by GitHub and other security tools, such as Scorecards and StepSecurity.

Additional context

I'm Gabriela and I work on behalf of Google and the OpenSSF suggesting supply-chain security changes :)

@abhinav
Copy link
Collaborator

abhinav commented Mar 20, 2023

Thanks, @gabibguti!
We'll make the change.

abhinav added a commit that referenced this issue Mar 20, 2023
Reduces the permissions available to GitHub Workflows
to read-only since they don't do much otherwise.

Resolves #76
abhinav added a commit that referenced this issue Mar 20, 2023
Reduces the permissions available to GitHub Workflows
to read-only since they don't do much otherwise.

Resolves #76
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 a pull request may close this issue.

2 participants