| Crates.io | leaktor |
| lib.rs | leaktor |
| version | 0.1.1 |
| created_at | 2025-11-18 11:16:01.343709+00 |
| updated_at | 2025-11-18 11:38:16.124028+00 |
| description | A blazingly fast secrets scanner with validation capabilities |
| homepage | https://github.com/reschjonas/leaktor |
| repository | https://github.com/reschjonas/leaktor |
| max_upload_size | |
| id | 1938249 |
| size | 214,208 |
A blazingly fast secrets scanner with validation capabilities
Leaktor is a modern, high-performance secrets scanner designed for security professionals and developers. Built in Rust, it combines pattern matching, entropy analysis, and live secret validation to help you find and verify exposed credentials in your codebase and git history.
.leaktorignore file and inline // leaktor:ignore commentsUsing Cargo (All Platforms)
cargo install leaktor
# Install Rust from https://rustup.rs if not already installed
cargo install leaktor
scoop bucket add leaktor https://github.com/reschjonas/scoop-leaktor
scoop install leaktor
leaktor.exe to a directory in your PATH (e.g., C:\Program Files\leaktor\)# Requires Rust and Git
git clone https://github.com/reschjonas/leaktor
cd leaktor
cargo build --release
# Binary will be at .\target\release\leaktor.exe
# Move it to a directory in your PATH or add target\release to PATH
Verify Installation:
leaktor --version
brew tap reschjonas/tap
brew install leaktor
# Install Rust from https://rustup.rs if not already installed
cargo install leaktor
# Download and install
curl -L https://github.com/reschjonas/leaktor/releases/latest/download/leaktor-macos.tar.gz | tar xz
sudo mv leaktor /usr/local/bin/
# Install Rust and Git if not already installed
git clone https://github.com/reschjonas/leaktor
cd leaktor
cargo build --release
sudo cp target/release/leaktor /usr/local/bin/
Verify Installation:
leaktor --version
# Install Rust from https://rustup.rs if not already installed
cargo install leaktor
# For x86_64
curl -L https://github.com/reschjonas/leaktor/releases/latest/download/leaktor-linux-x86_64.tar.gz | tar xz
sudo mv leaktor /usr/local/bin/
# For ARM64
curl -L https://github.com/reschjonas/leaktor/releases/latest/download/leaktor-linux-aarch64.tar.gz | tar xz
sudo mv leaktor /usr/local/bin/
# Install Rust and Git if not already installed
# Debian/Ubuntu:
sudo apt install build-essential git pkg-config libssl-dev
# Fedora/RHEL:
sudo dnf install gcc git pkg-config openssl-devel
# Arch:
sudo pacman -S base-devel git openssl
# Build and install
git clone https://github.com/reschjonas/leaktor
cd leaktor
cargo build --release
sudo cp target/release/leaktor /usr/local/bin/
Verify Installation:
leaktor --version
For contributors or those who want the latest development version:
git clone https://github.com/reschjonas/leaktor
cd leaktor
cargo build --release
# The binary will be at target/release/leaktor
# You can run it directly or copy to your PATH
./target/release/leaktor --version
Scan your current project:
leaktor scan
Scan a specific directory:
leaktor scan /path/to/project
Scan and validate secrets (checks if they're actually active):
leaktor scan --validate
Console output (default - colored, formatted):
leaktor scan
JSON report (for programmatic processing):
leaktor scan --format json --output results.json
HTML report (beautiful, interactive web report):
leaktor scan --format html --output report.html
# Open report.html in your browser
SARIF report (for GitHub Security tab, IDEs):
leaktor scan --format sarif --output results.sarif
Create an ignore file (exclude false positives):
leaktor init
# Edit .leaktorignore to add patterns
Install pre-commit hook (prevent secret commits):
leaktor install-hook
# Hook will run automatically before each commit
Generate config file (customize behavior):
leaktor config
# Edit .leaktor.toml to adjust settings
Scan before pushing to remote:
leaktor scan --fail-on-found
# Exits with code 1 if secrets found - great for CI/CD
Scan only working directory (skip git history):
leaktor scan --git-history=false
High-security scan (strict settings):
leaktor scan --min-confidence 0.9 --entropy 4.0 --validate
Quick scan (exclude tests, higher confidence):
leaktor scan --exclude-tests --min-confidence 0.8
# Scan only working directory (skip git history)
leaktor scan --git-history false
# Limit git history depth
leaktor scan --max-depth 100
# Adjust entropy threshold (default: 3.5)
leaktor scan --entropy 4.0
# Minimum confidence score (0.0 - 1.0)
leaktor scan --min-confidence 0.8
# Exclude test files
leaktor scan --exclude-tests
# Fail with exit code 1 if secrets found (useful for CI/CD)
leaktor scan --fail-on-found
Create a .leaktorignore file:
leaktor init
Example .leaktorignore:
# Ignore test files
*.test.js
*_test.go
tests/*
# Ignore dependencies
node_modules/*
vendor/*
# Ignore specific files
config/example.env
Add inline comments to ignore specific lines:
# This will be ignored
API_KEY = "test_key_1234567890" # leaktor:ignore
# This will be detected
PROD_API_KEY = "live_key_abcdefgh"
Generate a config file:
leaktor config
Example .leaktor.toml:
entropy_threshold = 3.5
min_confidence = 0.6
enable_validation = false
scan_git_history = true
max_git_depth = 1000
respect_gitignore = true
max_file_size = 1048576 # 1MB
exclude_tests = false
exclude_docs = false
report_severities = ["CRITICAL", "HIGH", "MEDIUM", "LOW"]
[[custom_patterns]]
name = "Internal API Key"
regex = "internal_api_[0-9a-f]{32}"
severity = "HIGH"
confidence = 0.85
Automatically scan before each commit:
leaktor install-hook
This creates a pre-commit hook that prevents commits containing secrets.
See all detectable secret types:
leaktor list
Leaktor uses a multi-layered approach to detect secrets:
File → Pattern Match → Entropy Check → Context Analysis → Severity Scoring → Validation (opt-in) → Report
╔═══════════════════════════════════════════════╗
║ 🔒 LEAKTOR SECURITY SCAN ║
╚═══════════════════════════════════════════════╝
Summary
Total Findings: 3
Critical: 2
High: 1
Medium: 0
Low: 0
Validated Secrets: 1
Likely False Positives: 0
Findings
[1] 🔴 AWS Access Key [CRITICAL]
Status: ✓ VALIDATED
Location: src/config.rs:42
Confidence: 95%
Entropy: 4.32
Context:
const AWS_KEY = process.env.AWS_ACCESS_KEY;
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE // Found here
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG
═════════════════════════════════════════════════
⚠ Scan complete. 3 secrets detected.
═════════════════════════════════════════════════
Leaktor generates beautiful, self-contained HTML reports with:
name: Security Scan
on: [push, pull_request]
jobs:
leaktor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Full git history
- name: Install Leaktor
run: |
cargo install leaktor
- name: Scan for secrets
run: |
leaktor scan --format sarif --output results.sarif --fail-on-found
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
secrets-scan:
image: rust:latest
script:
- cargo install leaktor
- leaktor scan --format json --output results.json --fail-on-found
artifacts:
reports:
sast: results.json
Leaktor supports configuration files in TOML or YAML format:
.leaktor.toml.leaktor.yaml.leaktor.ymlPlace in your project root for automatic loading.
Contributions are welcome! Here's how you can help:
git checkout -b feature/amazing-feature)cargo test)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Leaktor is designed for security professionals. Please use responsibly:
If you find a security issue in Leaktor itself, please report it privately to the maintainer.
This project is licensed under the MIT License - see the LICENSE file for details.
Jonas Resch (@reschjonas)
Pentester and security tools developer. Building practical tools for the security community.
⭐ If you find Leaktor useful, please star the repository!