You Pushed AWS Keys to a Public Repo
Live cloud keys just landed in a public GitHub repo. A teammate says delete the file and force-push. Defend what you do first.
Answer key reviewed by Branko Petric
Your decision
You just pushed a commit to a public GitHub repo that contains your AWS access keys. You notice five minutes later. A teammate says just delete the file and force-push. What do you do first, and why?
The situation
You commit a quick fix and push to your team's public GitHub repo. Five minutes later you realize the commit includes a config file with a live AWS access key and secret.
Context
The key belongs to an account with permissions to your S3 buckets and some compute. The repo is public and has a few forks. A teammate says: just delete the file, force-push to rewrite the commit, and we are fine.
Related challenges
- History Is Messy, So Force-Push a Clean main?
A bad merge left main tangled with merge and revert commits. A teammate wants to rebase locally and force-push a clean history. Defend what you actually do.
- Deploys Are SSH + git pull at 5pm Friday. Why Change It?
The team ships by SSHing into prod and running git pull, often at 5pm Friday. A teammate says it has always worked. Defend what a real deploy needs without cargo-culting.
- Commit terraform.tfstate to the Repo So Everyone Shares It?
A teammate wants to commit terraform.tfstate to git so the whole team shares one state file. Defend the correct way to share Terraform state.
- A GitHub Action You Use Was Hijacked. Bump the Tag and Move On?
A third-party scanner action your repos pin by tag was hijacked for half a day. A teammate bumped the tag and wants to close the ticket. Defend what you do.