Interactive terminal scanner for detecting potential secrets in project files.
- scans text-based project files for potential secrets
- interactive TUI built with
curses - color-coded
Findingslist Detailspanel with surrounding context- help window with keyboard shortcuts
- baseline support for accepted findings
- JSON and CSV report export
- CI mode for automated checks
- directory and file-pattern exclusions
The scanner looks for patterns such as:
- password assignments
- AWS access keys
- AWS secret keys
- private keys
- bearer tokens
- JWTs
- connection strings
- high-entropy hexadecimal strings
- Python 3.9+
- terminal with
cursessupport
Scan a project:
python scan_secrets.py /path/to/projectRun in CI mode:
python scan_secrets.py /path/to/project --ciExclude additional directories:
python scan_secrets.py /path/to/project --exclude cache --exclude tmpExclude additional files or glob patterns:
python scan_secrets.py /path/to/project --exclude-file jquery.js --exclude-file "*.min.js"The script already ignores common folders such as:
.gitnode_modulesvendordistbuild
It also includes a built-in list of ignored files and paths, for example:
jquery.jsjquery.min.jsjquery-1.6.3.min.jsadmin/_js/tiny_mce/*public/js/vendor/*
After scanning, the tool writes:
report.json— full report with contextreport.csv— flat CSV report
You can override output paths:
python scan_secrets.py /path/to/project --report-json out/report.json --report-csv out/report.csvAccepted findings can be stored in a baseline file.
Default baseline path:
.secrets-baseline.jsonCustom baseline path:
python scan_secrets.py /path/to/project --baseline custom-baseline.jsonUse the TUI to mark entries as accepted, then save the baseline with:
w— save baseline
↑ / ↓ / PgUp / PgDn— move through findings← / →— horizontal scroll in detailsEnter— open details modalh— open help / aboutq / Esc— quit app or close modal
a— mark as acceptedr— mark as rejecteds— mark as skippedu— reset to pending
f— cycle status filtert— cycle secret type filter/— filter by file pathc— clear filters
w— save baseline
In CI mode the scanner exits with:
0when no new secrets are found2when new secrets are found1on input/path errors
Example:
python scan_secrets.py /path/to/project --ci --baseline .secrets-baseline.json- Run a scan locally.
- Review findings in the TUI.
- Mark known false positives as accepted.
- Save the baseline.
- Use
--ciin your pipeline to detect new secrets.
scan_secrets.py
report.json
report.csv
.secrets-baseline.json
- detection is pattern-based, so false positives are possible
- some secrets may still require manual review
cursesbehavior depends on terminal support and platform
MIT






