Interview Prep/AWS/IAM, Organizations and Multi-Account

An access key for an IAM user was committed to a public GitHub repo 20 minutes ago. Walk through your response.

IntermediateScenarioIAM, Organizations and Multi-Account
Answer

Situation read → Assume it is already scraped; speed matters more than forensics at first, but preserve evidence.

What I'd do →

  1. Deactivate the key immediately: aws iam update-access-key --user-name ci-bot --access-key-id AKIA... --status Inactive
  2. Attach an explicit deny-all policy or use the AWSCompromisedKeyQuarantine policy AWS may have applied
  3. Query CloudTrail for the key id over the exposure window for unusual calls like RunInstances in odd regions
  4. Terminate rogue resources, check for new IAM users, roles and access keys
  5. Create a replacement via a role or OIDC, then delete the old key and purge it from git history

Why → Deactivate before delete so you can still audit the key and roll back if a legitimate system breaks.

Interview tip → Mention enabling secret scanning push protection to prevent a repeat.

aws All AWS questions Roadmap: AWS core services

More on IAM, Organizations and Multi-Account