Skip to content

Commit 13771ef

Browse files
authored
chore(security): add top-level permissions to 5 reusable workflows (#790)
Adds `permissions: contents: read` (least-privilege default) to the top of five workflow files that had no top-level permissions declaration: - .github/workflows/_build.yaml (Scorecard #513) - .github/workflows/_docker.yaml (Scorecard #514) - .github/workflows/_init.yaml (Scorecard #515) - .github/workflows/_release.yaml (Scorecard #516) - .github/workflows/sync-models.yml (Scorecard #605) Existing job-level `permissions:` blocks within these files are unaffected; the top-level acts as a default ceiling that individual jobs can raise where they actually need write access (Docker push, release tag push, etc.). Stage 1 of 3 in cleaning up TokenPermissionsID findings: Stage 1 (this PR): no top-level permissions -> 5 alerts Stage 2 (separate): broad top-level writes -> 3 alerts Stage 3 (separate): job-level writes for -> 7 alerts legitimate release ops SOC2 CC7.1 vulnerability management — mechanical batch resolution following SECURITY.md disposition framework (Fix). Fixes #789 Co-authored-by: Anand Ray <anand.ray@rocketride.ai>
1 parent 9846a14 commit 13771ef

5 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/_build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Build
22

3+
# Default least-privilege permissions for the workflow. Individual jobs
4+
# below raise to write where they actually need it (Docker push, SARIF
5+
# upload, etc.). Closes Scorecard TokenPermissionsID #513.
6+
permissions:
7+
contents: read
8+
39
on:
410
workflow_call:
511
inputs:

.github/workflows/_docker.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Docker
22

3+
# Default least-privilege permissions for the workflow. Individual jobs
4+
# below raise to write where they actually need it (image push to GHCR).
5+
# Closes Scorecard TokenPermissionsID #514.
6+
permissions:
7+
contents: read
8+
39
on:
410
workflow_call:
511
inputs:

.github/workflows/_init.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Initialize
22

3+
# Default least-privilege permissions for the workflow. The init job
4+
# only reads the repo to compute version/build variables; no writes
5+
# needed. Closes Scorecard TokenPermissionsID #515.
6+
permissions:
7+
contents: read
8+
39
on:
410
workflow_call:
511
inputs:

.github/workflows/_release.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Release
22

3+
# Default least-privilege permissions for the workflow. Individual
4+
# release jobs below raise to write where they actually need it
5+
# (tag pushes, GitHub releases, package publishing).
6+
# Closes Scorecard TokenPermissionsID #516.
7+
permissions:
8+
contents: read
9+
310
on:
411
workflow_call:
512
inputs:

.github/workflows/sync-models.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Sync LLM Models
22

3+
# Default least-privilege permissions for the workflow. The `sync`
4+
# job below raises to contents:write + pull-requests:write to commit
5+
# updated model manifests and open the PR. Closes Scorecard
6+
# TokenPermissionsID #605.
7+
permissions:
8+
contents: read
9+
310
on:
411
schedule:
512
- cron: '0 5 * * 1' # Mondays 05:00 UTC

0 commit comments

Comments
 (0)