ShieldReport
HomeWhat We CheckToolsWikiCompareRoadmapPricingBlogSign InRun Free Scan
Run Scan
HomeWhat We CheckToolsWikiCompareRoadmapPricingBlogSign In
← Back to Wiki

Infrastructure-as-Code Security Misconfiguration

high
CWE-16Configuration

What is IaC Misconfig?

Infrastructure-as-Code files (Docker Compose, Kubernetes YAML, Terraform) deployed with insecure defaults create attack vectors before code even reaches production. Privileged containers, exposed ports, missing resource limits, and insecure configurations are common.

How it works

Developers write IaC manifests using default settings that prioritize convenience over security. Containers run as root, ports bind to 0.0.0.0 instead of localhost, secrets are hardcoded in environment variables, resource limits are missing (enabling DoS), and network policies allow unrestricted pod-to-pod communication.

Impact

Container escape to host system, privilege escalation, denial of service through resource exhaustion, lateral movement between containers, secret exposure, and full cluster compromise.

How ShieldReport detects this

ShieldReport's IaC Scanner statically analyses Docker Compose, Kubernetes YAML, and Terraform files for security anti-patterns including privileged mode, host networking, missing security contexts, exposed ports, and hardcoded secrets.

How to fix it

Run containers as non-root users. Set readOnlyRootFilesystem. Define CPU and memory limits. Use network policies to restrict traffic. Never hardcode secrets — use external secret managers. Scan IaC files in CI/CD before deployment.

Code example

Vulnerable

# VULNERABLE: privileged container, no limits
services:
  app:
    image: myapp:latest
    privileged: true
    ports:
      - "0.0.0.0:3306:3306"
    environment:
      - DB_PASSWORD=hunter2

Secure

# SECURE: non-root, limited, secrets external
services:
  app:
    image: myapp:latest
    user: "1000:1000"
    read_only: true
    ports:
      - "127.0.0.1:3306:3306"
    secrets:
      - db_password
    deploy:
      resources:
        limits:
          memory: 512M
          cpus: "0.5"

Tags

iacdockerkubernetesterraformconfiguration

Is your site vulnerable to IaC Misconfig?

Run a free scan to find out in under 2 minutes.

Scan Now
ShieldReport

Website security scanning and reporting for developers, teams, and agencies.

ShieldReport - Security reports done in minutes which developers understand | Product Hunt

Product

  • Free Security Scan
  • What We Check
  • Pricing
  • Sample Report

Resources

  • Security Blog
  • FAQ
  • Website Security Checklist
  • CSP Guide

Topics

  • Security Headers
  • TLS Configuration
  • OWASP Top 10
  • Vulnerability Scanning

© 2026 ShieldReport. All rights reserved.

Run Free ScanPricingBlogSitemapRSS Feed