r/madeinpython • • 1d ago

leakscan: scan code, git history, notebooks, Docker images and packages for leaked API keys

leakscan finds leaked API keys and credentials. pipx install leakscan, then leakscan scan . and it works, no config needed.

Besides normal folders and git history (including secrets someone committed and later deleted), it can scan Jupyter notebooks and tell you which cell and whether the key was in the code or the output. It can also scan Docker images layer by layer, and published packages before you install them, e.g. leakscan scan pypi:requests==2.32.3.

Every finding says what the key could be used for and where to rotate it. There's a --verify flag that checks whether a key is still live, but it's opt-in and asks for --yes on anything that isn't yours. No telemetry.

It also has a Python API, a GitHub Action, and a pre-commit hook.

Target Audience

People who want secret scanning in CI or pre-commit without a Go binary, and people who work in notebooks or want to look inside a package before installing it. It's young, so I wouldn't call it battle-tested yet.

Comparison

gitleaks and trufflehog are the established tools and they're good. gitleaks is faster (about 4.4x on the full history of the requests repo in my own benchmark, details in the repo), and trufflehog covers far more detectors and sources. Where leakscan is different is the Python install and API, notebook support, and the package scanning. If you need raw speed or the widest verification coverage, use those instead.

Repo: https://github.com/Vasishta03/leakscan

I'd really like to hear about false positives, and about any providers you want rules for.

0 Upvotes

0 comments sorted by