chore(security): add top-level permissions to 5 reusable workflows#790
Conversation
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
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughFive reusable GitHub Actions workflows (_build.yaml, _docker.yaml, _init.yaml, _release.yaml, sync-models.yml) now declare top-level least-privilege permissions ( ChangesSOC2 Compliance: Workflow Permission Declarations
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 |
|
No description provided. |
kwit75
left a comment
There was a problem hiding this comment.
LGTM — pure additive top-level least-privilege defaults; job-level permissions for write paths preserved (Docker push, tag/release, model-sync PR, SARIF upload). Closes 5 Scorecard alerts. CI green.
…794) 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 Co-authored-by: Anand Ray <anand.ray@rocketride.ai>
Summary
Adds
permissions: contents: read(least-privilege default) to the top of five workflow files that had no top-level permissions declaration. Closes 5 ScorecardTokenPermissionsIDalerts.Files changed
.github/workflows/_build.yamlpackages: write).github/workflows/_docker.yaml.github/workflows/_init.yaml.github/workflows/_release.yamlcontents: write,packages: write).github/workflows/sync-models.ymlsyncjob retainscontents: write,pull-requests: write)Why this is safe
uses: ./.github/workflows/_*.yamlfrom caller workflows, exceptsync-models.ymlwhich runs on schedulepermissions:acts as a default ceiling, not a hard cap — individual jobs raise to write where they need itpermissions:blocks are unchangedcontents: readmatches the pattern insecret-scan.ymlandci.ymlType
chore (security hardening)
Linked Issue
Fixes #789
Out of scope (follow-up PRs)
nightly.yaml+storage-cleanup.yml(3 alerts)SOC2 Notes
CC7.1 vulnerability management — mechanical batch resolution of 5 critical/high TokenPermissionsID findings within the SLA window. SECURITY.md disposition: Fixed.
Summary by CodeRabbit