Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
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.

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.