Skip to main content

Zero-dependency C++17 secret scanner - AWS/GitHub/Slack/Stripe keys, PEM, JWTs, entropy heuristics. Single binary, CI-friendly exit codes.

Project description

leakhound

leakhound is a fast local credential and secret scanner. It is a single C++17 binary with no external dependencies.

Build

With CMake:

cmake -S . -B build
cmake --build build --config Release

On Windows with the MSVC command prompt:

build.bat

The batch file runs:

cl /std:c++17 /O2 /W4 /EHsc src\leakhound.cpp /Fe:leakhound.exe

Usage

leakhound [options] <path>...
  --json           machine-readable output (one JSON object, findings array)
  --no-entropy     disable entropy heuristics (pattern rules only)
  --max-size N     skip files larger than N bytes (default 2 MiB)
  --quiet          suppress per-finding lines, print summary only
  -h, --help       usage

Paths may be files or directories. Directories are scanned recursively, while common generated or dependency directories such as .git, node_modules, vendor, dist, build, target, __pycache__, .venv, and venv are skipped.

Default output:

HIGH aws-access-key path/to/file.txt:12  AKIA12...CDEF
Summary: files scanned=4, files skipped=1, HIGH=1, MEDIUM=0, LOW=0, wall time=3ms

JSON output:

leakhound --json .

Rules

Rule ID Severity Pattern
aws-access-key HIGH AKIA[0-9A-Z]{16}
github-token HIGH gh[pousr]_[A-Za-z0-9]{36,}
slack-token HIGH xox[baprs]-[A-Za-z0-9-]{10,}
stripe-live-key HIGH sk_live_[A-Za-z0-9]{16,}
private-key-pem HIGH PEM private key header lines
google-api-key HIGH AIza[0-9A-Za-z_-]{35}
npm-token HIGH npm_[A-Za-z0-9]{36}
jwt MEDIUM JWT-shaped three-part token
generic-assignment MEDIUM Secret-like key assigned to a quoted non-placeholder value
high-entropy-token LOW High-entropy mixed-case token heuristic

The entropy heuristic tokenizes each line into runs of [A-Za-z0-9+/=_-] from 24 to 128 characters, then flags tokens with Shannon entropy greater than 4.5 bits per character that contain at least one digit and mixed case. Use --no-entropy to disable this tier.

Exit Codes

Code Meaning
0 Scan completed with no findings
1 Scan completed with findings
2 Usage or IO error

Tests

python tests/run_tests.py

The test runner builds temporary fixtures, runs the scanner, checks exit codes, validates JSON output, verifies redaction and placeholder rejection, and checks binary, directory, and max-size skipping. If no compiler is available, set LEAKHOUND_BIN to an existing scanner binary.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leakhound-0.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

leakhound-0.1.0-py3-none-win_amd64.whl (67.7 kB view details)

Uploaded Python 3Windows x86-64

leakhound-0.1.0-py3-none-manylinux_2_28_x86_64.whl (140.2 kB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

leakhound-0.1.0-py3-none-macosx_14_0_arm64.whl (48.7 kB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file leakhound-0.1.0.tar.gz.

File metadata

  • Download URL: leakhound-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for leakhound-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6ad4c88d564c978ef9f605c8e970bf1dd9ab83622e24d4b8db42a007ff39d35d
MD5 623fadfda37e5e540b016afc6f2988ac
BLAKE2b-256 a825a2407bc8585347dc608c53f723a2166a6f6d6e30f59801c82d6dd64b469b

See more details on using hashes here.

Provenance

The following attestation bundles were made for leakhound-0.1.0.tar.gz:

Publisher: pypi.yml on Makeph/leakhound

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leakhound-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: leakhound-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 67.7 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for leakhound-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2e8906a16b8093f77a72e045b80d3a03e71004e8368799325b93ac7da40cb3db
MD5 2d8a0edd3240cc78289c4ce98ae494b6
BLAKE2b-256 9444276ff0cf6097e7cf063a98863f3cc3f4aba16e78be793a3438b8702b132a

See more details on using hashes here.

Provenance

The following attestation bundles were made for leakhound-0.1.0-py3-none-win_amd64.whl:

Publisher: pypi.yml on Makeph/leakhound

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leakhound-0.1.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for leakhound-0.1.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f468507e4372cbf3fedb7962c814aab763d6e81ab00389d92664cb00426ec217
MD5 e9be63585a64e52622d5585fcc291d22
BLAKE2b-256 7c4c1d184d5c6f0c5b9605329b2c97050f94e7b96f2d4c5ae2a357bd2c7cf47b

See more details on using hashes here.

Provenance

The following attestation bundles were made for leakhound-0.1.0-py3-none-manylinux_2_28_x86_64.whl:

Publisher: pypi.yml on Makeph/leakhound

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file leakhound-0.1.0-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for leakhound-0.1.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ac562e9402667685debca63f998c3543d570446b4860b7299714b83cde27f569
MD5 9e1cbb077d54c223c32824c393bd3430
BLAKE2b-256 8057470a014885540f2b481d94258899cc703716255e0ec824c0e2e0fd14d0a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for leakhound-0.1.0-py3-none-macosx_14_0_arm64.whl:

Publisher: pypi.yml on Makeph/leakhound

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page