High Terraform Data protection

Secrets hardcoded in Terraform files

It's tempting to write a database password or API key straight into a resource argument in a .tf file. That value is then committed to git and also stored, often in plaintext, in Terraform state.

Why it matters

Anyone with the repo (or its history) has the secret, and it can't be rotated without a code change — the same problem as any secret in source.

Terraform state frequently contains the resolved value too, so even a variable can leak if state isn't protected.

How to check for it

How to fix it

SkyShield checks this automatically

Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.

FAQ

Does using a variable hide the secret?
It keeps it out of the .tf file, but the resolved value can still land in state — so protect the state backend and prefer a secret manager / data source.