IaC Command Reference

The iac command runs a focused scan that evaluates only IaC Rego rules (rules with kind: iac) against Terraform HCL and Nix manifest files. It is equivalent to running:

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

Package vulnerability analysis, general SAST rules, license analysis, secret detection, and container analysis are all disabled. Only rules that analyse Infrastructure as Code files run.

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

Usage

vulnetix iac [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

Detected File Types

The iac command scans files identified as IaC manifests:

Filename / PatternLanguage
*.tfhcl (Terraform)
flake.nixnix
flake.locknix

What Gets Detected

IaC rules check for common Terraform misconfigurations:

Rule IDSeverityName
VNX-TF-001HighS3 bucket with public access enabled
VNX-TF-002HighSecurity group with unrestricted ingress (0.0.0.0/0)
VNX-TF-003HighIAM policy with wildcard resource or action
VNX-TF-004MediumRDS / Aurora instance not encrypted at rest
VNX-TF-005MediumCloudTrail logging not enabled
VNX-TF-006MediumEC2 instance metadata service v1 allowed (IMDSv1)
VNX-TF-007MediumEBS volume not encrypted
VNX-TF-008HighHardcoded secret or credential in Terraform resource

See the Terraform / IaC rules section for full details.

Examples

# IaC scan of the current directory
vulnetix iac

# Scan a specific Terraform project
vulnetix iac --path /path/to/terraform

# Break the build on high or critical IaC findings
vulnetix iac --severity high

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

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

# Silent when no issues found
vulnetix iac --results-only

# Exclude modules directory
vulnetix iac --exclude ".terraform/**"

Output Files

PathDescription
.vulnetix/sast.sarifSARIF 2.1.0 report from IaC analysis
.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