secure-code-triage is a dependency-free Python CLI for fast, defensive security review of local code repositories.
It scans source files for common risky programming patterns, hardcoded secret indicators, committed environment files, and missing security disclosure guidance. The output is designed for maintainers who need a quick first-pass report before deeper review.
This is not a replacement for full SAST, dependency auditing, or manual security review. It is a small triage tool that is easy to run in local development and CI.
From the repository root:
python3 -m pip install .For one-off local use without installation:
PYTHONPATH=src python3 -m secure_code_triage --helpScan a local checkout:
secure-code-triage /path/to/repoWrite JSON:
secure-code-triage /path/to/repo --format jsonWrite SARIF for code scanning integrations:
secure-code-triage /path/to/repo --format sarif -o secure-code-triage.sarifUse it in CI and fail on high severity findings:
secure-code-triage . --fail-on highInclude hidden files and directories beyond .github and .env files:
secure-code-triage . --include-hiddenIgnore a deliberate test fixture on one source line:
payload = "eval(user_input)" # secure-code-triage: ignoreSecret indicators:
- private key blocks
- AWS access keys
- GitHub tokens
- Slack tokens
- generic
password,token,secret, andapi_keyassignments - committed
.envfiles
Risky programming patterns:
- Python
eval,exec, unsafepickle,subprocess(..., shell=True), andyaml.load - JavaScript
eval,child_process.exec, and directinnerHTMLassignment - C/C++
gets,strcpy,strcat, andsprintf - simple SQL execution with Python f-strings
- weak hash use through
md5orsha1
Repository hygiene:
- missing
SECURITY.md - missing
.gitignore
# Secure code triage report
Target: /home/example/project
## Snapshot
- Files scanned: 42
- Files skipped: 3
- High: 1
- Medium: 2
- Low: 1
## Findings
- High secret-generic at app/settings.py:12
Hardcoded secret-like assignment
Evidence: [redacted]
Fix: Move secrets to a managed secret store or runtime environment variable.
Run tests:
python3 -m unittest discover -s testsRun the CLI from source:
PYTHONPATH=src python3 -m secure_code_triage .MIT