Lion Cipher Lab

Rotate AWS IAM access keys with zero downtime

Why it matters

Long-lived AWS IAM access keys are one of the most common cloud-credential risks in existence. An access key is a pair — an Access Key ID (like AKIA...) and a Secret Access Key — that lets code, scripts and third-party tools call AWS without a human at a keyboard. That convenience is exactly the danger: unlike a console password, an access key never expires on its own, so it sits in git history, CI logs, laptops, Docker images, wiki pages and Slack threads for years, and the day one of those places leaks, an attacker has a working credential with whatever permissions that user holds. The…

What you'll learn

Steps in this lab

  1. What an access key is, and why long-lived ones are the risk
  2. Stand up LocalStack and point the AWS CLI at it (offline, free)
  3. Create a test user and its first key — the credential you will rotate
  4. The detection half: enumerate keys and flag the stale and unused ones
  5. Rotate, step 1: create the SECOND key and deploy it (make-before-break)
  6. Rotate, step 2: set the OLD key Inactive, verify, then delete it
  7. Do it better — rotate the keys you must keep, eliminate the ones you can

Open the full interactive lab →