Interview Prep/DevSecOps/Vulnerability Management and Incident Response

An AWS access key is leaked. What is the response?

IntermediateConceptVulnerability Management and Incident Response
Answer
  1. Deactivate the key immediately: aws iam update-access-key --access-key-id AKIA... --status Inactive --user-name ci-bot.
  2. Revoke active sessions it may have created (attach a deny policy with aws:TokenIssueTime condition, or "Revoke active sessions" for roles).
  3. Search CloudTrail for every call made with that key ID since the leak: new users, keys, roles, EC2 instances in unusual regions, S3 reads.
  4. Remove any persistence the attacker created and check billing for crypto-mining.
  5. Delete the key, fix the root cause, and move that workload to role-based temporary credentials.

AWS may also open a support case and attach AWSCompromisedKeyQuarantineV3 to the user automatically when it finds a key in a public repo.

All DevSecOps questions Roadmap: Security in the pipeline

More on Vulnerability Management and Incident Response