Skip to content

Commit

Permalink
🧹 Monitor workflows for least privileges (#835)
Browse files Browse the repository at this point in the history
This adds the GHA monitor to some of our workflows: https://github.com/GitHubSecurityLab/actions-permissions/tree/main/monitor
These workflows do not have permissions specified. The action should tell us the least needed privileges.

Signed-off-by: Christian Zunker <[email protected]>
  • Loading branch information
czunker authored Aug 17, 2023
1 parent 035ecec commit e0af85c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/cloud-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
k8s-version: ["1.25", "1.26", "1.27"]

steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch is needed for "git tag --list" in the Makefile
Expand Down Expand Up @@ -141,6 +144,9 @@ jobs:
AWS_REGION: us-east-2

steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch is needed for "git tag --list" in the Makefile
Expand Down Expand Up @@ -222,6 +228,9 @@ jobs:
KUBECONFIG: ${{ format('{0}/{1}', github.workspace, '.github/terraform/gke/kubeconfig') }}

steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch is needed for "git tag --list" in the Makefile
Expand Down Expand Up @@ -302,6 +311,9 @@ jobs:
needs: [eks-integration-test,aks-integration-test,gke-integration-test]
if: always()
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch is needed for "git tag --list" in the Makefile
Expand All @@ -325,6 +337,9 @@ jobs:
# Run only if the previous job has failed and only if it's running against the main branch
if: ${{ always() && contains(join(needs.*.result, ','), 'fail') && github.ref_name == 'main' }}
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
with:
config: ${{ vars.PERMISSIONS_CONFIG }}
- uses: actions/checkout@v3
- name: Import environment variables from file
run: cat ".github/env" >> $GITHUB_ENV
Expand Down

0 comments on commit e0af85c

Please sign in to comment.