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
docs(stage7): AWS recipe — pre-check stale OIDC provider, verify after register
Two additions to the AWS federation recipe:
1. Strengthen the issuer prereq check to compare byte-for-byte (catches
the scheme-less / trailing-slash bugs operators have hit), with the
exact systemd-unit fix inline.
2. New "0. Check for stale provider state" subsection: list providers
first, identify the three states (empty / matching / stale), and
delete-and-recreate flow for the stale-URL case.
3. Step 1 now ends with `aws iam get-open-id-connect-provider` so
operators can confirm AWS actually fetched the JWKS, plus a note on
the LE intermediate-CA thumbprint persistence.
- Verify the discovery doc's `iss` claim matches **byte-for-byte** (must be `https://…`, no trailing slash, no scheme-less hostname). AWS rejects the `AssumeRoleWithWebIdentity` call later if these disagree:
If this prints `false`, fix the broker's `BROKER_OIDC_ISSUER` env var on the host before continuing — see [Operator runbook §"Fix scheme-less issuer URL"](./operator-runbook.md) or sed the systemd unit:
Before registering, confirm there isn't a previous registration with a wrong URL still on the account (a common artifact of fixing the issuer mid-bring-up):
602
+
603
+
```bash
604
+
aws iam list-open-id-connect-providers
605
+
```
606
+
607
+
- Empty list (`"OpenIDConnectProviderList": []`) → fresh slate, proceed to step 1.
608
+
- A provider whose ARN ends in your current `OIDC_ISSUER` host → already registered, skip step 1, proceed to step 2 (verify with `aws iam get-open-id-connect-provider --open-id-connect-provider-arn <arn>` that the URL matches).
609
+
- A provider whose ARN ends in a **different** host (or a stale variant of yours) → delete it before registering the correct one:
The IAM user running this needs `iam:CreateOpenIDConnectProvider` and `iam:GetOpenIDConnectProvider` (the standard `agentkeys-admin` IAM-admin scope covers both). AWS auto-derives the cert thumbprint from the Let's Encrypt chain at registration time — if certbot rotates the cert later, the thumbprint stays valid because LE uses the same intermediate CA.
631
+
598
632
#### 2. Replace the role's trust policy with the federated variant
599
633
600
634
Replaces [`stage6-aws-setup.md` §3b](./stage6-aws-setup.md) (static IAM user). Principal becomes the OIDC provider; the `sts:TagSession` + `aws:RequestTag/agentkeys_user_wallet` condition is what wires cloud-enforced per-user isolation in §3 below.
0 commit comments