- Home
- Skills
- DevOps & Cloud
- AWS Terraform Security Review: fix risks before apply
Works with the AI Agents you already use
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.
Free
AWS Terraform Security Review: fix risks before apply
Example session with this skill installed
Review our Terraform for the payments VPC before we apply it. Focus on anything exposed to the internet. The plan is in plan.json.
- Read your context and instructions
- Compiled the aws terraform security
Summary
Scanned 16 planned resources (including the logs module):
4 critical, 7 high, 9 medium, 5 low. Three changes remove most of the risk: scope the IAM policy, add a sub condition to the GitHub deploy role, and close the internet-wide security group rule.
Critical and high findings
| Severity | Resource | Finding | Fix |
|---|---|---|---|
| CRITICAL | aws_iam_policy.app | Action: * on Resource: * (full admin) | List only the actions and ARNs the app needs |
| CRITICAL | aws_iam_role.deploy | GitHub OIDC role has no sub condition: any repository can assume it | StringLike token.actions.githubusercontent.com:sub = repo:acme/payments:ref:refs/heads/main |
| CRITICAL | aws_vpc_security_group_ingress_rule.all | All ports open to 0.0.0.0/0 | Remove; open only 443 from the load balancer |
| CRITICAL | aws_s3_bucket_acl.reports | Bucket ACL is public-read | Set private; object_ownership = "BucketOwnerEnforced" |
| HIGH | aws_security_group.web | SSH 22 and PostgreSQL 5432 open to the internet | Session Manager for admin; DB only from the app security group |
| HIGH | aws_db_instance.main | Publicly accessible, storage not encrypted | See fix below (encryption needs snapshot-restore) |
| HIGH | aws_lambda_function.api | STRIPE_API_KEY in plaintext environment variable | Secrets Manager, read at runtime |
| HIGH | aws_lambda_function_url.api | No authentication | authorization_type = "AWS_IAM" |
Fix example
resource "aws_db_instance" "main" {
publicly_accessible = false
storage_encrypted = true
manage_master_user_password = true # replaces password = "..."
backup_retention_period = 7
deletion_protection = true
}
Enabling encryption on an existing instance replaces it: plan a snapshot and restore in a maintenance window.
Next steps
- Apply the critical fixes and re-run the scan.
- Confirm intent for the HTTP listener without HTTPS redirect (medium) and the public IP on
aws_instance.app(low). - Add the scanner to CI with
--min-severity medium.
Connects securely to your tools. The creator never sees your data.
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
subcondition), 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
- Generate
plan.json(the agent warns you that it can contain secrets and should stay local). - Run the bundled scanner (standard-library Python, no network calls).
- Review intent with you using the checklist.
- Write
security-review.mdwith 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.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
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
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 9 days ago
- Free with an Agensi account
- Software
Python 3.9+
TerraformorOpenTofu- Optional
- CheckovorTrivy
plan.json can contain secrets: keep it local and delete it after the review.
Permissions
What's inside
Frequently Asked Questions
New in DevOps & Cloud
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.