Skip to content

Commit 6c3b9e9

Browse files
authored
chore(ci): add top-level permissions: read-all to workflows (RAN-46 AC) (#90)
Closes one of the audit gaps from RAN-46 AC #2 ("Workflow permissions: default to read-all, scoped up per job") + Scorecard Token-Permissions finding. Before: - ci-java.yml had no permissions declaration anywhere — relied on repo-default GITHUB_TOKEN scope (which can be write-all on older repos). - beta-java.yml + release-java.yml only had job-level scopes; missing the explicit top-level read-all that Scorecard checks for. After: - All three workflows declare `permissions: read-all` at the top level. - ci-java.yml's build job now declares `contents: read` explicitly (no other scopes needed — Sonar uses SONAR_TOKEN, not GITHUB_TOKEN). - beta-java.yml and release-java.yml keep their existing job-level `contents: write` (and `packages: write` for beta) which override the top-level for the deploy/tag steps. Audit confirmation (orthogonal to the (A)/(B) security-stack ruling still pending on RAN-46): - All `uses:` SHA-pinned across all 4 workflows (Pinned-Dependencies) - No pull_request_target anywhere (Dangerous-Workflow) - scorecard.yml already had `permissions: read-all` at top level
1 parent 6c8497f commit 6c3b9e9

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/beta-java.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Beta Release (Java)
22
on:
33
workflow_dispatch: # Manual trigger ONLY
44

5+
permissions: read-all
6+
57
jobs:
68
beta:
79
runs-on: ubuntu-latest

.github/workflows/ci-java.yml

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

9+
permissions: read-all
10+
911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
1216
steps:
1317
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
1418
with:

.github/workflows/release-java.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
description: 'Release version (e.g., 0.1.0)'
77
required: true
88

9+
permissions: read-all
10+
911
jobs:
1012
release:
1113
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)