Skip to content

Commit

Permalink
chore: Set permissions for GitHub actions
Browse files Browse the repository at this point in the history
 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>
  • Loading branch information
nathannaveen authored and vitaut committed May 30, 2022
1 parent fe6eb79 commit 11316b2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: doc

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
# Use Ubuntu 20.04 because doxygen 1.8.13 from Ubuntu 18.04 is broken.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: linux

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: macos

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
runs-on: macos-10.15
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: windows

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
runs-on: ${{matrix.os}}
Expand Down

0 comments on commit 11316b2

Please sign in to comment.