Lion Cipher Lab

Reimplement Azure Managed Identity Token Trust (Offline)

Why it matters

Azure Managed Identity is how the overwhelming majority of Azure workloads get credentials without a secret in code: a VM, App Service, or container asks the local Instance Metadata Service (IMDS) for a token scoped to a RESOURCE -- storage, Key Vault, a database -- and the Azure platform vouches for the identity, returning a short-lived Entra-signed JWT the resource validates. That design removes the OIDC-to-STS federation step AWS needs, but it moves the whole security question onto two claims: the AUDIENCE (which resource the token is for) and the appid/oid (which managed identity holds…

What you'll learn

Steps in this lab

  1. The question this engine answers: how does an Azure workload get a credential with no secret?
  2. Mint the Entra access token: a signed JWT + a JWKS
  3. Model the IMDS token endpoint -- and its Metadata:true anti-SSRF guard
  4. The resource-side checks, in the exact order they must run
  5. Build the primitive: verify an RS256 signature against the JWKS
  6. Build the core: validate_at_resource with a decision trace
  7. Run it: the SSRF probe, then six scenarios incl. the confused deputy
  8. The judgment: a signed token proves WHERE it came from, never WHO holds it
  9. Managed Identity vs AWS IRSA vs the shared-node IMDS anti-pattern -- and when NOT to hand-roll this

Open the full interactive lab →