Commit 2d3b322
authored
Set Token Permissions for github workflows (#6583)
## 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](https://github.com/ossf/scorecard) and
[GitHub](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-secrets)
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
---------
Signed-off-by: Joyce <joycebrum@google.com>1 parent d97fef4 commit 2d3b322
2 files changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
0 commit comments