Why .gitignore is not enough
Most developers know not to commit .env files. The problem is that secrets do not only live in .env files. They appear in configuration YAML, in test fixtures, in docker-compose files, in CI/CD pipeline definitions, and most often in git history. A developer commits a hardcoded API key, realises the mistake, removes it in the next commit, and pushes both. The key is gone from the working tree and still present in the history.
The three places secrets hide
1. Source code. Hardcoded API keys, database connection strings, JWT signing secrets and private keys embedded in constants. Pattern-based detection catches known formats such as AWS access key IDs, Stripe live keys and GitHub personal access tokens. Entropy analysis catches random-looking strings that match no known pattern.
2. Configuration files. .env files, YAML and JSON settings, TOML, docker-compose.yml and Terraform .tfvars. These often hold database credentials and cloud provider access keys.
3. Git history. Every commit that ever contained a secret keeps it unless the history is rewritten, for example with git filter-repo or BFG Repo-Cleaner. A scanner that only reads the current branch misses everything that was committed and later removed.
Detection and rotation
Rewriting history does not undo a leak. Once a secret has been pushed, assume it has been copied. The fix is always the same: revoke the credential at the service that issued it, issue a new one, and deliver the new one through a secret store or environment configuration instead of the repository. Cleaning the history comes after that, and is optional.
Spoorder's Hunt (Secrets) scanner, available from the Builder plan, scans a connected repository or pasted code using provider-specific patterns and entropy checks. Findings include rotation guidance for the type of credential found.
Ready to scan your application?
Free health check: HTTPS, TLS and security headers for one URL, in about a minute. Free account, no credit card.
Scan your app free →