Skip to content

Commit 11bfcd6

Browse files
authored
fix(ci): add least-privilege permissions to workflow files (#2944)
Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
1 parent 0029aec commit 11bfcd6

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/build_external_container_images.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ on:
55

66
permissions:
77
contents: read
8-
packages: write
98

109
jobs:
1110
build_and_push_images:
1211
name: Build and Push ${{ matrix.image.name }} Image
1312
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
1416
strategy:
1517
matrix:
1618
image:

.github/workflows/codeql.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111

1212
permissions:
1313
contents: read
14-
id-token: write # required for SLSA attestation
1514

1615
jobs:
1716
analyze:

.github/workflows/stale.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
- cron: '30 1 * * *'
66
workflow_dispatch:
77

8+
# Job-level permissions completely replace workflow-level defaults, so the
9+
# token only receives the job's issues: write + pull-requests: write grants.
10+
permissions: {}
11+
812
jobs:
913
close-issues:
1014
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)