Leaktor
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.
Features
Core Capabilities
- Comprehensive Secret Detection - Detects 40+ types of secrets including AWS keys, GitHub tokens, API keys, private keys, and database credentials
- High Accuracy - Combines regex patterns with entropy analysis to minimize false positives
- Blazingly Fast - Written in Rust with parallel scanning for maximum performance
- Secret Validation - Validates AWS and GitHub credentials to confirm if they're active (optin)
- Context-Aware - Understands test files, documentation, and comments to reduce noise
- Git History Scanning - Scans entire git history to find secrets in old commits
Developer Experience
- Beautiful Console Output - Colored, formatted output with severity indicators
- Multiple Output Formats - JSON, SARIF (for CI/CD), HTML reports, and console
- Flexible Configuration - YAML/TOML config files with sensible defaults
- Smart Ignoring -
.leaktorignorefile and inline// leaktor:ignorecomments - Pre-commit Hooks - Prevent secrets from being committed
- Custom Patterns - Add your own regex patterns for company-specific secrets
Installation
Quick Install (Recommended)
Using Cargo (All Platforms)
Platform-Specific Installation
Option 1: Using Cargo (Recommended)
# Install Rust from https://rustup.rs if not already installed
cargo install leaktor
Option 2: Using Scoop
scoop bucket add leaktor https://github.com/reschjonas/scoop-leaktor
scoop install leaktor
Option 3: Download Pre-built Binary
- Download the latest Windows binary from Releases
- Extract
leaktor.exeto a directory in your PATH (e.g.,C:\Program Files\leaktor\) - Add the directory to your PATH environment variable
Option 4: Build from Source
# 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
Option 1: Using Homebrew (Recommended)
Option 2: Using Cargo
# Install Rust from https://rustup.rs if not already installed
Option 3: Download Pre-built Binary
# Download and install
|
Option 4: Build from Source
# Install Rust and Git if not already installed
Verify Installation:
Option 1: Using Cargo (Recommended)
# Install Rust from https://rustup.rs if not already installed
Option 2: Download Pre-built Binary
# For x86_64
|
# For ARM64
|
Option 3: Build from Source
# Install Rust and Git if not already installed
# Debian/Ubuntu:
# Fedora/RHEL:
# Arch:
# Build and install
Verify Installation:
Install from Source (Development)
For contributors or those who want the latest development version:
# The binary will be at target/release/leaktor
# You can run it directly or copy to your PATH
Quick Start
1️⃣ Basic Scanning
Scan your current project:
Scan a specific directory:
Scan and validate secrets (checks if they're actually active):
2️⃣ Generate Reports
Console output (default - colored, formatted):
JSON report (for programmatic processing):
HTML report (beautiful, interactive web report):
# Open report.html in your browser
SARIF report (for GitHub Security tab, IDEs):
3️⃣ Set Up Protection
Create an ignore file (exclude false positives):
# Edit .leaktorignore to add patterns
Install pre-commit hook (prevent secret commits):
# Hook will run automatically before each commit
Generate config file (customize behavior):
# Edit .leaktor.toml to adjust settings
4️⃣ Common Use Cases
Scan before pushing to remote:
# Exits with code 1 if secrets found - great for CI/CD
Scan only working directory (skip git history):
High-security scan (strict settings):
Quick scan (exclude tests, higher confidence):
Advanced Options
# Scan only working directory (skip git history)
# Limit git history depth
# Adjust entropy threshold (default: 3.5)
# Minimum confidence score (0.0 - 1.0)
# Exclude test files
# Fail with exit code 1 if secrets found (useful for CI/CD)
Usage Examples
Initialize Ignore File
Create a .leaktorignore file:
Example .leaktorignore:
# Ignore test files
*.test.js
*_test.go
tests/*
# Ignore dependencies
node_modules/*
vendor/*
# Ignore specific files
config/example.env
Inline Ignoring
Add inline comments to ignore specific lines:
# This will be ignored
= # leaktor:ignore
# This will be detected
=
Create Configuration File
Generate a config file:
Example .leaktor.toml:
= 3.5
= 0.6
= false
= true
= 1000
= true
= 1048576 # 1MB
= false
= false
= ["CRITICAL", "HIGH", "MEDIUM", "LOW"]
[[]]
= "Internal API Key"
= "internal_api_[0-9a-f]{32}"
= "HIGH"
= 0.85
Install Pre-commit Hook
Automatically scan before each commit:
This creates a pre-commit hook that prevents commits containing secrets.
List Supported Secret Types
See all detectable secret types:
What Secrets Does Leaktor Detect?
Cloud Provider Credentials
- AWS Access Keys, Secret Keys, Session Tokens
- Google Cloud API Keys, Service Accounts
- Azure Storage Keys, Connection Strings, Client Secrets
Version Control Platforms
- GitHub Personal Access Tokens, OAuth Tokens
- GitLab Personal Access Tokens
- Bitbucket Tokens
API Keys & Services
- Stripe API Keys
- SendGrid API Keys
- Twilio API Keys
- Slack Tokens & Webhooks
- Mailgun, Mailchimp, Heroku API Keys
Private Keys
- RSA Private Keys
- SSH Private Keys
- PGP Private Keys
- EC Private Keys
- OpenSSL Private Keys
Databases
- MongoDB Connection Strings
- PostgreSQL Connection Strings
- MySQL Connection Strings
- Redis Connection Strings
Other
- JWT Tokens
- OAuth Tokens
- Generic API Keys
- Passwords in URLs
- High-Entropy Strings
How It Works
Leaktor uses a multi-layered approach to detect secrets:
- Pattern Matching - Regex patterns for known secret formats
- Entropy Analysis - Shannon entropy calculation to detect random strings
- Context Analysis - Understands file types and code context
- Validation (Optional) - Tests if secrets are active using their respective APIs
Detection Flow
File → Pattern Match → Entropy Check → Context Analysis → Severity Scoring → Validation (opt-in) → Report
Output Examples
Console Output
╔═══════════════════════════════════════════════╗
║ 🔒 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.
═════════════════════════════════════════════════
HTML Report
Leaktor generates beautiful, self-contained HTML reports with:
- Summary statistics
- Severity breakdown
- Color-coded findings
- Code context
- Validation status
- Dark theme for easy reading
Integration
CI/CD Integration
GitHub Actions
name: Security Scan
on:
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
GitLab CI
secrets-scan:
image: rust:latest
script:
- cargo install leaktor
- leaktor scan --format json --output results.json --fail-on-found
artifacts:
reports:
sast: results.json
Configuration
Leaktor supports configuration files in TOML or YAML format:
.leaktor.toml.leaktor.yaml.leaktor.yml
Place in your project root for automatic loading.
Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
cargo test) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Security
Leaktor is designed for security professionals. Please use responsibly:
- ✅ Scanning your own codebases
- ✅ Authorized security assessments
- ✅ Educational purposes
- ❌ Unauthorized access to systems
- ❌ Using validated credentials without permission
If you find a security issue in Leaktor itself, please report it privately to the maintainer.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Jonas Resch (@reschjonas)
Pentester and security tools developer. Building practical tools for the security community.
Acknowledgments
- Built with Rust
Support
- Report a bug
- Request a feature
- Contact: Create an issue on GitHub
⭐ If you find Leaktor useful, please star the repository!