Interview Prep/DevSecOps/Certificates, TLS and security incident response

AWS emails that an access key was found on public GitHub, and the IAM user now has an `AWSCompromisedKeyQuarantine` policy attached

AdvancedTroubleshootingCertificates, TLS and security incident response
Answer

Likely causes → A long-lived IAM user key was committed. Bots scrape GitHub within minutes, so assume it has been used. The quarantine policy denies some high-risk actions, but not everything.

Diagnose →

aws iam list-access-keys --user-name ci-legacy
aws cloudtrail lookup-events --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=AKIA... \
  --start-time 2026-11-01 --query 'Events[].[EventTime,EventName,EventSource]' --output table

Also check for new IAM users, keys, roles, EC2 instances in every region, and Lambda functions.

Fix → Deactivate and then delete the key. Remove any persistence the attacker created (users, keys, roles, trust policy edits), terminate rogue resources in all regions, and replace the key with a role (OIDC for CI). Open an AWS Support case for billing.

Prevent → No IAM user access keys for automation, secret scanning with push protection, an SCP blocking iam:CreateAccessKey outside break-glass, and budget alerts.

All DevSecOps questions

More on Certificates, TLS and security incident response