A developer committed an AWS key to a public repo. Walk through your response.
BeginnerScenarioSecrets, Supply Chain and DORA
Answer
Situation read → Active compromise until proven otherwise.
What I'd do →
- Deactivate and rotate the key at once:
aws iam update-access-key --access-key-id AKIA... --status Inactive --user-name ci-user. - Review CloudTrail for use of that key and revoke sessions.
- Remove it from Git (
git filter-repo) after rotation, and enable push protection and gitleaks in CI. - Document and fix the root cause with OIDC or a vault.
Why → Bots scrape public commits within minutes.
Interview tip → Rotation comes first, cleanup second.
More on Secrets, Supply Chain and DORA
How do you stop secrets from being committed in the first place?IntermediateThe pipeline needs access to 15 different secrets across environments. How do you manage them?IntermediateExplain SLSA and how you would raise a pipeline's level.AdvancedHow do you verify only signed images run in Kubernetes?AdvancedA popular npm package your build uses is reported as compromised. What do you do?AdvancedDependency update PRs pile up. How do you keep dependencies fresh without chaos?Intermediate