Skip to content

Commit 8d4837c

Browse files
Copilotbact
andcommitted
security: move write permissions from workflow level to job level
Workflow-level permissions are restricted to contents:read. Each job that requires write access (corpus push, issue filing) declares its own permissions block explicitly. Co-authored-by: bact <128572+bact@users.noreply.github.com>
1 parent ee23334 commit 8d4837c

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/clusterfuzzlite.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ on:
3030
# Corpus Pruning: 04:00 AM UTC+7 = 21:00 UTC (2.5 h after Batch Fuzzing)
3131
- cron: '0 21 * * *'
3232

33+
# Restrict default permissions to read-only at the workflow level.
34+
# Each job that needs write access declares it explicitly.
3335
permissions:
34-
contents: write
35-
issues: write
36+
contents: read
3637

3738
jobs:
3839
# -------------------------------------------------------------------------
@@ -44,6 +45,9 @@ jobs:
4445
name: PR Fuzzing
4546
if: github.event_name == 'pull_request' || github.event_name == 'push'
4647
runs-on: ubuntu-latest
48+
permissions:
49+
contents: write # Push corpus updates to gh-pages
50+
issues: write # Allow run_fuzzers to file issues on crashes
4751
# Cancel in-progress runs for the same branch to avoid wasted resources.
4852
# Uses the source repo name to avoid cross-fork collisions.
4953
concurrency:
@@ -123,6 +127,9 @@ jobs:
123127
github.event_name == 'schedule' &&
124128
github.event.schedule == '30 18 * * *'
125129
runs-on: ubuntu-latest
130+
permissions:
131+
contents: write # Push corpus updates to gh-pages
132+
issues: write # Allow run_fuzzers to file issues on crashes
126133
# Do not cancel in-progress batch runs; let them finish naturally.
127134
concurrency:
128135
group: batch-fuzzing-${{ github.repository }}
@@ -199,6 +206,8 @@ jobs:
199206
github.event_name == 'schedule' &&
200207
github.event.schedule == '0 21 * * *'
201208
runs-on: ubuntu-latest
209+
permissions:
210+
contents: write # Push pruned corpus back to gh-pages
202211
# Do not cancel in-progress pruning runs.
203212
concurrency:
204213
group: corpus-pruning-${{ github.repository }}

0 commit comments

Comments
 (0)