Platform

Platform overview How it works Authorization testing Evidence & reports Private scanning Integrations

Solutions

Security agencies Product teams Regulated industries Partner programme

Learn

Blog Knowledge hub Compare

Resources

Pricing Documentation Help centre FAQ Security & data What we haven’t proved

Company

About Contact Careers Sign in to the platform Start a $199 pilot →

Home / Knowledge hub / Terraform misconfiguration

Knowledge hub

Terraform misconfiguration

An insecure setting written into infrastructure code and then deployed at scale.

Illustration explaining Terraform misconfiguration

What it means

Terraform is a widely used tool for describing cloud infrastructure in code. A Terraform misconfiguration is an insecure setting written into those files: a public storage bucket, a firewall rule open to the whole internet, a database without encryption, a role with unlimited permissions.

Terraform did what it was told. The weakness was in the instruction. Because the file is applied automatically, the insecure setting is created exactly as written, every time, in every environment that uses it.

Why it matters

A manual mistake affects one resource. A mistake in a shared module can affect dozens of services at once, including ones created long after the original author left. Fixing it means changing the code and applying it again, not just editing the resource.

There is another risk in the state. Terraform's state file can hold sensitive values, such as database passwords, in plain text. HashiCorp's documentation says to treat state as sensitive and protect it. A readable state bucket becomes a source of credentials.

How it shows up

You meet it in modules copied from tutorials, defaults that favour convenience, rules opened for testing and left, and variables that carry secrets. Pipelines that apply the code often run with powerful credentials, so overly broad permissions there matter doubly.

Scan the files before applying with a policy or static analysis tool, review plans in pull requests, store state in an encrypted, access-controlled backend and never put secrets in the code. Compare running resources with the code to catch drift. Handle it like any cloud misconfiguration.

Questions people ask

Terraform misconfiguration, answered

Is Terraform itself insecure?

No. It is a tool that applies what you write. Risk comes from the settings in your files, the modules you reuse, and how you protect the state and the pipeline.

Can the state file leak secrets?

Yes. State can contain sensitive values in plain text. Keep it in a remote backend with encryption and tight access, and do not commit it to version control.

How do we catch misconfigurations before deploying?

Run static analysis or policy checks on the code and on the plan in your pipeline, and block the change when a high-risk rule is broken.

Are public modules safe to use?

Treat them like any dependency. Read them, pin versions and review updates. A module may set defaults that are fine for a demo and unsafe for production.

Does fixing the code fix the live environment?

Only after you apply the change. Check the running resource too, because a manual edit or an old copy may still carry the weak setting.

Cyberlop mark

What did the code ask for?

A weak setting in code ends up as a real exposure in the running app, and that is what we test. A finding shows what we exploited, with the request and response. Book a pilot on one app.

Or start with a $199 pilot on one application: thirty days, success criteria agreed before day one, credited against the annual if you convert.