CodeSecret v2 is an open-source security CLI that scans local repositories or Git URLs for exposed secrets using TruffleHog, detects the project technology stack, runs static pipeline security checks, and produces both machine-readable and executive-ready reports.
- Open-source Go CLI for repository secret exposure analysis
- TruffleHog-powered secret detection with structured normalization
- Commit-history scanning support (
--history=trueby default) - Pipeline static analysis mode (
--pipeline) with CI/CD hardening checks - Technology fingerprinting for context-aware reporting
- Professional PDF report with risk score, findings detail, technologies, and remediation
- Clean terminal UX with tables for scan and scanme summaries
./setup.shOr build manually:
go mod tidy
go build -o ./bin/codesecret ./cmd/codesecret./bin/codesecret scan --target /path/to/repo
./bin/codesecret scan --target https://github.com/org/repo
# history scan is enabled by default
./bin/codesecret scan --target https://github.com/org/repo --history=false
# run CodeSecret v2 pipeline checks
./bin/codesecret scan --target /path/to/repo --pipelineOutput is written to:
out/{repo_name}/
./bin/codesecret scanme --max-repos 100
# disable commit-history scan for faster execution if needed
./bin/codesecret scanme --max-repos 100 --history=false
# run pipeline checks for each scanned repo
./bin/codesecret scanme --max-repos 100 --pipelineOutput is written to:
out/{username}/{repo_name}/
Aggregate files:
out/{username}/scanme-summary.jsonout/{username}/scanme-report.txt
- Default: banner + concise INFO logs + final tables
--silent: progress/final tables only (no banner/log lines)--history(defaulttrue): includes git commit history scan using TruffleHog git mode--pipeline(defaultfalse): enables CodeSecret v2 static pipeline security checks
Each scan generates:
summary.jsonsecrets.jsonremediation.jsoncodesecret-report.pdf
Pipeline findings are included in the same reports (secrets.json, summary.json, and PDF) with source_type: "pipeline".
All checks are file-based static analysis and run on repository files only (no API calls or authentication needed).
CRITICALSecrets echoed in workflow commandsHIGHUnpinned third-party ActionsHIGHOverprivilegedGITHUB_TOKENpermissionsCRITICALSecrets in DockerfilesMEDIUMMissing or weak.dockerignoreMEDIUMDeploy-on-push without PR gate signal (branch protection inference)CRITICALHardcoded credentials in CI config filesINFOSelf-hosted runner indicator (reported as low-severity risk signal)
- Sample PDF report: assets/samples/codesecret-report.pdf
- Sample summary JSON: assets/samples/summary.json
- Sample findings JSON: assets/samples/secrets.json
- Sample remediation JSON: assets/samples/remediation.json
CLI previews:
go test ./...
go build -o ./bin/codesecret ./cmd/codesecret
./bin/codesecret version
./bin/codesecret scan --target /path/to/repo --output ./out --silent
./bin/codesecret scan --target /path/to/repo --pipeline --silentOnly scan repositories and systems you are authorized to audit.
MIT. See LICENSE.