agentleFS
NoorQureshiNoorQureshi/ronin/skills/code-review/code-review-iac/SKILL.md

code-review-iac

Skill26 starsChanged 32 days agoMITView on GitHub

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.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run checkov/tfsec/kics for a broad first pass.

    line 45
  2. Very specific:

    Check state handling (remote, encrypted, access-controlled) and CI that applies it (code-review-cicd).

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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)

  • Public exposure: S3/GCS/Blob acl = "public-read" / public access blocks disabled; security groups / firewall rules 0.0.0.0/0 on 22/3389/DB ports; public RDS/ELB; publiclyAccessible=true.
  • Over-broad IAM: Action:"*"/Resource:"*", iam:PassRole wildcards, AssumeRole trust to "*", admin-equivalent managed policies attached broadly.
  • Secrets in code: hardcoded keys/passwords/tokens in .tf/vars/playbooks; secrets committed in state or plan output; sensitive = false on secret outputs.
  • Missing protections: encryption at rest/in transit off (EBS/S3/RDS/SNS), logging/audit disabled (CloudTrail, flow logs, GCP audit), no MFA-delete/versioning, public snapshots/AMIs.
  • Kubernetes/Helm: privileged: true, hostNetwork/hostPID, no securityContext/runAsNonRoot, wide RBAC (cluster-admin), secrets as env/plaintext, latest images, no network policies.
  • Ansible: shell/command with unquoted vars, no_log missing on secret tasks, world-readable 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

  • A finding's severity depends on blast radius — a public dev sandbox ≠ a public prod data store.
  • Scanners miss cross-resource logic (an SG that's fine until paired with a public subnet) — reason about the whole graph.
  • Secrets belong in a manager (Vault/SSM/KMS), never in variables or state — flag any inline secret.

References

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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.