Supply chain scanning for Terraform modules and providers
Container images go through a scanner before they ship, as a matter of routine. Meanwhile terraform init pulls modules and provider binaries from wherever the source address points and runs them in your pipeline, often with credentials, usually unreviewed. It's the same supply chain, and it usually gets less scrutiny.
What can go wrong
None of these failure modes is exotic. It's an attack vector waiting to happen. They're the ordinary ways infrastructure code goes wrong, and most teams have no control that would catch them.
- Typosquatted providers. A provider address off by one character resolves to something you did not write. The binary runs with whatever your pipeline has, and provider code is not sandboxed.
- Compromised module tags. A Git tag is mutable. A module you reviewed at
v1.4.0can be quietly repointed at different code, and every consumer picks it up on the next init. - Transitive dependencies. You reviewed the module and provider you called. You didn't review the three modules it calls, or the provider versions they pull.
- Code that runs at apply. A
null_resourcewith alocal-execprovisioner runs arbitrary commands on the machine doing the apply. A module is code.
Scanning at the registry rather than in every pipeline
You can add scanning to every pipeline that runs Terraform and maintain it there indefinitely, or you can scan once at the point of distribution, where the artefact enters your organisation. I'd scan at the registry. Everything published passes through it, so it's the one place a check runs on everyone's behalf.
What Terramantle does at that point:
- Module scanning on publish. Secrets, misconfiguration, malware, and known-vulnerability checks run when a version is published and isn't consumable until scans are complete, findings are normalised into tool-agnostic categories.
- CVE checks on provider binaries. Provider binaries are scanned for known CVEs with severity and fixed-version detail, and a provider SBOM is produced in SPDX form.
- Provider source code intent scanning. Provider source code is reviewed by highly tuned LLM models for known attack vectors and to understand what the code is intending to do and interigate the code itself.
- Blocking policy at publish. Results feed Open Policy Agent policies. A version that fails an enforcing policy is marked non-consumable and returns 403 on a download, so the block is enforced at the registry.
- Live-state findings. The state scanner extracts the endpoints your infrastructure exposes and probes the reachable ports, surfacing the gap between what was reviewed and what can be reached.
What scanning at the registry cannot do
Registry scanning is one layer and it isn't a guarantee. It catches known-bad and obvious-bad at the distribution point. It doesn't watch runtime behaviour, it can't reason about a module that does something dangerous but legitimate by design, and it doesn't replace code review, least-privilege credentials or runtime controls. It moves the cheap, catchable problems to the earliest possible point, and the expensive judgement calls stay with you.
For regulated environments where this scanning has to run with no outbound access, see the air-gapped registry page for more insight. The supply-chain risks here are also part of why a registry is worth having over Git source refs.
If you're running Terraform or OpenTofu somewhere regulated and want to talk through how the supply chain fits together there, .
Supply-chain FAQ
What does Terramantle scan?
Modules, provider binaries and live state. Modules are scanned on publish for secrets, misconfiguration, malware and known vulnerabilities. Provider binaries are scanned for CVEs. State is scanned for secrets and, where your infrastructure exposes endpoints, the reachable ports are probed. Findings are normalised into tool-agnostic categories, so you aren't reading the output of five different scanners.
Do you generate an SBOM?
For providers, yes, as SPDX. When a provider is built or scanned, Terramantle produces an SPDX software bill of materials for it. Per-module SBOMs aren't generated today; module scanning focuses on findings (secrets, misconfiguration, malware, known vulnerabilities) rather than a full bill of materials.
Can a failing scan block a publish?
Yes, via policy. Scan results feed OPA policies, and a version that fails an enforcing policy is marked non-consumable, so it returns a 403 on download and isn't served. The block happens once, at the registry, and each consumer doesn't have to catch it in their own CI.
What can registry scanning not catch?
Plenty. It doesn't see runtime behaviour, it doesn't evaluate your live cloud configuration beyond what state reveals, and it can't judge whether a module does something legitimate but dangerous by design. It's one layer: it catches known-bad and obvious-bad at the distribution point, and it doesn't replace review, least privilege or runtime controls.
Catch what can be caught at the registry.
Terramantle scans modules, providers and state at the registry layer. If your containers get scanned and your Terraform doesn't, this closes that gap.
Last reviewed
Terramantle is a private Terraform and OpenTofu registry. See pricing or read the FAQ.