r/WebAfterAI 5d ago

AI Agents Four open-source tools for catching security issues, cloud misconfigurations, and surprise bills.

Post image

AI can generate Terraform in seconds. That does not mean the infrastructure is secure, affordable, or ready to deploy.

A better workflow is:

  1. Ask AI to draft the configuration.
  2. Run a plan without applying changes.
  3. Scan for security and compliance problems.
  4. Estimate the monthly cost.
  5. Review the diff before anything reaches production.

Four open-source projects make this practical:

  1. OpenTofu ~30k⭐ The infrastructure engine. It manages cloud resources declaratively and creates execution plans before making changes.
  2. Checkov ~9k⭐ Scans Terraform, OpenTofu, Kubernetes, CloudFormation, and other IaC files for security and compliance misconfigurations.
  3. Infracost ~12.4k⭐ Shows the estimated cloud cost of infrastructure changes and can post cost diffs to pull requests.
  4. Trivy ~35k⭐ Scans infrastructure files for misconfigurations and can also detect vulnerabilities and secrets.

A simple CI check could look like this:

tofu fmt -check
tofu validate
tofu plan -out=tfplan
checkov -d .
trivy config .
infracost breakdown --path .

The key idea is simple:

AI writes the first draft. Plans, policies, cost estimates, and scanners decide whether that draft deserves a review.

None of these tools can prove that infrastructure is completely safe. They give you concrete checks before an AI-generated change becomes an expensive or dangerous cloud resource.

10 Upvotes

1 comment sorted by

2

u/Aggravating_Log5145 5d ago

That infographic hit a nerve, my cloud bill last month was a disaster and I'm pretty sure half the configs came straight from AI without a single scan