Skip to content
RED SAGSkills
hardCybersecurity Analyst interview question

A developer accidentally pushed AWS access keys to a public GitHub repository two hours ago. How do you respond?

What the interviewer wants to hear

  • Assume the keys are already used; bots scan GitHub within minutes
  • Deactivate and rotate the keys immediately
  • Investigate CloudTrail for activity by that key across all regions
  • Look for persistence such as new IAM users, keys, roles or Lambda functions
  • Clean up the repo history and prevent repeats with secret scanning and short-lived credentials

Model answer

I would assume the keys are already compromised, because automated bots scan public repos within minutes. First, deactivate the access key in IAM and create a new one only if it is still needed, updating the application. If AWS attached a quarantine policy, I keep it until the review is done. Then I investigate CloudTrail for every API call made with that access key ID, across all regions, since attackers often launch crypto-mining instances in unused regions. I look for persistence: new IAM users, access keys, roles, trust policy changes, Lambda functions, or changes to logging. I also check data access in S3 and review GuardDuty findings and billing spikes. Anything the attacker created is removed. Deleting the commit is not enough, so the history must be rewritten and treated as public forever. To prevent repeats: enable GitHub push protection and secret scanning, use pre-commit hooks, and move to short-lived credentials through IAM roles, SSO or OIDC for CI pipelines.

Can you answer it under time pressure?

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

Start mock interview

More hard Cybersecurity Analyst questions