IaC Command Reference

The iac command runs a focused scan that evaluates only IaC Rego rules (rules with kind: iac) against Terraform HCL files. Nix files contribute component extraction (flake inputs) via the sca path — there are currently no Nix misconfiguration rules. 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-runboolfalseReport what this command would scan — rule kinds, external rule packs, discovered files — then replay stored results. Zero API calls.
--list-default-rulesboolfalsePrint the built-in rule table and exit
--snippet-contextint-1Source lines captured around each SARIF finding (-1 = dynamic, 0 disables)
--iac-include-ignoredboolfalseInclude files matched by .gitignore (default: gitignored paths are skipped)

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/**"

Reading the output

The report is organised by resource, the thing you change in the file: aws_s3_bucket.logs, Deployment/api, module.net. The resource is read from the file after the scan: the nearest resource/data/module block above the line in Terraform, kind/metadata.name for the YAML document in Kubernetes, the service in a Compose file. A file with no such notion is listed under its path.

 ✖ IAC 7 problems on 3 resources in 4 files          4 need action · 3 can wait · 1 in tests
   9 findings · 2 folded as the same problem · 774 of 2865 rules ran

 NEEDS ACTION · 4 problems on 3 resources
 ────────────────────────────────────────────────────────────────────────────────────────────────
 aws_s3_bucket.logs  infra/storage.tf:12                                               2 problems
  ● HIGH      No server-side encryption        :12    TRIVY-S3-ENC
  ● HIGH      Bucket is publicly readable      :15    VNX-TF-001 · KICS-S3-ACL · REGULA-S3-1

Folding. Several rule packs often flag the same line. Two findings are one problem when they sit on the same line, on the same resource, and name the same weakness (the same CWE set); the row lists every rule that raised it. Findings with no CWE never fold, and a different weakness on the same line stays its own problem. -v folds nothing.

GroupWhat is in it
NEEDS ACTIONResources with critical or high problems in production code.
CAN WAITMedium and low problems, one row per problem, with how many resources it is on. Seven are shown unless -v.
IN TESTSCritical and high problems in test code, as files with a count. --show tests ranks them.
VENDOREDThe same for third_party/, vendor/ and similar trees.

Folding and grouping change only the terminal view; SARIF, JSON, uploads and gates see every finding at its own severity. --explain <file-path> shows every problem in a file with its lines, and --explain <rule-id> the rule and every place it fires.

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

Known false negatives

Detection is deliberately conservative — a missed detection is preferred over a wrong one. Not detected, by design:

  • Kubernetes manifest misconfigurations (privileged pods, hostPath mounts, missing limits) — the built-in rules cover Terraform only today.
  • Resources created through modules whose source is not vendored (only the calling block’s literals are visible).
  • Values resolved from variables, remote state, or workspaces — rules match literals, never evaluate HCL.

Absence of a finding is not verified absence of a misconfiguration.