Who may become this role?
CareFlow bound trust to the intended repository and branch through the verified subject claim, with the audience restricted for AWS STS.
CareFlow's first AWS pipeline used GitHub OIDC federation instead of a long-lived access key. Two failures made the final trust boundary easier—not harder—to explain.
The familiar setup was easy to picture: create an access key, paste it into repository secrets, and remember to rotate it forever. Instead, I used OpenID Connect so a particular workflow could present a signed identity to AWS and receive temporary credentials for one role.
No long-lived AWS access key lived in GitHub. That removed a valuable credential from the list of things that could be copied, forgotten, or leaked.
The trust policy checked who issued the token, its audience, and the subject identifying the repository and Git reference. If those claims matched, AWS Security Token Service allowed AssumeRoleWithWebIdentity. If they did not, the exchange stopped.
CareFlow bound trust to the intended repository and branch through the verified subject claim, with the audience restricted for AWS STS.
The role received only the AWS actions required by that pipeline stage—not general administrator access.
A narrow permissions policy does not rescue an overly broad trust policy. A narrow trust policy does not excuse broad AWS permissions. Both questions need independent answers.
terraform fmtThis was not an identity failure. The check found a real formatting issue, and I fixed the code instead of weakening the gate.
A pipeline is not valuable because every run is green. It is valuable because the same expectations run before a change moves forward.
The second failure reached AWS and returned Not authorized to perform sts:AssumeRoleWithWebIdentity. The repository and branch looked correct, but GitHub emitted the canonical lowercase organization name while the AWS exact-match condition used different casing.
repo:canonical-lowercase/name:ref:…repo:Different-Case/name:ref:…The safe fix was to inspect the actual subject and correct the exact condition—not introduce a wildcard until the error disappeared.
GitHub introduced immutable identifiers in the default OIDC subject for repositories created after July 15, 2026, and for repositories renamed or transferred after that date. Existing repositories retain the earlier format unless they opt in.
The newer default appends immutable owner and repository IDs to the familiar names. That makes recycled names less dangerous, but it also makes some older tutorials an unreliable source of a literal subject string.
| Decision | Why | Still required |
|---|---|---|
| OIDC federation | Avoid stored long-lived AWS keys | Token permission and exact trust |
| Repository + branch subject | Narrow which workflow identity is trusted | Verify the emitted claim format |
| Minimal role actions | Limit impact after assumption | Review as pipeline capability grows |
| Keep failing checks | Make controls enforce expectations | Fix the cause rather than the gate |
A machine identity is useful because its claims are exact, scoped, and testable.
Short-lived role sessions remove the lifecycle of a permanent deployment key.
A claim mismatch calls for evidence, not a more permissive wildcard.
The first formatting failure showed the pipeline was enforcing its contract.
This entry is educational, not security, compliance, or operational advice. It describes a dated CareFlow implementation; verify current claim formats and provider guidance.
A narrated explanation of GitHub-to-AWS federation, the two policy boundaries, and the debugging evidence behind CareFlow's first keyless pipeline.