ci: add least-privilege permissions to workflows (closes 3 CodeQL alerts) - #11
Open
hlsitechio wants to merge 1 commit into
Open
ci: add least-privilege permissions to workflows (closes 3 CodeQL alerts)#11hlsitechio wants to merge 1 commit into
hlsitechio wants to merge 1 commit into
Conversation
Adds a top-level `permissions: contents: read` block to ci.yml and deploy-web.yml. Without an explicit block, GITHUB_TOKEN is granted the repository's broad default permissions in every job. Closes 3 CodeQL "actions/missing-workflow-permissions" medium alerts (ci.yml jobs + deploy-web.yml). No job in these workflows writes to the repo — CI only builds/tests, and the Cloudflare deploy authenticates with its own API-token secret — so read-only access is sufficient and does not change behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe CI and web deployment workflows now set workflow-level ChangesWorkflow Token Permissions
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a top-level
permissions: contents: readblock toci.ymlanddeploy-web.yml.Why
CodeQL flags 3 medium
actions/missing-workflow-permissionsalerts:ci.yml:19(validate job)ci.yml:76(smoke job)deploy-web.yml:10(deploy job)Without an explicit block,
GITHUB_TOKENinherits the repository's broad default permissions in every job — unnecessary blast radius if any step or dependency is compromised.Safety
No job in these workflows writes to the repo:
CLOUDFLARE_API_TOKENsecret, notGITHUB_TOKEN, so read-only access does not affect it.contents: readis therefore sufficient and behaviour-preserving.Note
The
validatebuild job is currently red onmainfor pre-existing reasons (repo is in maintenance mode). That failure is unrelated to this change — verify via theAnalyze (actions)CodeQL job, which is what evaluates these three alerts.🤖 Generated by the unattended daily portfolio review (Fizz, 2026-08-02).
Summary by CodeRabbit