Lion Cipher Lab

Kill long-lived AWS keys in CI: federate GitHub Actions with OIDC

Why it matters

A stored AWS access key in GitHub Secrets is a long-lived credential: it works from anywhere, it never expires on its own, and if it leaks in a log, a fork, or a compromised dependency, an attacker has your account until a human notices and rotates it. OIDC federation deletes that secret entirely — GitHub mints a fresh, short-lived token per run and AWS trades it for temporary role credentials that expire in minutes. The same pattern federates any CI to any cloud (GCP Workload Identity Federation, Azure), so learning it once removes static cloud keys from your whole pipeline. But the trust…

What you'll learn

Steps in this lab

  1. The problem: a stored key is a standing invitation
  2. How OIDC federation replaces the key
  3. Register GitHub as an OIDC identity provider in IAM
  4. Create the role — and pin the subject correctly
  5. The workflow: request a token, assume the role, prove it
  6. Verify — then make the control fire
  7. When to federate, when it's overkill, and how to do it better

Open the full interactive lab →