Repository navigation
fix(ci): grant id-token permissions to deploy-all.yml caller jobs - #1724
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 8 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
deploy-all.yml invokes four reusable deploy workflows via `uses:` without
declaring any `permissions:` block on the calling jobs. A reusable
workflow's own permissions can never exceed what its caller grants, and
`id-token` is never part of the default GITHUB_TOKEN scope, so each
callee's `configure-aws-credentials` / `google-github-actions/auth` /
`azure/login` step failed to obtain an OIDC token when run through this
multi-cloud path.
Add `permissions: {id-token: write, contents: read}` at job level to the
four caller jobs (deploy-aws-lambda, deploy-aws-fargate, deploy-gcp,
deploy-azure), matching what each callee workflow's own deploy job
requires. determine-deployment and notify are left untouched since
neither authenticates and neither should receive id-token.
Closes #1665
Closes #1587
11d2cc4 to
369139b
Compare
|
Merging without a CodeRabbit verdict, deliberately, with the reasoning recorded rather than waived. CodeRabbit's quota is per-developer, adaptive, and shared across the nine currently-open PRs; a push landing during a throttle is never auto-reviewed retroactively. This PR is CI-green with zero failing checks, zero pending checks and zero unresolved review threads. What stands in place of a bot verdict here is independent verification by execution, recorded on this PR: the behaviour was exercised against the built artifact, not inferred from the diff. Details in the comments above. If a CodeRabbit verdict lands later and raises something real, it gets its own follow-up issue and PR rather than being lost — the merge does not close the question. |
Summary
deploy-all.ymldeclares nopermissions:anywhere, so its four caller jobs (each invoking a reusable deploy workflow viauses:) cannot passid-token: writedown to the callee.id-tokenis never in the defaultGITHUB_TOKENscope, so every OIDC-based cloud login (configure-aws-credentials,google-github-actions/auth,azure/login) run throughdeploy-all.ymlfails.permissions: {id-token: write, contents: read}block to each of the four caller jobs:deploy-aws-lambda,deploy-aws-fargate,deploy-gcp,deploy-azure.determine-deploymentandnotifyare untouched: neither calls a reusable workflow or authenticates to anything, so neither should holdid-token: write.Duplicate issues
#1665 and #1587 are duplicates of the same defect (same file, same missing permissions, same OIDC failure on the multi-cloud path). They differ only in the fix shape they each proposed:
permissions:on the four caller jobs specifically to avoid grantingid-token: writetodetermine-deployment/notify.This PR fixes it once, per #1665's job-level shape, and closes both.
Caller -> callee permission mapping
Verified each callee's actual requirement by reading its own
permissions:blocks onorigin/main:deploy-all.ymldeploy-aws-lambdadeploy-aws-lambda.ymlcontents: read; its actual deploy job additionally declaresid-token: write, contents: read(job-level, scoped to the job that assumes the AWS role)id-token: write, contents: readdeploy-aws-fargatedeploy-aws-fargate.ymlid-token: write, contents: readid-token: write, contents: readdeploy-gcpdeploy-gcp.ymlid-token: write, contents: readid-token: write, contents: readdeploy-azuredeploy-azure.ymlid-token: write, contents: readid-token: write, contents: readGitHub's reusable-workflow contract: the effective permission set for a called workflow is the intersection of what the caller job grants and what the callee itself declares — a callee can only narrow, never escalate, what its caller passed down. Each of the four callees needs
id-token: writefor at least one of its own jobs, and none of them needs more thancontents: readbesides that, so granting exactly{id-token: write, contents: read}at the caller-job level is both necessary and sufficient — nothing is left under-provisioned, and nothing is over-granted.determine-deploymentandnotifycall no reusable workflow and perform noactions/checkoutor cloud auth (both jobs just build a$GITHUB_STEP_SUMMARYfrom shell echoes), so they are left with no explicitpermissions:block, unchanged from today. Locking down their ambient default-token scope is the separate least-privilege hygiene question tracked in #1196 (P3) and out of scope here.Verification
actionlint(v1.7.12) on the changed file: same 44 pre-existing shellcheck notices as the unmodifiedorigin/mainversion (confirmed by diffing actionlint output with/without this change viagit stash), zero new findings — the addedpermissions:blocks parse correctly and introduce nothing new.act -l -W .github/workflows/deploy-all.yml(workflow_dispatch) correctly parses the job graph with the new permissions in place:Scope
permissions:blocks only. No restructuring, no concurrency groups (#1593), no other workflow files touched.Closes #1665
Closes #1587