Skip to content

Commit c2b7e81

Browse files
committed
ci(scorecard): add explicit least-privilege job permissions
The OSSF Scorecard reusable-workflow wrapper job relied on a broad workflow-level `read-all` and had no job-level permissions (Hypatia `scorecard_wrapper_missing_job_permissions`). Grant the documented least-privilege set on the job (contents/actions read; security-events/id-token write) and narrow the workflow-level grant to `contents: read`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KfgJznd6jzSeDYsSXGAXkU
1 parent 0afe7ca commit c2b7e81

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/scorecard.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@ on:
88
push:
99
branches: [main]
1010

11-
permissions: read-all
11+
permissions:
12+
contents: read
1213

1314
jobs:
1415
analysis:
16+
# Explicit least-privilege permissions for the OSSF Scorecard reusable
17+
# workflow (the documented set), instead of relying on a broad
18+
# workflow-level `read-all`:
19+
permissions:
20+
contents: read # read the repository
21+
actions: read # inspect workflow runs (Token-Permissions, etc.)
22+
security-events: write # upload results to the code-scanning dashboard
23+
id-token: write # OIDC, to publish results / badge
1524
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@d7c22711e830e1f383846472f6e9b99debdb201e
1625
secrets: inherit

0 commit comments

Comments
 (0)