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: naveen <172697+naveensrinivasan@users.noreply.github.com>
  • Loading branch information
naveensrinivasan committed Jun 3, 2022
1 parent db8638d commit 7884fa4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
github_token: ${{ github.token }}

analyze:
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/autobuild to send a status report
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 12
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/install_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- cron: '0 13 * * *'
- cron: '0 2 * * *'

permissions:
contents: read

jobs:
install_and_verify:
name: Install latest stable version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish_dev_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
types:
- completed

permissions:
contents: read

jobs:
generate_and_publish_dev_release_artifacts:
name: Generate and Publish Dev Release Artifacts
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish_pricing_to_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- cron: '0 13 * * *'
- cron: '0 2 * * *'

permissions:
contents: read

jobs:
generate_and_publish_pricing_data:
name: Generate and Publish Pricing file to S3
Expand Down

0 comments on commit 7884fa4

Please sign in to comment.