Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is tfsec?

tfsec is a fast static analyser for Terraform that evaluates variables and modules rather than matching text. Aqua Security now folds its engine into Trivy, so new work belongs there.

Illustration for the cybersecurity term tfsec
Home / Blog / Cybersecurity Terms / What Is tfsec?
17 November 2026

What Is tfsec?

What Is tfsec?

tfsec is a static analysis tool built specifically for Terraform. It parses HCL, resolves variables and module inputs where it can, and checks the resulting configuration against several hundred rules covering AWS, Azure, Google Cloud, Kubernetes, and general Terraform practice. It was created by Liam Galvin and later adopted by Aqua Security, and it is written in Go and distributed as a single binary.

Its reputation rests on two things: it is very fast, and because it evaluates rather than pattern-matches, it understands configurations where a security-relevant value is set through a variable or passed into a module.

What a Run Looks Like

tfsec ./infrastructure --minimum-severity HIGH --format sarif --out results.sarif

Findings carry a readable check identifier such as aws-s3-enable-bucket-encryption or azure-storage-default-action-deny, a severity, the exact file and line, a short explanation of the risk, and a link to documentation showing the corrected configuration. Those descriptive identifiers replaced the older numeric AWS001 style in version 1.0, released in late 2021, and remain considerably easier to read in a pull request comment than a numbered rule.

Useful options are few: --soft-fail reports without breaking the build during adoption, --exclude-downloaded-modules avoids drowning in findings from community modules you did not write, and --config-file holds persistent settings so they are not buried in pipeline YAML.

The evaluation step is what separates it from a text scanner. Given a module invoked with encrypted = var.encrypt_volumes, tfsec follows the variable to its default or to the value supplied by the calling module, and judges the configuration that will actually be created. Where the value genuinely cannot be determined, it says so rather than guessing, which keeps the report honest.

Ignores With an Expiry Date

Suppression is an inline comment above the resource:

# tfsec:ignore:aws-s3-enable-bucket-logging
# tfsec:ignore:aws-vpc-no-public-ingress-sgr:exp:2026-03-31

The expiry suffix is a small feature worth copying wherever you find it. An ignore with a date stops being an ignore when the date passes, which converts a permanent silent exception into a decision that comes back for review. Most suppression mechanisms lack this, and most suppression lists grow forever as a result.

The Important Part: It Is Merging Into Trivy

Aqua Security announced that tfsec is being consolidated into Trivy, which now contains the same misconfiguration engine and rule set as part of a scanner that also covers container images, filesystems, dependencies, secrets, licences, and Kubernetes clusters. tfsec itself is in maintenance mode: it still works, but new rules and new cloud resource coverage land in Trivy.

The practical consequences:

What It Could Never Do

Two limits apply equally to its successor. First, tfsec reads source files, not plan output, so a value that only resolves at plan time — from a data source, a remote state lookup, or a computed expression — may be invisible. Checkov’s ability to scan a JSON plan covers that gap, and teams with heavily parameterised modules should run both a source scan and a plan scan.

Second, static analysis of code says nothing about the running estate. Resources created in the console, changed during an incident, or deployed by a pipeline that bypasses review never appear in the repository and never get scanned. That is the job of cloud security posture management, and the two are complements rather than alternatives.

At Privia Security, we assess both the infrastructure code and the deployed configuration behind it in our cloud security services.

FAQ – Frequently Asked Questions

Should I Still Use tfsec?

For an existing pipeline that works, there is no urgency to change. For anything new, use Trivy’s configuration scanning instead, since Aqua Security is consolidating the tfsec engine into Trivy and new rules and cloud resource coverage land there. Trivy understands the same inline ignore comments, so migrating an existing setup is usually a matter of changing the command and the output format.

How Is tfsec Different From Checkov?

tfsec is Terraform-specific and evaluates HCL, including variables and module inputs, which makes it fast and accurate on Terraform specifically. Checkov supports many more formats, has a graph engine for reasoning about relationships between resources, and can scan a resolved Terraform plan in JSON, which catches values that source analysis cannot see. Many teams run a source scan and a plan scan together.

What Does the Expiry Date on an Ignore Comment Do?

It makes the suppression temporary. After the date passes, tfsec stops honouring the ignore and the finding reappears, forcing a fresh decision rather than letting an exception persist silently for years. It is a small feature with a large effect on how suppression lists age, and it is worth applying the same discipline in tools that do not enforce it automatically.

Does tfsec Check My Deployed Infrastructure?

No. It analyses Terraform source files in your repository and knows nothing about what actually exists in your cloud accounts. Resources created through the console, modified manually during an incident, or deployed outside the pipeline are invisible to it. Pair infrastructure as code scanning with cloud security posture management if you want assurance about the running environment.

Related Terms

You May Be Interested In These

What Is Confidential Computing?

Cybersecurity Terms

17 November 2026

What Is Confidential Computing?

Read More
What Is Roaming and GRX Security?

Cybersecurity Terms

17 November 2026

What Is Roaming and GRX Security?

Read More
What Is a Honeynet?

Cybersecurity Terms

17 November 2026

What Is a Honeynet?

Read More