Code review iac

From NoorQureshi/security-skills · View interactive version

Code review iac is an AI agent skill from the GitHub repository NoorQureshi/security-skills. Security review of infrastructure-as-code — Terraform, CloudFormation, Ansible, Kubernetes/Helm manifests. Load when reviewing IaC in a repo/PR, on .tf/.yaml/.yml infra files, or "review our Terraform". Signals: *.tf, cloudformation/*.yaml, playbooks, k8s manifests, Helm charts, module registries.

How to use this skill

Skill file

Infrastructure-as-code review

When it applies

Reviewing the code that provisions cloud/infra. IaC misconfigurations become real, exploitable

exposure the moment they apply — a single line can make a bucket public or an SG world-open — so

this pairs directly with the offensive cloud-* skills.

Why it works

IaC is declarative and repeatable: the same insecure default gets deployed everywhere it's

referenced. Scanning the definitions catches the exposure before it exists, and the patterns

(public access, 0.0.0.0/0, plaintext secrets, missing encryption/logging) are consistent across

providers.

Sinks & patterns (scan, then reason about blast radius)

groups / firewall rules 0.0.0.0/0 on 22/3389/DB ports; public RDS/ELB; publiclyAccessible=true.

"*", admin-equivalent managed policies attached broadly.

state or plan output; sensitive = false on secret outputs.

(CloudTrail, flow logs, GCP audit), no MFA-delete/versioning, public snapshots/AMIs.

wide RBAC (cluster-admin), secrets as env/plaintext, latest images, no network policies.

file modes, validate_certs: no.

Method

  1. Run checkov/tfsec/kics for a broad first pass; they cover hundreds of provider rules.
  2. rg '0.0.0.0/0|public|Action.*\*|password|secret|privileged: true' and review each hit's context.
  3. Trace module inputs/variables — an insecure default in a reused module multiplies everywhere.
  4. Check state handling (remote, encrypted, access-controlled) and CI that applies it (code-review-cicd).

Gotchas

References

CIS Benchmarks (AWS/Azure/GCP/Kubernetes); Checkov/tfsec/KICS rule sets; provider well-architected security pillars.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.