Secrets Command Reference

The secrets command runs a focused scan that evaluates only secret-detection Rego rules (rules with kind: secrets) against your source files. It is equivalent to running:

vulnetix scan --evaluate-secrets --no-sast --no-sca --no-containers --no-iac --no-licenses

Package vulnerability analysis, general SAST rules, license analysis, container analysis, and IaC analysis are all disabled. Only rules that detect hardcoded credentials, API keys, tokens, and private keys run.

Credentials are optional. When no credentials are configured the community fallback is used automatically.

Usage

vulnetix secrets [flags]

Flags

FlagTypeDefaultDescription
--pathstring.Directory to scan
--depthint3Maximum recursion depth for file discovery
--excludestringArray-Exclude paths matching glob pattern (repeatable)
-o, --outputstringArray-Output target: json-sarif for stdout; .sarif file path for file output
--no-progressboolfalseSuppress the progress bar
--severitystring-Exit 1 if any finding meets or exceeds: low, medium, high, critical
--results-onlyboolfalseOnly output when findings exist
--dry-runboolfalseDetect files and check memory — zero API calls

What Gets Detected

Secret-detection rules cover credentials across all major cloud providers and services:

CategoryExamples
Cloud providersAWS access key IDs, Azure storage keys, GCP service account keys
Source controlGitHub tokens, GitLab personal access tokens
CommunicationSlack tokens, Twilio auth tokens
PaymentStripe secret keys, PayPal tokens
Private keysRSA, DSA, EC, OpenSSH private keys, PGP keys
Generic patternsGeneric API keys, bearer tokens, OAuth secrets

See the Secrets / Credentials rules section for the full list of 32 rules.

Examples

# Secret scan of the current directory
vulnetix secrets

# Scan a specific directory
vulnetix secrets --path /path/to/project

# Break the build on any secret found (all secrets are high/critical)
vulnetix secrets --severity high

# Emit SARIF JSON to stdout
vulnetix secrets --output json-sarif

# Write SARIF to a file
vulnetix secrets --output secrets.sarif

# Silent when no secrets found
vulnetix secrets --results-only

# Exclude test fixtures
vulnetix secrets --exclude "test/**" --exclude "fixtures/**"

Output Files

PathDescription
.vulnetix/sast.sarifSARIF 2.1.0 report from secret detection
.vulnetix/memory.yamlScan state record (timestamp, finding counts, git context)

Exit Codes

CodeMeaning
0Scan completed successfully (no threshold breach)
1A gate was breached (--severity), or a fatal error occurred