Skip to content

Commit 3a2c8dd

Browse files
committed
chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: nathannaveen <[email protected]>
1 parent 24a1ae5 commit 3a2c8dd

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

.github/workflows/build_test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
on: [push, pull_request]
22
name: Build Test
3+
permissions:
4+
contents: read
5+
36
jobs:
47
build_test_v3:
58
strategy:

.github/workflows/labeler.yml

+6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: "Pull Request Labeler"
22
on:
33
- pull_request_target
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
triage:
10+
permissions:
11+
contents: read # for actions/labeler to determine modified files
12+
pull-requests: write # for actions/labeler to add labels to PRs
713
runs-on: ubuntu-latest
814
steps:
915
- uses: actions/labeler@v4

.github/workflows/lint.yml

+6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ on:
44
push:
55
pull_request:
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
golangci:
12+
permissions:
13+
contents: read # for actions/checkout to fetch code
14+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
915
name: lint
1016
runs-on: ubuntu-latest
1117
steps:

.github/workflows/release.yml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
- cron: '0 1 1 * *' # UTC 01:00 on the first day of the Month
44

55
name: Release
6+
permissions:
7+
contents: read
8+
69
jobs:
710
release:
811
runs-on: ubuntu-latest

.github/workflows/shellcheck.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
on: [push, pull_request]
22
name: Shellcheck
3+
permissions:
4+
contents: read
5+
36
jobs:
47
shellcheck:
58
name: Shellcheck

.github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
on: [push, pull_request]
22
name: Test
3+
permissions:
4+
contents: read
5+
36
jobs:
47
test_v3_module:
58
strategy:

0 commit comments

Comments
 (0)