1 Secrets Committed to Git History
When API keys, passwords, or tokens are committed to a git repository — even briefly and then deleted — they remain accessible in git history permanently. Automated scanners monitor public repositories in real time.
Common secret types found in repos:
- Cloud provider keys (AWS Access Key ID, GCP service account JSON)
- Payment API keys (Stripe, PayPal, Square)
- Database connection strings with passwords
- SSH private keys, TLS certificates
- Internal API tokens and bearer tokens
- OAuth client secrets
Why deletion does not help:
# Secret committed in commit abc123
git add config.js # File contains AWS_SECRET_KEY = "AKIA..."
git commit -m "Add config"
# Secret "deleted" in next commit
git add config.js
git commit -m "Remove API key from source"
# Key is STILL accessible:
git show abc123:config.js # Shows the original file with the key
git log --all -p | grep "AKIA" # Finds it in historyWithin minutes of pushing to GitHub, automated tools like GitGuardian and truffleHog find and catalog the exposed secret.