secret-guard
Purpose
Secret scanning wrapper for repositories and skill configs.
Runbook
- Run
scripts/scan.sh [TARGET_PATH](default: current directory). - The script attempts to use
gitleaksif available, else falls back totrufflehog, else uses built-in regex patterns. - Scan scope includes git-tracked files,
SKILL.mdfiles,.envfiles, and shell scripts. - Findings are written to
secret-findings.json. - Run
scripts/report.shto produce a markdown summary of findings with remediation guidance. - Never print secret values; truncate matched strings to the first 6 characters plus
***.
Stop conditions
- Abort if
TARGET_PATHdoes not exist. - Abort if no scanning tool is available and the built-in regex scan also fails.
- Never write secret values to disk or logs; always mask.
- Abort if the active variant is unsupported.
Output format
secret-findings.json— findings:[{tool, file, line, rule_id, severity, masked_value}]- Console: markdown summary with finding count by severity and remediation steps
Example invocations
bash skills/secret-guard/scripts/scan.sh .bash skills/secret-guard/scripts/scan.sh /path/to/repobash skills/secret-guard/scripts/report.sh secret-findings.json- "Scan this repository for accidentally committed secrets."