Local stdlib Python script scans for leaked secrets before git push
A developer built a Python script that detects leaked credentials in code without requiring installs, accounts, or network access. The tool, packaged as a skill for Hermes Agent, scans a folder or only staged files, flags real .env files while ignoring .env.example, and matches common token formats such as private keys, AWS and GitHub credentials, and JWTs. It skips obvious placeholder values and masks any findings so reports can be shared safely. The script exits with code 1 when secrets are found, allowing it to be used in a pre-commit hook. The author notes it is only a pattern matcher that cannot read git history or verify whether a key is still active, so exposed secrets should be rotated.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in