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

Restrict permissions for GitHub action #29104

Closed
wants to merge 1 commit into from

Conversation

ashishkurmi
Copy link
Contributor

Description

This PR adds minimum token permissions for the GITHUB_TOKEN in GitHub Actions workflows using https://github.com/step-security/secure-workflows.

The GitHub Actions workflow has a GITHUB_TOKEN with write access to multiple scopes.
Here is an example of the permissions in one of the workflow runs:
https://github.com/spring-projects/spring-framework/runs/8233093764?check_suite_focus=true#step:1:19

After this change, the scopes will be reduced to the minimum needed for the workflow.

Motivation and Context

Signed-off-by: Ashish Kurmi akurmi@stepsecurity.io

Signed-off-by: Ashish Kurmi <akurmi@stepsecurity.io>
@pivotal-cla
Copy link

@boahc077 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 8, 2022
@pivotal-cla
Copy link

@boahc077 Thank you for signing the Contributor License Agreement!

@snicoll snicoll added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 8, 2022
@snicoll snicoll added this to the 5.3.x milestone Sep 8, 2022
@snicoll snicoll changed the title ci: add minimum GitHub token permissions for workflows Restrict permissions for GitHub action Sep 8, 2022
@snicoll snicoll self-assigned this Sep 8, 2022
@snicoll snicoll modified the milestones: 5.3.x, 5.3.23 Sep 8, 2022
snicoll pushed a commit that referenced this pull request Sep 8, 2022
@snicoll snicoll closed this in c503f35 Sep 8, 2022
@snicoll
Copy link
Member

snicoll commented Sep 8, 2022

@boahc077 thank you for making your first contribution to Spring Framework.

@vpavic
Copy link
Contributor

vpavic commented Sep 8, 2022

@snicoll
Copy link
Member

snicoll commented Sep 8, 2022

Thanks Vedran, I had forgotten about that. I've changed the default permission.

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.

None yet

5 participants