Security

Infrastructure as Code security: stop misconfigurations before they deploy

Jorge de los Santos, CTO & Co-Founder · April 4, 2026 · 7 min read

Terraform and CloudFormation misconfigurations are the #1 cause of cloud breaches. Catch them in the PR, not in production.

Infrastructure as Code security: stop misconfigurations before they deploy
');">

99%

Cloud failures are misconfig

Pre-merge

Security catches

Auto

Fix PR generation

The #1 Cause of Cloud Breaches Is Preventable

According to Gartner, 99% of cloud security failures through 2025 are the customer’s fault — and the leading cause is misconfiguration. Not sophisticated attacks. Not zero-days. Misconfigured IAM policies, open security groups, and unencrypted storage.

The irony: most of these misconfigurations are written in code — Terraform, CloudFormation, Kubernetes manifests — and reviewed in pull requests. They’re visible, reviewable, and fixable before they ever reach production.

Yet they keep shipping. Because code reviewers aren’t security experts, and security teams don’t review every PR.

What Goes Wrong in Infrastructure as Code

IaC misconfigurations follow predictable patterns:

Overly Permissive IAM

The most common and most dangerous. Policies with * actions or * resources grant far more access than intended. A single overly permissive role can give an attacker access to your entire AWS account.

# Bad: this gives full access to everything
resource "aws_iam_policy" "dev_access" {
  policy = jsonencode({
    Statement = [{
      Effect   = "Allow"
      Action   = "*"
      Resource = "*"
    }]
  })
}

Open Security Groups

Security groups with 0.0.0.0/0 ingress rules on sensitive ports (SSH, RDP, database ports) are one missed firewall rule away from a breach.

Unencrypted Storage and Databases

S3 buckets without encryption, RDS instances without storage_encrypted = true, EBS volumes in the clear. Data at rest encryption is a compliance requirement and a security baseline — but it’s opt-in by default on most cloud resources.

Missing Logging and Monitoring

CloudTrail disabled, VPC flow logs not configured, access logging turned off on S3. Without logs, you can’t detect or investigate a breach.

Hardcoded Secrets

API keys, database passwords, and tokens embedded directly in Terraform variables or CloudFormation parameters. Once committed, they’re in your Git history forever.


See the IAN team run on your cloud. We connect to your AWS account via a scoped read-only role, run the Observe-tier agents, and leave you with a concrete audit report — cost waste, security exposure, compliance gaps, and a labor-offset estimate. You keep the findings regardless of next steps. Get a free infrastructure audit →


Shifting Security Left — What Actually Works

“Shift left” has been a buzzword for years. Here’s what it looks like in practice for IaC:

Pre-Commit Scanning

Run IaC security checks locally before code is committed. This catches the most obvious issues — open security groups, missing encryption flags — before they enter the review process.

CI Pipeline Gates

Every PR that touches infrastructure code triggers an automated security scan. Critical findings block the merge. Medium findings are posted as PR comments with remediation guidance.

The key is not blocking on everything. If your scanner blocks PRs for informational findings, engineers will bypass it. Block on critical and high severity. Comment on medium. Log the rest.

Policy as Code

Define your organization’s security policies as code — what IAM permissions are allowed, which ports can be open, which regions are approved. Tools like OPA (Open Policy Agent) and Sentinel evaluate these policies automatically.

But writing and maintaining policies is the hard part. Most teams start with good intentions and end up with stale, incomplete policy sets.

AI-Powered Review

This is where 2026 is different from 2024. AI models can now:

  • Read Terraform and CloudFormation fluently
  • Understand the security implications of a configuration change
  • Generate the fix — not just flag the problem
  • Explain why a configuration is risky in plain language

Instead of a cryptic “CKV_AWS_18: Ensure S3 bucket has access logging” error code, you get: “This S3 bucket stores customer data but has no access logging enabled. Without logging, you won’t know if data is accessed by an unauthorized party. Here’s a PR that enables it.”

How IAN Secures Your IaC

IAN scans every infrastructure code change — Terraform, CloudFormation, Kubernetes manifests, Docker Compose — and:

  1. Flags misconfigurations with severity and blast radius context
  2. Generates fix PRs for common patterns (tightening IAM, enabling encryption, closing ports)
  3. Enforces policies that you define — or uses sensible defaults based on CIS benchmarks
  4. Monitors drift between your code and your running infrastructure
  5. Maps findings to compliance frameworks — SOC 2, HIPAA, PCI DSS

The scan runs on every push. The fix PR is ready before your morning standup.

Stop Shipping Misconfigurations

Your infrastructure code already goes through pull requests. Add IAN to the pipeline and turn those PRs into security checkpoints — with automated fixes, not just warnings.

Get a free infrastructure audit → | See pricing →

Next step: talk to the team

30 minutes. We'll look at your cloud together and scope what we'd take off your plate — see pricing.

Related Posts