You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
separate plan and apply cloud identities, with the OIDC trade done before head code runs #4296
terragucci maps root globs to separate plan and apply identities and trades the OIDC token before the head is checked out (roles.ts, oidc-trade.ts; groups.ts runs one apply job per identity). The trade uses terragucci's own S3 and GCS clients (oidc-trade.ts:30-31). The env vars it sets (AWS_ROLE_ARN, the GCP external_account file, ARM_CLIENT_ID) are cloud SDK conventions, not Terraform ones.
chant today: the PR plan and apply jobs have no id-token, and share env and beforeScript (github generate-pipeline.ts:270-297). Plan and apply differ only in git write scope.
Design: an identity.cloud block mapping environment or member globs to {plan, apply} per cloud. The forge generators emit id-token and a trade step that runs before head checkout, and split apply jobs by identity.
Risk: leaking a token to head code. Should land before anything applies unattended (the policy and pre-merge apply issues).
terragucci then deletes roles.ts, oidc-trade.ts and groups.ts, and keeps Terragrunt's credentials as an input.
terragucci paths are under packages/terragucci/src at INTENTIUS/terragucci e6cb431. chant paths are at origin/main.
ci.identity.cloud gives each cloud (aws, gcp, azure) a plan and an apply identity per environment and member globs. The plan job trades the job's OIDC token for the plan identity in a step before the checkout, run with node -e from /. Every later plan step drops the token request variables, so head code never sees a way to get the apply identity. Apply jobs take the apply identity. A rule that plans as an identity some rule applies as is refused (packages/core/src/workspace/declaration.ts:1237).
Emulator proof tests for GitHub, GitLab and Forgejo run the generated plan job step by step and check that each step after the trade gets only plan credentials (lexicons/github/src/components/generate-pr-pipeline.identity.test.ts, and the gitlab and forgejo files of the same name).
Docs: guide/security-cloud-identities.mdx and the Cloud identities section of reference/workspace-declaration.mdx.
Deferred:
The plan job still holds CHANT_RUNNER_KEY.
chant ci run and chant ci serve do no OIDC trade.
A GitHub fork pull request gets no OIDC token, so its plan fails at the trade.
The Forgejo trade assumes the ACTIONS_ID_TOKEN_REQUEST_* variables. No real Forgejo runner has checked this yet.
Activity
feat(ci): separate plan and apply cloud identities, traded from the j…
docs: the cloud identities reference cites the line after the rebase (#…
feat(ci): separate plan and apply cloud identities, traded from the j…
docs: the cloud identities reference cites the line after the rebase (#…
docs: the cloud identities refusal cite points at its line after #4294 (
feat(ci): separate plan and apply cloud identities, traded from the j…
lex00 commentedon Oct 22, 2026
Merged in #4316 (01e5f7c).
ci.identity.cloudgives each cloud (aws, gcp, azure) a plan and an apply identity per environment and member globs. The plan job trades the job's OIDC token for the plan identity in a step before the checkout, run withnode -efrom/. Every later plan step drops the token request variables, so head code never sees a way to get the apply identity. Apply jobs take the apply identity. A rule that plans as an identity some rule applies as is refused (packages/core/src/workspace/declaration.ts:1237).Emulator proof tests for GitHub, GitLab and Forgejo run the generated plan job step by step and check that each step after the trade gets only plan credentials (
lexicons/github/src/components/generate-pr-pipeline.identity.test.ts, and the gitlab and forgejo files of the same name).Docs: guide/security-cloud-identities.mdx and the Cloud identities section of reference/workspace-declaration.mdx.
Deferred:
CHANT_RUNNER_KEY.chant ci runandchant ci servedo no OIDC trade.ACTIONS_ID_TOKEN_REQUEST_*variables. No real Forgejo runner has checked this yet.