Skip to content

Commit 6848f16

Browse files
Limit privilege escalation and token theft in workflows
https://lists.openssf-vuln.org/g/siren/message/6 - Added explicit permissions blocks to restrict access (mostly contents: read, id-token: write). - Limited event triggers to only trusted branches - Added workflow_dispatch where missing.
1 parent faec389 commit 6848f16

File tree

9 files changed

+28
-1
lines changed

9 files changed

+28
-1
lines changed

.github/workflows/check_changelogs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: Check changelog entries
22

33
on:
44
pull_request:
5+
workflow_dispatch:
56

67
jobs:
78
check-changelogs:
89
name: Check changelog entries
910
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
1013

1114
steps:
1215
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

.github/workflows/codspeed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
permissions:
1414
contents: read
15+
id-token: write
1516

1617
jobs:
1718
benchmarks:

.github/workflows/gpu_test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
env:
1414
LD_LIBRARY_PATH: /usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64
1515

16+
permissions:
17+
contents: read
18+
id-token: write
1619
concurrency:
1720
group: ${{ github.workflow }}-${{ github.ref }}
1821
cancel-in-progress: true

.github/workflows/hypothesis.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- cron: "0 0 * * *" # Daily “At 00:00” UTC
1010
workflow_dispatch: # allows you to trigger manually
1111

12+
permissions:
13+
contents: read
14+
id-token: write
1215
env:
1316
FORCE_COLOR: 3
1417

.github/workflows/issue-metrics.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
id-token: write
910

1011
jobs:
1112
build:

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
branches: [main, 3.1.x]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.ref }}
1214
cancel-in-progress: true

.github/workflows/nightly_wheels.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
build_and_upload_nightly:
1111
name: Build and upload nightly wheels
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
id-token: write
1316

1417
steps:
1518
- uses: actions/checkout@v6

.github/workflows/releases.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
name: Wheels
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
49

10+
permissions:
11+
contents: read
12+
id-token: write
513
jobs:
614

715
build_artifacts:

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
branches: [ main, 3.1.x ]
1111
workflow_dispatch:
1212

13+
permissions:
14+
contents: read
15+
id-token: write
1316
concurrency:
1417
group: ${{ github.workflow }}-${{ github.ref }}
1518
cancel-in-progress: true

0 commit comments

Comments
 (0)