Infrastructure-as-Code (Terraform) Security & Drift Review
Audit Terraform HCL code for IAM over-permissioning, unencrypted storage, public security groups, and drift risks.
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.
Audit IAM Roles & Least Privilege
Identify and eliminate wildcard permissions (Action: *, Resource: *), restricting roles to explicit actions.
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.
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.
Domain Verification Checks
Example Agent Invocations
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.
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.
SprintKit Workflow Integrations
Complementary tools and checklists to pair with this agent workflow.
Related Agent Skills
Explore related procedural workflows in this discipline.
Kubernetes Deployment Manifest & Resource Limits Audit
Audit Kubernetes manifests for CPU/memory requests, readiness/liveness probes, HPA, and Pod Disruption Budgets.
Multi-Stage Dockerfile Hardening & Layer Caching
Optimize Dockerfiles for minimal image size, non-root security, layer caching, and CVE vulnerability reduction.
Application Security & OWASP Top 10 Audit
Audit backend and frontend code for injection, authentication flaws, IDOR, SSRF, and sensitive data leakage.