Repository navigation
fix(iam): accept GitHub immutable OIDC subjects in CI trust policies - #168
Merged
Merged
Conversation
Repos created after GitHub enabled immutable subjects get sub claims like repo:javaBin@95047/<repo>@<repo_id>:..., which repo:javaBin/*:* never matches, so AssumeRoleWithWebIdentity fails (seen on 2027.javazone.no). Allow the org-ID-pinned form on the app-broker, override-approver and apply-gate roles. The broker and apply-gate Lambdas check the `repository` claim, not `sub`, so they need no change. slack_alert parses `sub` for attribution and now strips the IDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 0 to add, 6 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟡 MEDIUM Plan updates 6 existing resources (0 add, 0 destroy): widens GitHub OIDC trust on three CI IAM roles to also accept repo:javaBin@95047/*, changes the Google identity provider authorize URL to restrict to the java.no domain, and redeploys two Lambda functions with new code.
|
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.
Problem
2027.javazone.no(team javazoneweb) fails tf-plan withNot authorized to perform sts:AssumeRoleWithWebIdentity. The repo was created 2026-10-26 and hasuse_immutable_subject: true, so its sub claim isrepo:javaBin@95047/2027.javazone.no@1433986972:.... The trust policies only allowrepo:javaBin/*:*. GitHub won't let the repo opt out.Change
ci_app_broker,ci_override_approverandci_apply_gatenow also acceptrepo:javaBin@95047/*:*, pinned to the org ID (newgithub_org_idvariable, default95047).slack_alertstrips the@<id>parts when it parsessubfor CI attribution, and a test covers it.repositoryclaim, notsub, so they need no change.Verification
python3 -m unittest discover -s terraform/lambda-src/tests: 159 passedterraform validatepasses. A local targeted plan updates the three roles in place. The local plan also showed javazoneweb destroys, but only because it had noregistered-teams.auto.tfvars, which CI syncs from the org.🤖 Generated with Claude Code