Infrastructure as Code security scanning skill for Terraform, CloudFormation, Kubernetes manifests, Helm charts, and ARM templates...
Thin router for IaC static analysis. Pick the right workflow, run scanners in parallel, aggregate findings into schemas/finding.json, and (where org controls demand it) author Rego policies via the policy-as-code loop. Detailed per-stack commands and rule references live under references/; multi-step runbooks live under workflows/.
.tf / plan JSON for misconfigurationscloud-security.container-security.secrets-scanning (pair with this skill for IaC files that contain secrets).code-security / sast.What file(s)?
โโโ .tf / .tf.json / tfplan.json โ workflows/terraform_scan.md
โโโ CFN .yaml/.json/.template โ workflows/cloudformation_scan.md
โโโ K8s manifests (Deployment/etc) โ workflows/kubernetes_manifest_scan.md
โโโ Helm chart (Chart.yaml) โ references/helm.md (render โ K8s workflow)
โโโ ARM / .bicep โ references/arm_bicep.md
โโโ Need a custom org rule? โ workflows/policy_as_code_loop.md
If the target mixes types (monorepo), fan out: run every applicable workflow in parallel, then merge findings with iac_type as the disambiguator.
Run concurrently (no shared state, all read-only):
Must be sequential:
terraform init && terraform plan && terraform show -json BEFORE plan-based Checkov scanhelm template / kustomize build BEFORE manifest scannerscfn-lint error gate BEFORE CFN security scanners (malformed templates poison the rest)Spawn sub-agents for:
workflows/policy_as_code_loop.md โ it carries full context on Rego idioms and the PASS/FAIL fixture discipline.references/severity_mapping.md, and emit the unified report.Do NOT parallelize across sub-agents when one workflow must gate another (e.g. cfn-lint โ cfn-nag).
0.0.0.0/0 SG rule is actually the desired public edge.All findings MUST conform to schemas/finding.json. Key IaC-specific fields: iac_file, iac_type, resource_type, resource_name, tool, rule_id, cis_benchmark_id, normalized_severity. Dedup on (iac_file, resource_type, resource_name, category) keeping highest normalized severity.
Minimal first pass per stack โ use as a smoke test before invoking a full workflow:
# Terraform
checkov -d . --framework terraform -o json > /tmp/ckv.json
tfsec . --format json > /tmp/tfs.json
# CloudFormation (lint gate โ security)
cfn-lint templates/*.yaml && checkov -d templates/ --framework cloudformation
# Kubernetes manifests
kube-linter lint ./k8s --format json > /tmp/kl.json
checkov -d ./k8s --framework kubernetes
# Helm โ render first
helm template myrel ./chart -f values-prod.yaml | checkov -f - --framework kubernetes
# ARM / Bicep
checkov -d ./arm --framework arm
# Conftest (custom org rules)
conftest test <target> -p policy/
Highest-impact finding families โ fix these before anything else:
0.0.0.0/0 or ::/0 โ sev=critical.allowBlobPublicAccess, RDS/CosmosDB publicly_accessible โ sev=critical.Action: "*" with Resource: "*" in AWS IAM / Azure role / GCP IAM binding โ sev=critical.high.high.high.secrets-scanning skill, keep a breadcrumb in this report.Everything else (tagging, versioning, lifecycle, resource hygiene) queues behind the above.
| Workflow | File | Use when |
|---|---|---|
| Terraform scan | workflows/terraform_scan.md |
Any .tf change or TF repo audit |
| CloudFormation scan | workflows/cloudformation_scan.md |
CFN templates (lint โ security) |
| Kubernetes manifest scan | workflows/kubernetes_manifest_scan.md |
Raw K8s / rendered Helm / kustomize |
| Policy-as-code loop | workflows/policy_as_code_loop.md |
Authoring custom OPA/Rego rules |
| File | Purpose |
|---|---|
examples/opa_rego_templates.md |
Starter Rego for common org controls (K8s, TF, CFN) |
examples/vulnerable_terraform.tf |
Intentionally-misconfigured fixture for scanner / Rego regression tests |
| File | Contents |
|---|---|
references/terraform.md |
Checkov / tfsec / Terrascan commands, misconfig catalog, custom checks |
references/cloudformation.md |
Checkov / cfn-lint / cfn-nag / KICS commands + CFN checklist |
references/kubernetes_manifests.md |
kubesec / Checkov / Trivy / kube-linter / Polaris + K8s checklist |
references/helm.md |
Render-vs-direct scanning, Chart.yaml hygiene, pluto for deprecated APIs |
references/arm_bicep.md |
Checkov / KICS / PSRule for Azure + ARM/Bicep checklist |
references/severity_mapping.md |
Per-tool โ normalized severity table, dedup key, category buckets |
references/ci_cd_integration.md |
GitHub Actions / GitLab CI / pre-commit wiring, gate policy guidance |
references/bounty_patterns_2024_2026.md |
Post-2023 bounty TTPs (Terraform OIDC AWS trust misconfig, Helm dev/prod parity drift, unauth kube-apiserver exposure, shift-left maturity gaps) |
| Tool | Purpose | Install |
|---|---|---|
| Checkov | Multi-framework IaC scanner | pip install checkov |
| tfsec | Terraform security scanner | brew install tfsec |
| Terrascan | Multi-cloud IaC scanner | brew install terrascan |
| KICS | Keeping IaC Secure (Checkmarx) | docker pull checkmarx/kics |
| kubesec | K8s manifest scoring | brew install kubesec |
| kube-linter | K8s rule library | go install golang.stackrox.io/kube-linter/cmd/kube-linter@latest |
| Polaris | Opinionated K8s workload checks | brew install fairwinds/tap/polaris |
| cfn-lint | CFN schema/intrinsic lint | pip install cfn-lint |
| cfn-nag | CFN security scanner | gem install cfn-nag |
| Trivy | Config scanning (IaC mode) | brew install trivy |
| OPA / Conftest | Policy-as-code | brew install opa conftest |
| Regal | Rego linter | brew install regal |
| pluto | Deprecated K8s API detection | brew install FairwindsOps/tap/pluto |
2026-04. Minimum versions: Checkov โฅ 3.0, tfsec โฅ 1.28, Terrascan โฅ 1.19, Conftest โฅ 0.50, OPA โฅ 0.62, kube-linter โฅ 0.6, Polaris โฅ 9.0, cfn-lint โฅ 1.0, Trivy โฅ 0.50.