AWS Credentials Committed to a Public GitHub Repository
An access key ID and secret committed in a config file were found by an automated scanner within 4 minutes, leading to $34,000 in EC2 charges overnight.
Overview
An AWS key pushed to a public GitHub repository was found by scanners in 4 minutes and ran up $34,200 of GPU mining before it was revoked.
What happened
A developer writing a tutorial blog post committed a sample config file to a public repository. It held a real AWS access key left over from local testing. The plan was to remove it before publishing, but the push to the public branch came first.
From the push, events moved fast.
- The developer pushed the config file to the public branch.
- Four minutes later, automated scanners found the key.
- Three hours later, the developer noticed and revoked the key.
- The attacker's instances ran up 14 hours of EC2 charges, $34,200 in all.
- Cleaning up and recovering took 3 days.
Key concepts
- Credential scanning
- IAM least privilege
- Secret rotation
- AWS Secrets Manager
Interview questions
- You discover an AWS access key has been committed to a public GitHub repository. Walk me through your incident response.
Sign up free to read the full topic
More War Stories topics
- A Deployment That Could Not Be Rolled Back
- A Failed Migration That Left the Database in a Partial State
- A Feature Flag Change That Triggered a Production Outage
- Accidental DELETE Without a WHERE Clause in Production
- An IAM Misconfiguration That Let a Developer Become Admin
- Backups That Were Never Actually Completing
- BGP Route Leak That Rerouted Traffic Through an Unexpected AS
- Blue-Green Deployment That Resulted in Split-Brain Sessions
- Cache Stampede on a Flash-Sale Product Page
- Connection Pool Exhaustion That Brought Down 12 Microservices
- DynamoDB Hot Partition That Throttled a Flash Sale
- Failover to a Lagging Replica Lost 4 Minutes of Orders
Start free on Cariara · Coding problems · System design studio