Skip to content

Tutorials

Build Your Own Secret-Scanning Bot in Node.js — Git History Included

Delete a token from config.env and a scan of the working tree comes back clean. The token is still in Git history, one git log -p away from anyone who clones the repo. Off-the-shelf scanners usually make you pick a workflow, an output format, and a place for the results to go. When you embed the scanner, you make those choices.

The kingfisher-secret-scanner npm package runs the Kingfisher Rust engine in-process through Node-API. It reads Git objects directly, with no git binary required. It streams typed findings as each file finishes. It can ask providers whether a leaked key still works. Native work runs off the event loop, so a bot or web service keeps handling requests while it scans. It supports ESM and CommonJS and ships TypeScript declarations. Get it on npm.

Find Leaked Keys and Prove They Still Work — From Any Python Service

Most secret scanners can tell you a string looks like an AWS key. That still leaves the question your on-call engineer actually cares about: does it work? A dead test token and a live production key look the same to a regex. Only one of them justifies paging someone.

The kingfisher-secret-scanner package gives any Python service both answers. It finds credentials in files, byte buffers, or Git history using the same Rust engine as the Kingfisher CLI. Then it asks each credential's provider whether the key still authenticates. You can run it in a Celery task, a FastAPI upload handler, a Lambda that watches a bucket, or a script on your laptop. It runs in-process with no CLI to shell out to. Get it on PyPI.

Embed a SIMD Secret Scanner in Your Rust Build — and Stop Leaks Before They Ship

Secrets don't only leak from source files. They show up in the things a build produces: a config rendered from a template, a .env copied into a container layer, a test fixture bundled into a release tarball. A pre-commit hook never sees those files. Your build does, because it just made them.

kingfisher-scanner puts the Kingfisher detection engine, with hundreds of built-in rules, inside your Rust program as a library. There's no subprocess to spawn and no CLI output to parse. You hand it paths or bytes and get typed Finding values back. So the code that assembles your artifact can also refuse to ship it. Get the crate on crates.io.

Scanning an Entire GitHub Organization for Leaked Secrets

Most organizations have more GitHub surface area than they think: active services, abandoned repositories, internal tooling, forks, experiments, and projects inherited through acquisitions. A credential leaked in a five-year-old archived repo can still be live today.

Kingfisher can enumerate every repository in a GitHub organization, scan the full git history, and then validate which credentials are still live so you can focus on what needs rotation first.