Skip to content

feat: emit least-privilege top-level workflow permissions - #251

Merged
joshua-temple merged 1 commit into
mainfrom
feat/least-privilege-workflow-permissions
Jun 22, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
feat/least-privilege-workflow-permissions

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Generated workflows carried contents: write (and actions: write) at the top level, so OSSF Scorecard flagged high-severity TokenPermissions; every job inherited write scope.

Fix

The generator now emits a least-privilege top-level default (contents: read) and pushes write scopes down to only the jobs that need them: orchestrate finalize gets contents: write (plus deployments: write for native deployments); promote finalize gets contents: write and actions: write; the hotfix and rollback committing jobs get their writes job-scoped. This extends the same least-privilege approach as the merged callback-permissions work (#204) from callback scopes to cascade's own base orchestration scopes. Reusable-workflow caller jobs keep their declared permissions including id-token: write for OIDC.

Verification

go test ./... (1678 pass); golangci-lint clean; e2e build/vet clean; a new Docker e2e scenario asserts top-level contents: read with job-level writes (PASS), and the OIDC callback scenario still passes. cascade verify reports no drift on the regenerated workflows. schema_version unchanged.

Addresses the Scorecard TokenPermissions alerts on the generated orchestrate and promote workflows. The hand-authored hotfix.yaml (alert #2) is handled separately.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple enabled auto-merge (squash) June 22, 2026 19:23
@joshua-temple
joshua-temple merged commit 74a68ec into main Jun 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant