tfsec
$ tfsec Official Low RiskFast Go-based static security scanner for Terraform HCL configurations checking AWS, Azure, GCP, and Kubernetes misconfigurations. Supports --format json, --no-color, and --soft-fail; note that Aqua Security has merged tfsec into trivy config.
brew install tfsec Scans local Terraform HCL files offline; use trivy config for active rule updates.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json, --no-color, --soft-fail, --minimum-severity, and --concise-output.
--format jsonand--minimum-severityreturn clean structured JSON
Strictly read-only static HCL scanner; does not invoke terraform providers or access cloud APIs.
- Offline HCL AST analysis with zero writes or cloud calls
Single static Go binary via Homebrew, go install, and GitHub Releases.
- Zero-dependency binary across macOS, Linux, and Windows
Useful on legacy Terraform repos pinned to tfsec, though new checks ship in trivy config instead.
- Superseded by Aqua Security's
trivy config
Official Aqua Security repo (aquasecurity/tfsec), but archived/deprecated as standalone checks migrated into Trivy.
- Merged into
aquasecurity/trivy(trivy config); standalonetfsecis in maintenance/deprecation
Existing docs at aquasecurity.github.io/tfsec/ remain readable with migration notices to Trivy.
- Official docs and Trivy migration notes
Security, Auth & Guardrails
Offline local Terraform HCL scanner; no cloud credentials required.
MIT open-source Go binary; completely free.
# tfsec Agent Rules - Pass `--format json --no-color` (and `--soft-fail` if collecting findings without aborting). - Prefer `trivy config --format json` on new projects since `tfsec` has been merged into Trivy.
Agent-Ready Command Recipes
Safe Read-Only Queries
tfsec . --format json --no-color --minimum-severity MEDIUM
Emits JSON misconfiguration findings at MEDIUM+ severity without modifying Terraform files.
Strengths for Agents
- + Fast single static Go binary with
--format json,--minimum-severity, and--soft-fail. - + Offline read-only HCL scanning requires no cloud credentials or
terraform init.
Caveats & Pitfalls
- ! Deprecated/merged into
trivy(trivy config); rule definitions no longer receive active updates in standalonetfsec. - ! Scanning uninitialized external remote modules may miss module-internal issues without
--run-tf-checksor cached.terraform.