chore(security): narrow storage-cleanup.yml permissions to job-level#794
Conversation
Moves \`actions: write\` from the workflow-level permissions block to the \`cleanup\` job's own permissions block. Top-level now defaults to \`contents: read\`, so any future job added to this workflow inherits read-only by default rather than the broad cleanup token. The \`cleanup\` job's effective permissions are unchanged (\`actions: write\` + \`contents: read\`), so behavior is identical. Stage 2a of the TokenPermissionsID cleanup. Stage 1 (PR #790) verified that the top-level least-privilege pattern is accepted by Scorecard. Closes Scorecard alert #528. SOC2 CC7.1 vulnerability management. Fixes #793
|
No description provided. |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughJob-level permissions are explicitly configured in the ChangesWorkflow Permissions Narrowing
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
kwit75
left a comment
There was a problem hiding this comment.
LGTM — clean least-privilege migration. Moves actions: write from top-level to the cleanup job that actually uses it. Effective permissions unchanged for existing job; future jobs added to this workflow will inherit contents: read instead of the broad write token. Closes Scorecard #528. CI green.
Summary
Moves
actions: writefrom the workflow-level permissions block to thecleanupjob's own permissions block. Top-level default narrows fromactions: write + contents: readtocontents: readonly.Behavior
Unchanged. The
cleanupjob's effective permissions stay the same (actions: write+contents: read). The narrowing only affects any future jobs added to this workflow — they'll inheritcontents: readby default rather than the broad cleanup token.Diff
Type
chore (security hardening)
Linked Issue
Fixes #793
Stage tracking
This is Stage 2a of the 3-stage TokenPermissionsID cleanup:
permissions: contents: readadded to 5 reusable workflowsstorage-cleanup.ymltop-levelnightly.yamltop-level — wait for stage-branch rewrite to settleSOC2 Notes
CC7.1 vulnerability management — closes Scorecard alert #528 (TokenPermissionsID). Following SECURITY.md disposition framework: Fixed.
Summary by CodeRabbit