Skip to content

chore: Set permissions for GitHub actions #1230

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 2 commits into from
Jul 14, 2022

Conversation

naveensrinivasan
Copy link
Contributor

Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests

Signed-off-by: naveen [email protected]

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: naveen <[email protected]>
@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #1230 (0720cc5) into master (755c780) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1230   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          22       22           
  Lines        5698     5698           
=======================================
  Hits         5615     5615           
  Misses         83       83           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 755c780...0720cc5. Read the comment docs.

@tleonhardt
Copy link
Member

@naveensrinivasan Thank you for educating me on this topic and helping us fix it!

@@ -9,8 +9,15 @@ on:
schedule:
- cron: '0 6 * * 4'

permissions:
contents: read
Copy link
Member

Choose a reason for hiding this comment

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

What are the default permissions for everything? I couldn't find documentation on that? Also, should we explicitly set any permissions to none to be extra-safe?

@tleonhardt tleonhardt merged commit 6f53558 into python-cmd2:master Jul 14, 2022
@naveensrinivasan
Copy link
Contributor Author

@naveensrinivasan Thank you for educating me on this topic and helping us fix it!

👍

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.

2 participants