Skip to content

Commit

Permalink
Set permissions for GitHub actions
Browse files Browse the repository at this point in the history
- 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/)

 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.

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
  • Loading branch information
neilnaveen committed Apr 14, 2022
1 parent edfdb9d commit 0e4f74d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-amd64.yml
Expand Up @@ -48,6 +48,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-test-amd64-images:
name: Build and test amd64 Docker Images
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pre-commit.yml
Expand Up @@ -8,6 +8,9 @@ on:
- master
workflow_dispatch:

permissions:
contents: read

jobs:
run-hooks:
name: Run pre-commit hooks
Expand Down

0 comments on commit 0e4f74d

Please sign in to comment.