Skip to content

Commit 5bf0b02

Browse files
sashashurajsquyres
authored andcommitted
github-labeler.yaml: update permissions/security
This PR adds explicit [permissions section](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions) to workflows. This is a security best practice because by default workflows run with [extended set of permissions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) (except from `on: pull_request` [from external forks](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an [injection](https://securitylab.github.com/research/github-actions-untrusted-input/) or compromised third party tool or action) is restricted. It is recommended to have [most strict permissions on the top level](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) and grant write permissions on [job level](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) case by case. Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
1 parent 74f9e24 commit 5bf0b02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/github-labeler.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ on:
1313
- opened
1414
- edited
1515

16+
permissions: {} # none
17+
1618
jobs:
1719
ci:
20+
permissions:
21+
pull-requests: write
1822
name: Label Bot
1923
runs-on: ubuntu-latest
2024
steps:

0 commit comments

Comments
 (0)