Terraform Iac Reviewer v2

    2

    Pre-apply Terraform gate. 50+ checks: security (S3/IAM), cost (oversized/untagged), CIS compliance, best practices.

    Free

    3 usesSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    terraform-iac-reviewer-v2

    Example session with this skill installed

    Audit my AWS Terraform files in the ./intra folder. Check for security risks and give me a cost estimate.

    • Read your context and instructions
    • Compiled the terraform-iac-reviewer-v2

    Scan Complete: 22 issues found.

    • CRITICAL: S3 bucket 'prod-data' is public.
    • MAJOR: NAT Gateway in every subnet (waste).
    • COST: Estimated $12,800/yr savings possible by rightsizing EC2.
      Verdict: BLOCK.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Terraform IaC Reviewer

    "Works in staging, breaks in prod" usually means someone forgot to add a tag, used a public S3 bucket, or hardcoded a secret. This skill is the pre-apply gate that catches all of that.

    What it does

    A complete IaC audit covering:

    • Security (20 checks) — public S3, open security groups, IAM wildcards, unencrypted storage, secrets in code
    • Cost (12 checks) — oversized instances, missing tags, no lifecycle, always-on resources
    • Best practices (18 checks) — state management, module hygiene, naming, drift
    • Compliance (10 checks) — CIS benchmarks, SOC2 controls, GDPR

    Works with: Terraform, OpenTofu, Pulumi, CloudFormation, CDK.

    When to use it

    • You're about to terraform apply and want a pre-flight check
    • Your security team wants CIS compliance for all IaC
    • Your cloud bill spiked and you need to find waste in code
    • You're scaling Terraform across teams and need consistent standards
    • You want a CI gate that blocks bad PRs

    Why it's better than ad-hoc prompting

    Most "review my Terraform" prompts give generic advice. This skill is different:

    • 50+ concrete checks — not vibes
    • Multi-tool — Terraform, OpenTofu, Pulumi, CloudFormation
    • CI-ready — exit codes, JSON output, SARIF
    • Auto-fixable — many findings include the corrected HCL
    • Compliance mapping — CIS / SOC2 / GDPR

    Architecture

    ┌─────────────────────────────────────────────────────────┐
    │               Agent (Claude/Cursor)                     │
    │  - Reads .tf / .yaml / .ts / .py files                  │
    │  - Calls audit script                                   │
    │  - Synthesizes report with fix list                     │
    └───────────────┬─────────────────────────────────────────┘
                    │
                    ▼
    ┌─────────────────────────────────────────────────────────┐
    │          skills/terraform-iac-reviewer/                 │
    │  scripts/                                                │
    │    ├── audit.py            # 50+ checks                  │
    │    ├── detect_provider.py  # Identify tool              │
    │    ├── check_drift.py      # Compare state vs code      │
    │    ├── cost_estimate.py    # Rough $ from instance types│
    │    ├── cis_compliance.py   # CIS benchmark mapping      │
    │    └── fix_suggestions.py  # Auto-fix for common issues │
    │  references/                                             │
    │    ├── checks-catalog.md    # All 50+ checks detailed   │
    │    ├── cis-mapping.md                                  │
    │    ├── cost-playbook.md                                │
    │    └── state-mgmt.md                                   │
    └─────────────────────────────────────────────────────────┘
    

    Quick start

    # 1. Install
    pip install hcl2 pyyaml
    
    # 2. Audit Terraform / OpenTofu
    python scripts/audit.py ./infra/ --tool terraform
    
    # 3. Audit CloudFormation
    python scripts/audit.py ./cfn/ --tool cloudformation
    
    # 4. Audit Pulumi (TypeScript or Python)
    python scripts/audit.py ./pulumi/ --tool pulumi
    
    # 5. Detect drift between state and code
    python scripts/check_drift.py --state terraform.tfstate --code ./
    
    # 6. Cost estimate
    python scripts/cost_estimate.py ./infra/
    
    # 7. CIS compliance report
    python scripts/cis_compliance.py ./infra/ --framework cis-aws-1.5
    
    # 8. Get auto-fix suggestions
    python scripts/fix_suggestions.py audit-report.json
    

    The 50+ checks (categories)

    Security (20)

    • S3 bucket public (acl = "public-read") → BLOCK
    • S3 bucket without encryption
    • S3 bucket without versioning
    • S3 bucket without access logging
    • Security group with 0.0.0.0/0 ingress on SSH/RDP
    • Security group with 0.0.0.0/0 egress
    • IAM policy with Action: "*" and Resource: "*"
    • IAM role with broad trust policy
    • RDS instance publicly accessible
    • RDS without encryption at rest
    • Lambda function with admin role
    • Secrets in env vars / plaintext
    • KMS key with no rotation
    • CloudFront without WAF
    • API Gateway without authentication
    • SQS without encryption
    • SNS topic without encryption
    • EFS without encryption at rest
    • EBS volume unencrypted
    • OpenSearch / Elasticsearch public endpoint

    Cost (12)

    • EC2 instance over-sized for workload
    • Instance without Savings Plans / Reserved
    • EBS volume over-provisioned IOPS
    • S3 bucket without lifecycle policy
    • CloudWatch log group without retention
    • Always-on resources in dev/staging
    • Missing tags (cost allocation broken)
    • NAT Gateway in every subnet
    • Unused Elastic IPs
    • Unattached EBS volumes
    • Old snapshots (>90 days unused)
    • Lambda over-provisioned memory

    Best practices (18)

    • State file in repo (not remote backend)
    • State in local file without encryption
    • No remote state locking
    • Hardcoded region in resources
    • No .terraform.lock.hcl
    • Module pinned to floating version
    • Count vs for_each misuse
    • Inline vs separate variable file
    • Missing lifecycle { prevent_destroy = true } on critical resources
    • No data "aws_caller_identity" for account ID
    • IAM policy attached directly to user (not role)
    • Random ID not used in resource names
    • Untagged resources
    • No output for important values
    • Variable without description and type
    • Sensitive values not marked
    • No required_providers block
    • terraform { required_version } missing

    Compliance (10)

    • CIS AWS 1.5 / 2.0 benchmarks
    • SOC2 CC6.1 (logical access)
    • SOC2 CC7.2 (system monitoring)
    • GDPR data residency
    • HIPAA encryption controls
    • PCI-DSS logging requirements
    • Tagging for compliance
    • Resource inventory
    • Change management (git history)
    • Audit trail (CloudTrail enabled)

    Sample output

    ## Terraform Audit — ./infra/
    
    **Files scanned**: 47
    **Total checks**: 60
    **Pass**: 38 | **Fail**: 22
    **Critical**: 5 | **Major**: 9 | **Minor**: 8
    
    ### ❌ Critical (BLOCK)
    - S3 bucket `prod-data-lake` has `acl = "public-read"` (CIS 2.1.5)
      Fix: Remove `acl` and use bucket policy with explicit deny
    - Security group `web-sg` allows 0.0.0.0/0 ingress on port 22 (CIS 4.1)
      Fix: Restrict to known IPs or remove SSH ingress
    - IAM policy `admin-policy` has `Action: "*"` + `Resource: "*"`
      Fix: Replace with specific actions + scoped resources
    - RDS instance `prod-db` is publicly accessible
      Fix: Set `publicly_accessible = false`
    - S3 bucket `customer-uploads` has no encryption
      Fix: Add `server_side_encryption_configuration` block
    
    ### ⚠️ Major
    - 3 EC2 instances over-sized (m5.4xlarge but avg CPU 8%)
    - 2 S3 buckets without lifecycle policy
    - NAT Gateway in every subnet ($0.045/hr × 4 = $130/mo wasted)
    
    ### 💡 Minor
    - 8 resources missing `tags` (cost allocation broken)
    - Variables missing `description` and `type`
    
    ### 💰 Estimated annual cost
    - Current: $48,200/yr
    - After fixes: $35,400/yr (saving $12,800/yr)
    
    ### Verdict: 🛑 BLOCK deploy
    

    Pricing

    Single-purchase, lifetime access. $10.00.

    Includes:

    • 6 Python audit scripts
    • 4 reference docs (checks catalog, CIS mapping, cost playbook, state mgmt)
    • 50+ check library
    • CIS AWS 1.5 / 2.0 compliance pack
    • Future updates for the same major version

    Example usage

    "Audit our AWS Terraform. Block any critical issues. Estimate cost savings."

    The skill will:

    1. Parse all .tf files
    2. Run 50+ checks
    3. Identify CIS / SOC2 / GDPR compliance gaps
    4. Estimate cost from instance types
    5. Output audit-report.md with fix list

    Compatibility

    Works with any agent that supports the SKILL.md standard and can execute Python: Claude Code, OpenClaw, Codex CLI, Cursor, Gemini CLI, Cline, Windsurf, Aider. Supports Terraform 0.13+, OpenTofu 1.0+, Pulumi (TS/Py/Go), CloudFormation YAML/JSON, CDK. Tested on Linux, macOS, Windows.

    Tags

    terraform, iac, opentofu, pulumi, cloudformation, devops, security, aws, gcp, azure

    • Requires Python 3.8+ and specific pip packages.
    • Scan logic is static: it may miss complex dynamic policy generation.
    • Cost estimates use generic pricing, not custom cloud contract rates.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    3 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 4 months ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Listed4 months ago

    What's inside

    Frequently Asked Questions

    This skill performs an automated audit of your Infrastructure as Code (IaC) using 50+ specialized checks across security, cost optimization, CIS compliance, and architecture best practices. It catches critical misconfigurations—like public S3 buckets or oversized instances—before you run 'apply.'

    Yes, while optimized for Terraform and OpenTofu, it also includes dedicated scripts for auditing Pulumi (TypeScript/Python), CloudFormation, and AWS CDK templates. This makes it an ideal centralized gate for teams using multiple IaC tools.

    Unlike basic AI prompts that provide generic suggestions, this skill uses a structured Python-based engine to execute concrete, reproducible checks. It maps findings directly to compliance frameworks like CIS and SOC2 and provides SARIF/JSON output for CI/CD integration.

    The skill comes as a downloadable package containing six specialized Python audit scripts, a library of 50+ check definitions, and four detailed reference playbooks. You’ll also receive compliance mappings for CIS AWS benchmarks to help your infrastructure pass audits.

    No complicated setup is required; you simply need Python and a few common libraries (hcl2, pyyaml). Once installed, the AI agent can trigger the scripts locally against your configuration files to generate detailed reports and even suggest HCL code fixes.

    This skill is compatible with any AI agent that can execute Python and access local files, including Claude Code, Cursor, Aider, Windsurf, and Cline. It is tested on Linux, macOS, and Windows environments.

    New in DevOps & Cloud

    Free