# AWS Terraform Security Review: fix risks before apply

> Scan a Terraform plan for the AWS misconfigurations behind real breaches (public S3, open SSH and database ports, admin IAM, unencrypted RDS, secrets in state) and get a fix for each before you apply.

AWS Terraform Security Review: fix risks before apply is a free AI agent skill on Agensi by Rubbaite T. Hassain, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Rubbaite T. Hassain](https://www.agensi.io/creators/rubbaite)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/aws-terraform-security-review-fix-risks-before-apply
- Tags: security, terraform, aws, iac, devops, cloud-security

## About this skill

Most AWS incidents start with one line of infrastructure code: a public bucket, port 22 open to the internet, a policy with `Action: *` on `Resource: *`. This skill makes your agent review Terraform the way a cloud security architect would, before anything reaches your account.

### What it does
- **Reads the real plan** (`terraform show -json`), so variables, modules and defaults are all resolved.
- **38 checks** across S3, security groups, RDS, IAM (including GitHub OIDC roles with no `sub` condition), EC2/IMDSv2, EBS, CloudTrail, KMS, Lambda, load balancers and EKS.
- **Severity-ranked report** with the Terraform change that fixes each finding, and a warning when a fix replaces a resource.
- **Manual checklist** for what scanners cannot judge: intent, state storage, module pinning, cross-account trust.
- **Works with your tools**: merges Checkov or Trivy results if installed, and adds a CI gate.

### How it works
1. Generate `plan.json` (the agent warns you that it can contain secrets and should stay local).
2. Run the bundled scanner (standard-library Python, no network calls).
3. Review intent with you using the checklist.
4. Write `security-review.md` with fixes, accepted risks and next steps.

Read-only by design: it never runs `apply`, `destroy`, `import` or `state` commands.

### What's included
`SKILL.md`, `scripts/scan_plan.py`, a review checklist, and insecure and secure sample plans to try it on.

### Known limitations
- Covers common AWS resources, not every service. A clean scan is not a guarantee.
- Values unknown until apply cannot be checked in a plan.
- Account-level controls (SCPs, organisation trails) may live in another repository.

Need a full Azure or AWS cost and security assessment? Datazo InfoTech, the author's company, does them.

## Requires

- Python 3.9+
- Terraform or OpenTofu
- Optional: Checkov or Trivy

plan.json can contain secrets: keep it local and delete it after the review.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the AWS Terraform Security Review: fix risks before apply skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Does it change my infrastructure?

No. It never runs terraform apply, destroy, import or state commands. It reads the plan and your code, and writes a report.

### Do I need to give the agent AWS credentials?

Only to create the plan. You can run terraform plan yourself and give the agent plan.json; the scanner itself makes no network calls.

### How is this different from asking an AI to read my .tf files?

It reviews the resolved plan (modules, variables and defaults applied) with a deterministic 38-check scanner, then reviews intent with you, so findings are repeatable and each comes with a concrete Terraform fix.

### Does it replace Checkov or Trivy?

No, it complements them. It adds intent review, fixes in context and a readable report, and can merge their output. It also works with OpenTofu.

### What is included?

SKILL.md with the review workflow, scripts/scan_plan.py (standard-library Python, 38 checks, Markdown and JSON output), a manual review checklist, and insecure and secure sample plans to try it on. MIT licence, free.

### Which AWS resources does it not cover?

It focuses on the resources behind most incidents: S3, security groups, RDS, IAM, EC2/EBS, CloudTrail, KMS, Lambda, load balancers and EKS. Other services are reviewed manually with the checklist, and values unknown until apply cannot be checked.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
