Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

sandtrace audit

Scans source code for hardcoded secrets, supply-chain threats, steganographic payloads, and unicode obfuscation.

Usage

sandtrace audit ./my-project                           # Terminal output
sandtrace audit ./my-project --format json              # JSON for CI pipelines
sandtrace audit ./my-project --format sarif > r.sarif   # SARIF for GitHub Code Scanning
sandtrace audit ./my-project --severity high            # Only high + critical
sandtrace audit ./my-project --rules ./my-rules/        # Custom rules directory

Flags

FlagDefaultDescription
TARGET(required)Directory to scan
--formatterminalOutput format: terminal, json, sarif
--severitylowMinimum severity: info, low, medium, high, critical
--rules~/.sandtrace/rules/Rules directory
--no-colorfalseDisable colored output
-v / -vvIncrease verbosity

Exit codes

CodeMeaning
0Clean — no findings at or above the minimum severity
1High findings detected
2Critical findings detected

Exit codes make sandtrace audit easy to use as a CI gate — any non-zero exit fails the build.

Examples

Audit with high severity filter

sandtrace audit ./my-project --severity high

Only reports findings with severity high or critical.

JSON output for scripting

sandtrace audit ./my-project --format json | jq 'length'

SARIF for GitHub Code Scanning

sandtrace audit . --format sarif > sandtrace.sarif

Upload the SARIF file using the github/codeql-action/upload-sarif@v4 action. See CI/CD Integration for a full workflow example.

Custom rules directory

sandtrace audit ./my-project --rules ./my-custom-rules/

Override the default rules directory. See Custom Rules for the YAML rule format.

Built-in detection rules

See Detection Rules for the full list of 50+ built-in patterns that sandtrace audit checks, including 30 obfuscation rules across 3 tiers.