Set permissions for GitHub actions (#1228)
- 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>
This commit is contained in:
parent
56f5b0f0fa
commit
f3d8206a07
3
.github/workflows/branch_build.yml
vendored
3
.github/workflows/branch_build.yml
vendored
@ -5,6 +5,9 @@ on:
|
|||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
- release/*
|
- release/*
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
install-notest:
|
install-notest:
|
||||||
if: "github.repository != 'WebGoat/WebGoat'"
|
if: "github.repository != 'WebGoat/WebGoat'"
|
||||||
|
3
.github/workflows/pr_build.yml
vendored
3
.github/workflows/pr_build.yml
vendored
@ -20,6 +20,9 @@ on:
|
|||||||
- 'LICENSE'
|
- 'LICENSE'
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -104,6 +104,8 @@ jobs:
|
|||||||
- name: "Image digest"
|
- name: "Image digest"
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
new_version:
|
new_version:
|
||||||
|
permissions:
|
||||||
|
contents: write # for Git to git push
|
||||||
if: github.repository == 'WebGoat/WebGoat'
|
if: github.repository == 'WebGoat/WebGoat'
|
||||||
name: Update development version
|
name: Update development version
|
||||||
needs: [ release ]
|
needs: [ release ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user