
How I built EnvGuard: a CLI tool to stop leaking .env secrets to git
It happened on a Tuesday morning. I pushed a commit, went to get coffee, came back to find an AWS bill alert for $847. A crypto miner had been running on my dime for six hours ‚Äî because my .env file with real AWS keys had just been committed to a public GitHub repo. I rotated the keys, cleaned up the history with git filter-branch , filed a support ticket with AWS (they were actually great about it), and spent the rest of the day feeling sick. That was the day I decided to build EnvGuard . What EnvGuard does EnvGuard is a CLI tool that audits your .env files and catches dangerous secrets before they make it into git. npm install -g envguard envguard audit It detects: üî¥ AWS Access Key IDs and Secret Keys üî¥ Stripe live/test secret keys üî¥ GitHub tokens (ghp_, ghs_, ghx_, etc.) üî¥ Slack tokens and webhook URLs üî¥ Database URLs with embedded credentials (postgres://user:pass@host) üî¥ PEM private keys üü† JWT tokens üü° Generic API keys ‚ö†Ô∏è Weak placeholder values (chan
Continue reading on Dev.to JavaScript
Opens in a new tab



