fix(ci): add least-privilege permissions to the openapi workflow job#148
Conversation
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Gavel summary
Totals: 2284 passed · 0 failed · 65 skipped · 50.7s |
The `openapi` job in .github/workflows/gavel.yml had no `permissions` block and therefore inherited the broad default GITHUB_TOKEN scope. Add an explicit `permissions: contents: read` block, matching the pattern already used by the `test` and `lint` jobs. Resolves CodeQL code scanning alert #98 (Workflow does not contain permissions). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RiL4boF4wcNwKdvSRinVEf
544854a to
9ed6a7c
Compare
The v1.21.39 release pinned sub-modules to v1.21.39, but examples/enitity/go.mod was left requiring clicky v1.21.38. That stale pin left the module graph out of sync, so gavel's read-only test pre-build failed with "go: updates to go.mod needed; run go mod tidy", breaking CI on this PR. Run go mod tidy to align the pin with the rest of the release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RiL4boF4wcNwKdvSRinVEf
|
🎉 This PR is included in version 1.21.40 |
Description
Fixes CodeQL code scanning alert #98 (Medium) —
.github/workflows/gavel.yml:83, "Workflow does not contain permissions".The
openapijob had nopermissionsblock and therefore inherited the broad defaultGITHUB_TOKENscope. This adds an explicit least-privilege block:matching the pattern already used by the
testandlintjobs.Scope note — the two High crypto alerts are intentionally not changed here
Alerts #92 and #93 flag SHA1/MD5 hashing in
middleware/auth.go. That code exists to verify passwords against legacy htpasswd formats ({SHA},$apr1$/$1$), and genuinely "fixing" the CodeQL finding would require removing SHA1/MD5 support — a breaking change to themiddlewarepackage's advertised multi-hashhtpasswdsupport. We've decided to keep multi-hash support and instead dismiss #92/#93 in the Security tab as Won't fix (htpasswd compatibility). No changes toauth.goare included in this PR.Type of Change
Testing
test/lint/openapijobs run unchanged aside from the tightened token scope.Checklist
Breaking Changes
None. This PR only tightens the
GITHUB_TOKENpermissions on one CI job.Additional Notes
Alert details were supplied via a screenshot of the Security → Code scanning tab, since this session cannot reach GitHub's code-scanning API directly (the
flanksourceorg hasn't connected the Claude GitHub App, and the GitHub MCP toolset here exposes no code-scanning endpoints). For the same reason, #92/#93 need to be dismissed manually in the Security tab.🤖 Generated with Claude Code
https://claude.ai/code/session_01RiL4boF4wcNwKdvSRinVEf