DevOps, CI/CD & Infrastructure
Compatible with Cursor, Claude Code, Cline, Roo Code, Antigravity

Infrastructure-as-Code (Terraform) Security & Drift Review

Audit Terraform HCL code for IAM over-permissioning, unencrypted storage, public security groups, and drift risks.

TerraformAWSCloudDevOpsSecurityIaC
Skill Objective

Audit Terraform HCL configurations against CIS benchmarks: catch wildcard IAM policies, block public security group ingress, and enforce KMS encryption at rest.

Execution Workflow Procedure

Ordered steps the coding agent executes when performing this skill.

1

Audit IAM Roles & Least Privilege

Identify and eliminate wildcard permissions (Action: *, Resource: *), restricting roles to explicit actions.

2

Inspect Network Ingress & Public Buckets

Ensure sensitive database ports (5432, 6379) do not allow 0.0.0.0/0 ingress and attach public access blocks to S3 buckets.

3

Enforce Encryption & Secret Management

Verify KMS customer-managed key encryption on storage volumes and ensure secrets are fetched from Secrets Manager.

Agent Safety Guardrails & Anti-Hallucination Rules

  • DO NOT allow 0.0.0.0/0 ingress rules on database, SSH, or cache security groups.
  • DO NOT hardcode API tokens or credentials in Terraform variables or state files.

Expected Output Format

Security findings matrix and hardened HCL code.

🛡️ Compliance & Security Findings: CIS benchmark gap analysis.
🛠️ Hardened Terraform HCL: Compliant, production-ready HCL code.

Domain Verification Checks

No Public DB Ingress: Blocks direct internet access to databases.
S3 Public Access Block: Enforces default block-all-public-access on S3.
KMS Envelope Encryption: Applies KMS encryption with key rotation.

Example Agent Invocations

"Audit this Terraform AWS infrastructure module for security vulnerabilities and public S3 bucket leaks."
"Harden this RDS and VPC Terraform setup to meet SOC 2 compliance standards."

Install / Configure This Skill

# Place in .cursorrules or create .cursor/rules/infrastructure-as-code-terraform-audit.mdc
# Trigger: Whenever you perform infrastructure-as-code (terraform) security & drift review

---
name: infrastructure-as-code-terraform-audit
description: Audit Terraform HCL infrastructure against CIS benchmarks for IAM least privilege, encryption, and network security.
version: 1.0.0
compatibility: [Cursor, Claude Code, Cline, Roo Code, Antigravity]
---

# Infrastructure-as-Code (Terraform) Security & Drift Review

## Objective
Harden cloud infrastructure by discovering and remediating security risks in Terraform HCL code.

## Workflow
1. **IAM Audit**: Restrict wildcard permissions to least-privilege IAM policies.
2. **Network Security**: Eliminate 0.0.0.0/0 ingress rules on databases and attach S3 public access blocks.
3. **Encryption**: Enforce KMS customer-managed encryption at rest and in transit across all storage resources.
Complementary Agent Prompt

Need a quick one-time prompt for chat?

Try the Infrastructure-as-Code (Terraform) Security & Drift Review — a lightweight version designed for 1-click copying directly into Claude, ChatGPT, or Cursor chat.

View Prompt

SprintKit Workflow Integrations

Complementary tools and checklists to pair with this agent workflow.

Related Agent Skills

Explore related procedural workflows in this discipline.

All Skills

Kubernetes Deployment Manifest & Resource Limits Audit

Audit Kubernetes manifests for CPU/memory requests, readiness/liveness probes, HPA, and Pod Disruption Budgets.

KubernetesK8sDevOps+2
3 workflow stepsView skill

Multi-Stage Dockerfile Hardening & Layer Caching

Optimize Dockerfiles for minimal image size, non-root security, layer caching, and CVE vulnerability reduction.

DockerContainersDevOps+2
3 workflow stepsView skill

Application Security & OWASP Top 10 Audit

Audit backend and frontend code for injection, authentication flaws, IDOR, SSRF, and sensitive data leakage.

SecurityOWASPAuth+2
4 workflow stepsView skill