- Home
- Skills
- DevOps & Cloud
- IaC Cost and Security Auditor
IaC Cost and Security Auditor
Audit Terraform, CDK, and CloudFormation for security vulnerabilities and cloud cost leaks.
$1.43
Works with the AI Agents you already use
IaC Cost and Security Auditor
Example session with this skill installed
Audit this terraform code for any security risks or high costs: resource "aws_instance" "app" { ami = "ami-123" instance_type = "m5.4xlarge" } resource "aws_security_group" "web" { ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } }
- Read your context and instructions
- Compiled the iac cost
I have audited the provided Terraform configuration for security vulnerabilities and cost inefficiencies.
IaC Audit — aws_instance and aws_security_group
Summary
The configuration contains a critical security risk regarding SSH access and a high-impact cost inefficiency due to an oversized instance type for what appears to be a standard app resource.
Security — Critical
- [main.tf:6] Security group
weballows SSH (port 22) access from0.0.0.0/0.
Risk: This exposes the instance to brute-force attacks from the entire internet.
Fix: Restrictcidr_blocksto your specific corporate IP range or use AWS Systems Manager Session Manager to eliminate the need for open SSH ports.cidr_blocks = ["203.0.113.0/24"] # Example: Replace with your VPC or Office IP
Cost — High impact
- [main.tf:2] Instance type
m5.4xlargeis provisioned.
Suggestion: This is a large, general-purpose instance (16 vCPUs, 64 GiB RAM) with a high hourly rate. Unless this is a production database or high-traffic application, consider right-sizing tot3.mediumorm5.large.
Fix:instance_type = "t3.medium"
Security — Medium
- [main.tf:1] Missing EBS encryption and detailed monitoring.
Risk: Data at rest is not encrypted by default on this instance resource, and standard monitoring lacks the granularity needed for rapid incident response.
Fix: Addroot_block_device { encrypted = true }andmonitoring = trueto the resource block.
Next steps
- Update the security group to restrict SSH access to a known CIDR block.
- Confirm the resource requirements for the app instance and downsize if possible.
- Enable EBS encryption to meet compliance best practices.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Infrastructure-as-code (IaC) generated by AI often prioritizes "it works" over "it is secure and cost-efficient." This leads to open security groups, wildcard IAM policies, and oversized cloud instances that aren't caught until the bill arrives or a breach occurs.
What it does
- Scans Terraform, CloudFormation, CDK, and Pulumi files for security red flags like open CIDR ranges, public storage, and unencrypted volumes.
- Identifies cost-inefficient resource choices such as redundant NAT gateways, Multi-AZ in dev environments, and outdated EBS volume types.
- Performs deep IAM policy analysis to find privilege escalation risks beyond simple wildcard checks.
- Classifies findings by severity and impact, providing specific HCL or YAML snippets to fix the identified issues.
Frameworks & tools
Terraform, AWS CloudFormation, AWS CDK, Pulumi, Infracost, AWS, Azure, GCP.
Why this beats prompting it yourself
Generic prompts often miss architectural cost drivers or subtle IAM bypasses. This skill follows a structured rubric to ensure every review covers both security posture and resource right-sizing without getting distracted by code style or linting.
Use cases
- Reviewing a Pull Request that introduces new networking or IAM resources.
- Auditing a generated Terraform plan before executing an apply command.
- Hardening an existing deployment that has grown without oversight.
- Finding immediate cost savings in development or staging environments.
Known limitations
Heuristic-based cost checks do not provide exact dollar amounts without external tools like Infracost. It focuses on infrastructure settings rather than application-level security.
Heuristic cost checks provide relative impact (High/Medium/Low) rather than exact dollar figures unless Infracost is available. Focuses on infra settings, not application-level code vulnerabilities.
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 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
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 2 months ago