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 Token Permissions for github workflows #6583

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Set Token Permissions for github workflows #6583

merged 2 commits into from
Oct 3, 2023

Conversation

joycebrum
Copy link
Contributor

Motivation for features / changes

GitHub grants, by default, write-all permission for the GITHUB_TOKEN, which is shared by the actions used and, in case of any action got compromised, can be exploited by a malicious attacker.

Considering this, it is both an OpenSSF Scorecard and GitHub recommendation to use permissions minimally scoped.

Technical description of changes

To minimally scope the permissions, it is a good practice to set a read-only basic permission (such as contents: read) and grant any additional permission on job level. In tensorboard case, only the contents: read on top level is enough for both workflows.

Screenshots of UI changes (or N/A)

N/A

Detailed steps to verify changes work correctly (as executed by you)

I've checked the CI.yml workflow at https://github.com/joycebrum/tensorboard/actions/runs/6190658790 and it is working fine.

The nightly-release does not need any permission from GITHUB_TOKEN other than contents: read (for the ci.yml to run)

Alternate designs / implementations considered (or N/A)

N/A

@yatbear yatbear self-requested a review September 18, 2023 17:12
@groszewn groszewn merged commit 2d3b322 into tensorflow:master Oct 3, 2023
12 checks passed
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.

3 participants