fix(security-scan): grant actions:read to codeql + zizmor jobs#20
Conversation
github/codeql-action's init/analyze and upload-sarif each call
`GET /repos/{owner}/{repo}/actions/runs/{run_id}` for telemetry. The
workflow-level `permissions:` block grants `contents: read`,
`security-events: write`, `pull-requests: read` — but not
`actions: read`. Result: every PR run on every org caller emits
##[error]Resource not accessible by integration
at the telemetry call and fails the step. Verified against
resq-software/research PR #8 across multiple consecutive runs.
Add `actions: read` at the job level for codeql and zizmor (the two
jobs that surface the issue). `actions: read` is read-only and
grants no write capability beyond the existing inherited scopes.
Other jobs in this workflow (gitleaks, osv-scanner, dependency-review,
actionlint, semgrep, snyk) don't make the telemetry call and don't
need the scope; leaving their permissions inherited.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds ChangesWorkflow Security Permissions
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary
Every org caller of
security-scan.ymlis currently failing thecodeql/*andzizmorjobs with:github/codeql-action'sinit/analyze/upload-sarifeach callGET /repos/{owner}/{repo}/actions/runs/{run_id}for telemetry. The workflow-levelpermissions:block grantscontents: read/security-events: write/pull-requests: read— but notactions: read. Result: every PR run fails the step.Fix
Add
actions: readat the job level for the two jobs that surface the issue (codeql + zizmor).actions: readis read-only and grants no write capability beyond the existing inherited scopes. Other jobs (gitleaks, osv-scanner, dependency-review, actionlint, semgrep, snyk) don't make the telemetry call.Repro
resq-software/research PR #8 — three consecutive CI runs (commits
847986c,2ddf8f9,bc97019) all show the same error on the same two job names. Other security scans in the same workflow (semgrep, dependency-review, actionlint, CodeQL (actions)) pass on every run.Test plan
security.ymlto point at the merged commitscan / CodeQL (javascript-typescript)andscan / zizmorgo green on the next PR runNotes
actions: readis the minimum scope; could be wider (e.g.actions: write) but read-only matches the principle of least privilege.requiredaggregators don't include thescan/*checks. PR fix(security): bump Go toolchain to stable #8 in research caught it because the user explicitly asked to verify failing CI.Summary by CodeRabbit