Dmytro Galko · open-source tools

repo-secret-scanner

Catch the key before the push, in one file

A key in a commit is public the moment it is pushed and stays in the history after it is deleted, so the only cheap moment to catch it is before the push. The scanners that do this well want an install, a config file and a service account; this is one Python file with no dependencies that exits non-zero on a hit, which is all a pre-commit hook or a CI step needs.

What it does

How it is proved

One file, 167 lines, no dependencies; selftest passes on a planted secret. It is the gate I run over my own repositories before every push.

Pythonstandard library only9 rulesexit 1 for CI

People find this looking for

pre-commit secret scanner no dependencies, find api keys before commit, python leaked token scanner CI, aws key committed by accident, redacted secret report.

If that is your week and you would rather someone else did it, write to hello@dkautomation.dev or open an issue.