Interview Prep/Git & GitHub/Secrets, Signing and Security

A developer pushed an AWS access key to a public repo 10 minutes ago. What is your first move?

BeginnerScenarioSecrets, Signing and Security
Answer

Situation read → Bots scan public pushes within seconds. Assume the key is already compromised.

What I'd do →

  1. Revoke or deactivate the key in IAM immediately; create a replacement and deploy it.
  2. Review CloudTrail for use of the key since the push; check for new users, instances and unusual regions.
  3. Only then clean the repo (remove from history, see the next question).
  4. Write up the incident and add push protection and a pre-commit scanner.

Why → Deleting the commit does not undo exposure. Rotation does.

Interview tip → "Rotate first, clean second" is the sentence interviewers listen for.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security