ci: declare workflow-level contents: read on 2 workflows#790
Conversation
|
📝 WalkthroughWalkthroughThe PR adds workflow-level permission restrictions to two GitHub Actions workflows ( ChangesWorkflow Permission Restrictions
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
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 |
af5b405 to
654a144
Compare
|
Good catch @JounQin, you're right. Dropped the |
commit: |
|
@JounQin gentle ping - I dropped the |
Pins the default GITHUB_TOKEN to contents: read on workflows that don't call a GitHub API beyond the initial checkout. Drops the autofix.yml change from the earlier revision because that workflow uses autofix-ci to push fixes back to the PR head, which needs write scope (per @JounQin review feedback). Other workflows that need write scopes are left implicit for a maintainer to declare. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
654a144 to
d51eca3
Compare
|
Actionable comments posted: 0 |
contents: read on 3 workflowscontents: read on 2 workflows
Pins the default
GITHUB_TOKENtocontents: readon 3 workflows in.github/workflows/that don't call a GitHub API beyond the initial checkout.Why
CVE-2025-30066 (March 2025
tj-actions/changed-filessupply-chain compromise) exfiltratedGITHUB_TOKENfrom workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF ScorecardToken-Permissionscheck.YAML validated locally with
yaml.safe_loadon each touched file.Summary by CodeRabbit