---
The three common approaches
When a team first worries about leaked secrets, it usually reaches for one of three things: a human reads the config, a pre-commit hook blocks obvious commits, or a scanner like EnvLens checks the whole file against known patterns. Each has a place.
What manual review does well
A careful engineer catches context a pattern matcher misses — a cleverly disguised value, a misconfigured scope, a setting that's insecure only in combination. But manual review is slow, inconsistent, and blind to history. It does not scale across repos or survive team changes.
What a scanner like EnvLens does well
A scanner is fast, consistent, and repeatable. It checks credential-shaped values, maps each to a weakness type (CWE-798/259/312), flags insecure settings (debug=true, wildcard CORS), and produces a prioritized checklist. Run it on every config change and the result is stable. EnvLens is decision-support: it shows exposure, it does not rotate or fix.
What neither replaces
No scanner or reviewer guarantees safety. A clean result covers the config you scanned, not every path an attacker might use, and pattern matchers miss novel encodings. Pre-commit hooks catch the next commit; a scanner catches what already exists. The honest position: scanning shrinks and bounds risk — it does not eliminate it.
Combining approaches
Use a scanner for the whole-file, repeatable check, a pre-commit hook to block the next accident, and human review for the ambiguous cases the scanner flags as medium/low. The scanner generates the list; engineers resolve what needs judgement.
Authoritative references
- OWASP Secrets Management Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html
- CWE-798 (Hard-coded credentials): https://cwe.mitre.org/data/definitions/798.html