LeakLens
EXECUTIVE SUMMARY
LeakLens is a single‑file Node.js secret scanner that operates without any dependencies or external binaries. It comprehensively scans both the working tree and the complete Git object database—including unreachable blobs and dangling commits—to detect credentials using sophisticated pattern matching, entropy analysis, and offline checksum validation against known credential databases.
PROBLEM STATEMENT
Modern secret scanning solutions often require complex dependencies, external tools, or network connectivity, making them unsuitable for air‑gapped or minimal environments. Security teams need a portable, zero‑dependency scanner that can operate in restricted environments while providing comprehensive detection capabilities and forensic‑grade audit trails.
INVESTIGATIVE FINDINGS
- ▸Traditional secret scanners rely on external dependencies that increase attack surface and maintenance overhead
- ▸Git‑based scanners frequently require the git binary, which may be absent in containerized or minimal environments
- ▸Many scanning tools make network calls for validation, creating potential data leakage risks in secure environments
- ▸Existing solutions often lack the ability to scan unreachable Git objects where historical secrets may remain
BEHAVIORAL ANALYSIS
Prioritizes security assurance and auditability over convenience. The zero‑dependency design allows security teams to verify the scanner itself before trusting its output, while the local‑only operation ensures no data exfiltration can occur during scanning operations.
TECHNICAL EXECUTION
Implemented entirely in Node.js ≥20 using only built‑in standard library modules (node:fs, node:crypto, node:path, etc.). Features a four‑stage detection pipeline: (1) Git object enumeration including loose objects and packfiles, (2) regex‑based pattern matching for known credential formats, (3) Shannon entropy analysis to detect high‑entropy strings indicative of secrets, and (4) offline checksum validation against a curated database of known credential patterns. All scanning occurs locally with zero network dependencies.
SYSTEM ARCHITECTURE
OPERATIONAL FEATURES
- ✓History scanning mode (--history) to examine historical commits
- ✓Remediation guidance (--remediate) with automated fix suggestions
- ✓Secret verification mode (--verify) to reduce false positives
- ✓Multiple output formats: JSON, SARIF, and human‑readable
- ✓Automatic secret redaction in all output by default
- ✓Reproducible, zero‑dependency build process
- ✓No network calls during operation ensuring air‑gap compatibility
TECHNOLOGICAL ASSETS
CURRENT STATUS
Active development. Recent additions include improved entropy tuning, expanded credential pattern database, and performance optimizations for large repositories. Planning to add GPG signature verification for detected secrets.
CONCLUSION
Delivers a truly portable, auditable secret scanning solution that operates in any Node.js environment without external dependencies, making it ideal for security assessments in restricted or air‑gapped systems.