Skip to content
RED SAGSkills
hardCloud Engineer interview question

You find out that long-lived AWS access keys were pushed to a public GitHub repository an hour ago. How do you respond?

What the interviewer wants to hear

  • Immediately deactivate the key and revoke any active sessions
  • Investigate CloudTrail for actions taken with that key across all regions
  • Look for persistence: new users, keys, roles, Lambda functions, instances
  • Contain and clean up, check billing for crypto mining
  • Remove from history but treat as compromised regardless
  • Root cause and prevention: OIDC, no long-lived keys, secret scanning

Model answer

I treat it as an active incident, because bots scan GitHub for keys within minutes. First I deactivate the access key, and if it belonged to a user with assumed role sessions I revoke those sessions with a deny policy on tokens issued before now. Then I investigate CloudTrail for every API call made with that key ID in all regions, and check GuardDuty findings. I look for persistence such as new IAM users, access keys, roles with odd trust policies, Lambda functions, EC2 instances in unused regions and changes to logging, plus a billing spike from crypto mining. I remove anything the attacker created and rotate any secrets they could have read. Rewriting Git history is worth doing, but the key stays compromised either way. Afterwards I run a postmortem and remove long-lived keys entirely in favor of OIDC and roles, with secret scanning and push protection enabled.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Cloud Engineer questions