Skip to content

Commit 637c4fa

Browse files
chris-rockclaude
andauthored
Explicitly set permissions on all GitHub Actions workflows (#1384)
Adds top-level permissions blocks to every workflow that was missing one, following the principle of least privilege. Also removes the now-unnecessary permissions monitor action from the lint workflow. Closes #843 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent feff81f commit 637c4fa

9 files changed

Lines changed: 32 additions & 3 deletions

.github/workflows/cla.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
pull_request_target:
77
types: [opened, closed, synchronize]
88

9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
issues: write
13+
actions: read
14+
915
jobs:
1016
CLAssistant:
1117
runs-on: ubuntu-latest

.github/workflows/cloud-tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
default: main
1717
description: The image tag to use for the mondoo operator image
1818

19+
permissions:
20+
contents: read
21+
checks: write
22+
1923
env:
2024
MONDOO_OPERATOR_IMAGE_TAG: ${{ github.event.inputs.mondooOperatorImageTag || 'main' }}
2125
CNSPEC_IMAGE_TAG: ${{ github.event.inputs.cnspecImageTag || 'latest-rootless' }}

.github/workflows/edge-integration-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
required: true
88
type: string
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
integration-tests:
1215
uses: ./.github/workflows/integration-tests.yaml

.github/workflows/leftover-spaces-cleaner.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
# Every Sunday at 11PM
66
- cron: '0 23 * * 0'
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest

.github/workflows/link-check.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
push:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
md-links:
1114
name: Run markdown link check

.github/workflows/lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ on:
88
- "main"
99
tags: ["v*.*.*"]
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
lint:
1316
runs-on: ubuntu-latest
1417
name: Lint
1518
steps:
16-
- uses: GitHubSecurityLab/actions-permissions/monitor@37c927c24552caa0ef6040ab0876db729cc12754 # v1.0.2-beta7
17-
with:
18-
config: ${{ vars.PERMISSIONS_CONFIG }}
1919
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2020
- name: Import environment variables from file
2121
run: cat ".github/env" >> $GITHUB_ENV

.github/workflows/publish-images.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
types:
66
- completed
77

8+
permissions:
9+
contents: read
10+
811
env:
912
# Use docker.io for Docker Hub if empty
1013
REGISTRY: ghcr.io

.github/workflows/publish.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
# Publish semver tags as releases.
1414
tags: ["v*.*.*"]
1515

16+
# Restrictive top-level default; individual jobs escalate as needed.
17+
permissions:
18+
contents: read
19+
1620
env:
1721
REGISTRY: ghcr.io
1822
GHCR_IMAGE: ghcr.io/${{ github.repository }}

.github/workflows/release-manifests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Release Manifests
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: write
8+
69
env:
710
# Use docker.io for Docker Hub if empty
811
REGISTRY: ghcr.io

0 commit comments

Comments
 (0)