Works with the AI Agents you already use
Terraform IaC Security Audit
by CashonlyTian
Audit Terraform files for cloud misconfigurations, open ports, and secrets with a 0-100 score and fix report.
$7
Terraform IaC Security Audit
Example session with this skill installed
Run a security audit on the terraform files in the ./infra/production directory for Project "Titan". Use the brand "Titan-Ops" for the report.
- Read your context and instructions
- Compiled the terraform iac security
- Generated the document
I have completed the security audit for the Terraform files in the ./infra/production directory. The scan identified several critical misconfigurations that should be addressed before deployment.
Audit Summary
- Project: Titan
- Score: 42/100
- Grade: D
- Risk Level: HIGH
- Total Findings: 14 (4 critical, 5 high, 5 medium)
Security Scan Results
| Check Category | Score | Status |
|---|---|---|
| Public Storage | 0/15 | CRITICAL: Public S3 ACLs and Databases found |
| Open Security Groups | 5/15 | HIGH: SSH/RDP open to 0.0.0.0/0 |
| Encryption at Rest | 7/10 | MEDIUM: Unencrypted EBS volumes |
| Secrets in TF | 15/15 | PASS: No hardcoded secrets detected |
| IAM Wildcards | 0/10 | HIGH: Action "*" found in 2 policies |
| Logging & Monitoring | 5/10 | MEDIUM: VPC Flow Logs missing |
| Version Pinning | 5/5 | PASS: All modules and providers pinned |
| State Security | 0/10 | CRITICAL: .tfstate file found in repo |
| Backup & Retention | 2/5 | MEDIUM: RDS backup retention set to 0 |
| Metadata Hardening | 3/5 | LOW: IMDSv2 not enforced on 2 instances |
Top 3 Prioritized Fixes:
1.
Remove State Files: Delete terraform.tfstate from the repository and migrate to a secure remote backend with encryption and locking.
2.
Close Public Storage: Update S3 bucket ACLs to private and set publicly_accessible = false on the RDS instance in db.tf.
3. Restrict IAM Policies: Replace Action = ["*"] with specific service actions in the app-runner-role policy.
Generated Files:
- Scorecard Image:
scan-2025-05-20.png - Detailed Report:
scan-report.md
Next steps
- Delete the committed
.tfstatefile immediately to prevent state exposure. - Apply the S3 and RDS access blocks to remediate the public exposure findings.
- Re-run the scan after applying fixes to verify the new security grade.
scan-2025-05-20.png
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Deploying cloud infrastructure without a pre-flight security check is a liability. This skill audits your local Terraform files to catch misconfigurations, open ports, and hardcoded secrets before you run a single deployment command.
What it does
- Scans for public exposure by identifying open S3 buckets, public database flags, and 0.0.0.0/0 ingress rules on sensitive ports.
- Audits encryption and backups to ensure server-side encryption is active, database backups are enabled, and deletion protection is configured.
- Identifies IAM risks including wildcard actions, principal stars, and unhardened EC2 instance metadata (IMDSv1).
- Detects secrets by scanning
.tfand.tfvarsfiles for hardcoded passwords, keys, or tokens. - Evaluates state security by checking for committed
.tfstatefiles and ensuring remote backends use encryption and locking. - Scores infrastructure across 10 specific categories to provide a 0-100 grade, risk level, and prioritized fix report.
How it works
- Provide the local path to the repository containing your Terraform files.
- The agent runs a local Python script to analyze your configuration without uploading data or making network calls.
- Review the generated PNG scorecard for a high-level grade and the Markdown report for specific line-by-line findings.
- Apply the suggested fixes in priority order, starting with the highest point-loss items.
Frameworks & tools
The skill analyzes HCL (HashiCorp Configuration Language) within *.tf and *.tfvars files. It utilizes a local Python-based scanner to generate reports and PNG visual scorecards.
Why this beats prompting it yourself
Generic prompts often miss specific configuration nuances like IMDSv2 requirements or provider version pinning. This skill uses a structured 10-point scoring system and local script execution to provide consistent, repeatable audits that can be integrated into your development flow.
Use cases
- Reviewing pull requests to ensure new infrastructure changes don't introduce security regressions.
- Auditing inherited codebases to establish a security baseline and risk profile.
- Generating shareable security scorecards for client reporting or internal compliance reviews.
- Pre-deployment scanning to prevent the creation of publicly accessible cloud resources.
Known limitations
Does not perform live cloud environment probes or base image CVE scanning. Complex HCL logic like dynamic blocks or deeply nested jsonencode expressions may be missed. Scans are limited to files under 2 MB.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Scans local files only, no live cloud probes. Does not scan binary files or files >2MB. Complex HCL like dynamic blocks or deep jsonencode may be missed.
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
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
- Software
Python 3Pillow