Skip to content

Restrict permissions for GitHub action #31344

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

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]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 13, 2022
@snicoll snicoll changed the title chore: Set permissions for GitHub actions Set permissions for GitHub actions Jun 13, 2022
@snicoll snicoll added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 13, 2022
@snicoll snicoll self-assigned this Jun 13, 2022
@snicoll snicoll added this to the 2.6.9 milestone Jun 13, 2022
@snicoll snicoll changed the title Set permissions for GitHub actions Restrict permissions for GitHub action Jun 13, 2022
snicoll pushed a commit that referenced this pull request Jun 13, 2022
@snicoll snicoll closed this in fb37ce7 Jun 13, 2022
@snicoll
Copy link
Member

snicoll commented Jun 13, 2022

@naveensrinivasan thank you for making your first contribution to Spring Boot.

@vpavic
Copy link
Contributor

vpavic commented Jun 17, 2022

FWIW, these kind of concerns are IMO better addressed at either repository or organization level under Actions settings:
image

@wilkinsona
Copy link
Member

Thanks, @vpavic. I've changed that for this repository. I'll see if that's something we want to change at the org level too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants