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

ci: add minimum GitHub token permissions for workflows #8928

Merged
merged 2 commits into from
Dec 12, 2022

Conversation

ashishkurmi
Copy link

Description

This PR adds minimum token permissions for the GITHUB_TOKEN in GitHub Actions workflows using 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/open-mmlab/mmdetection/actions/runs/3095931510/jobs/5010897300#step:1:19

After this change, the scopes will be reduced to the minimum needed for the following workflows:

  • build.yml
  • build_pat.yml
  • deploy.yml
  • lint.yml
  • stale.yml
  • test_mim.yml

Motivation and Context

  • This is a security best practice, so if the GITHUB_TOKEN is compromised due to a vulnerability or compromised Action, the damage will be reduced.
  • GitHub recommends defining minimum GITHUB_TOKEN permissions.
  • The Open Source Security Foundation (OpenSSF) Scorecards also treats not setting token permissions as a high-risk issue. This change will help increase the Scorecard score for this repository.

Signed-off-by: Ashish Kurmi [email protected]

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2022

CLA assistant check
All committers have signed the CLA.

Signed-off-by: Ashish Kurmi <[email protected]>
@ZwwWayne ZwwWayne changed the base branch from master to dev October 8, 2022 02:48
@ZwwWayne ZwwWayne modified the milestones: 2.27.0, 2.26.0 Oct 8, 2022
@ZwwWayne ZwwWayne merged commit 0dfe3f0 into open-mmlab:dev Dec 12, 2022
@OpenMMLab-Assistant005
Copy link

Hi @boahc077 !First of all, we want to express our gratitude for your significant PR in the MMDet project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR.

We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/raweFPmdzG

If you have WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)
Thank you again for your contribution❤

thmegy pushed a commit to thmegy/mmdetection that referenced this pull request May 5, 2023
…8928)

* ci: add minimum GitHub token permissions for workflows
Signed-off-by: Ashish Kurmi <[email protected]>

* removing yaml comments

Signed-off-by: Ashish Kurmi <[email protected]>

Signed-off-by: Ashish Kurmi <[email protected]>
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.

None yet

4 participants