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

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is Terrascan?

Terrascan is an open-source static analyser for infrastructure as code, written in Go with policies in Rego, which can also run as a Kubernetes admission webhook rather than only in a pipeline.

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

What Is Terrascan?

What Is Terrascan?

Terrascan scans infrastructure as code for security and compliance problems before the infrastructure exists. It was built by Accurics, which Tenable acquired in 2021, and remains open source under the Apache 2.0 licence. The engine is written in Go and the policies are written in Rego, the language of Open Policy Agent.

It covers Terraform, including plan output, Kubernetes manifests, Helm charts, Kustomize overlays, Dockerfiles, CloudFormation, and ARM templates, with several hundred policies across the major cloud providers.

The Feature That Sets It Apart

Most infrastructure scanners live in a pipeline and nowhere else. Terrascan can additionally run as a service and act as a Kubernetes validating admission webhook:

terrascan server --port 9010 --cert-path server.crt --key-path server.key

Pointing a ValidatingWebhookConfiguration at it means the same Rego policies that reject a manifest during code review also reject it at the API server, whatever route it arrived by. That closes the gap every pipeline-only control has: a resource created with kubectl apply from someone’s laptop never passed through the pipeline and was never checked.

It is not a replacement for a full policy engine. Kyverno and Gatekeeper do more at admission, with audit loops over existing objects and mutation support. But having one tool and one policy set for both points of enforcement is a real simplification for a small platform team.

Running a Scan

terrascan scan -i terraform -d ./infrastructure -o sarif
terrascan scan -i k8s -d ./manifests --severity high
terrascan scan -r git -u https://github.com/acme/infra.git

The -i flag selects the input type, -p loads custom policies from a directory, and remote scanning with -r pulls directly from a git repository, an S3 bucket, or a registry, which is useful for scanning modules you consume but do not own. Output formats include human-readable, JSON, YAML, XML, JUnit, and SARIF.

Policies carry metadata mapping findings to CIS Benchmarks, NIST SP 800-53, PCI DSS, SOC 2, and similar frameworks, so the output can be grouped by control rather than by file. For an organisation certified to ISO 27001:2022, this is the evidence that control A.8.9 on configuration management is enforced rather than merely documented.

Writing Policies

A custom policy is a Rego rule plus a JSON metadata file giving it an identifier, severity, category, and the resource type it applies to. The Rego inspects a normalised representation of the configuration, which you can inspect yourself with terrascan scan --config-only — a genuinely useful debugging step when a rule is not matching and you cannot see why.

Choosing Rego means the skill transfers. The same language describes Gatekeeper constraints, Conftest checks in a pipeline, and KICS queries, so a team already invested in Open Policy Agent gains more from Terrascan than from a tool with a bespoke rule format.

Check the Project Before You Standardise on It

Honesty is more useful than enthusiasm here. Terrascan’s development pace has slowed considerably since the Tenable acquisition, with capability increasingly delivered through Tenable’s commercial cloud security product. Its policy library is smaller than Checkov’s or KICS’s, and new cloud resource types are covered more slowly.

That does not make it a bad tool, but it should shape the decision. Check recent repository activity and the date of the most recent policy additions before adopting it as your primary scanner. The admission webhook mode remains a distinctive reason to choose it; if you do not intend to use that, the broader tools are the safer long-term bet.

Running It Alongside Other Checks

Whatever you choose, run one infrastructure scanner properly rather than three carelessly. Overlapping tools produce the same finding three times under three identifiers, and the triage effort consumes exactly the time the automation was meant to save. Suppress with a documented reason next to the resource, review suppressions on a schedule, and pair static scanning with posture management on the running estate, because code analysis cannot see a resource somebody created by hand.

FAQ – Frequently Asked Questions

How Does Terrascan Differ From Checkov and tfsec?

All three scan infrastructure as code for misconfigurations and overlap heavily. Terrascan writes its policies in Rego and can run as a Kubernetes admission webhook, enforcing at deployment as well as in a pipeline. Checkov has a larger policy library, a graph engine for Terraform relationships, and plan scanning. tfsec is Terraform-specialised and is being folded into Trivy. Check project activity before choosing.

Can Terrascan Enforce Policy in a Kubernetes Cluster?

Yes. Running it in server mode and configuring a validating admission webhook means manifests are checked by the API server against the same Rego policies used in your pipeline. That catches resources applied directly rather than through continuous integration. For richer admission control, including audit over existing objects and mutation, a dedicated policy engine such as Kyverno or Gatekeeper does more.

Do I Need to Know Rego?

Not to use the bundled policies, which cover common misconfigurations across the major cloud providers and Kubernetes. Rego is needed only for organisation-specific rules such as mandatory tags, approved regions, or banned resource types. If your team already writes Open Policy Agent policies for admission control or pipeline gating, that knowledge applies directly, which is a genuine argument for the tool.

Is Terrascan Still Actively Maintained?

It remains open source and usable, but development has slowed markedly since Tenable acquired Accurics, with investment going into Tenable’s commercial cloud security offering. Its policy library is smaller than the leading alternatives and new resource types arrive more slowly. Check recent repository activity yourself before standardising on it, particularly if you need coverage of newer cloud services.

Related Terms

You May Be Interested In These

What Is DHCP Snooping?

Cybersecurity Terms

17 November 2026

What Is DHCP Snooping?

Read More
What Is the DREAD Risk Scoring Model?

Cybersecurity Terms

17 November 2026

What Is the DREAD Risk Scoring Model?

Read More
What Are GIAC Certifications?

Cybersecurity Terms

17 November 2026

What Are GIAC Certifications?

Read More