Skip to content

Commit 7594d40

Browse files
chore: Set permissions for GitHub actions (#637)
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 <42319948+nathannaveen@users.noreply.github.com> Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com> Co-authored-by: Shine Lee <aungshine@gmail.com>
1 parent 989d86e commit 7594d40

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/docker.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ on:
77
branches:
88
- master
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
init:
15+
permissions:
16+
contents: none
1217
runs-on: ubuntu-latest
1318
outputs:
1419
do_docker: ${{ steps.vars.outputs.IS_DOCKERHUB_PUSH }}

.github/workflows/testing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ '**' ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
name: Tests and Code Coverage

0 commit comments

Comments
 (0)