iac-scan
Skill12 starsChanged 4 months agoMITView on GitHub
Infrastructure-as-Code security scan for changed deploy config — Dockerfiles, docker-compose, Terraform, Kubernetes/Helm, and CI/CD workflows. Flags misconfigurations and exposed secrets (root containers, open ingress, wildcard IAM, privileged pods, untrusted CI triggers). Static diff-scoped analysis (safe to auto-run); uses tfsec/checkov/hadolint/actionlint when present. Use when asked to "scan infra", "IaC scan", "check the Dockerfile/terraform/k8s", "CI security", or after changing deploy/infra config.
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
Scope to the changed infra files: Don't re-scan the whole tree.
- Distinctive: line 70
If none of these changed, say so and stop.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/iac-scan
Scan changed infrastructure/deploy config for security misconfigurations and exposed secrets. Static and read-only — analyzes the files directly.
Auto-run safety envelope: the auto-run path uses only local static linters
that need no network and no auth — hadolint, tfsec, checkov (offline/local
policy only), kube-score, actionlint, zizmor. That's why it's safe to
auto-run, unlike /pentest (an interactive check gated on an authorization
confirmation, whose opt-in clearwing modes are networked scanners that bill
their own LLM provider — its default in-harness source hunt touches no network
but still waits for authorization). Anything that reaches the network — e.g. trivy pulling vulnerability
DBs, or checkov fetching remote policies — is opt-in / recommend-only, never
part of the auto-run. If only networked tools are available, run the signature
checks instead and recommend the networked scan separately.
Hard rules
- Evidence-grounded: file:line, the offending directive, the rule/CWE, and the concrete risk ("container runs as root", "0.0.0.0/0 on port 22", "secret baked into image layer").
- Severity by blast radius: internet-exposed, privilege-escalating, or secret-leaking misconfigs are CRITICAL/HIGH; style/pinning nits are LOW.
- Smallest correct fix, shown as a diff; do not apply it.
- Scope to the changed infra files. Don't re-scan the whole tree.
- Prefer real scanners when present. Local static linters (
hadolint,tfsec,kube-score,actionlint,zizmor, offlinecheckov) are part of the auto-run path; networked scanners (trivyDB pulls, remote-policycheckov) are recommend-only. Fall back to the signature checks below when none are present — and always say which mode ran (which tools, or signature mode).
Trigger (what counts as infra/deploy config)
- Containers:
Dockerfile,*.dockerfile,docker-compose*.y*ml,.dockerignore - Terraform:
*.tf,*.tfvars - Kubernetes / Helm:
*.y*mlwithkind:underk8s/,manifests/,charts/,helm/, ordeploy/ - CI/CD:
.github/workflows/**,.gitlab-ci.yml,Jenkinsfile,*.circleci/* - Web/proxy/cloud:
nginx.conf,Caddyfile,*.tfcloud resources,serverless.yml
If none of these changed, say so and stop.
What to check
Docker — non-root USER; pinned base image (no :latest); no secrets in
ENV/ARG/layers; no ADD http://…; minimal surface; HEALTHCHECK; no
unnecessary EXPOSE; --no-install-recommends/cleaned caches. (hadolint)
docker-compose — no privileged: true; no network_mode: host; never bind
/var/run/docker.sock; secrets via secrets: not environment:; pinned image tags.
Terraform — no security-group/firewall 0.0.0.0/0 on sensitive ports
(22/3389/DB); no public buckets/blobs; no IAM Action: "*" / Resource: "*";
encryption at rest + in transit enabled; no hardcoded secrets/keys; remote state
with locking; logging/versioning on. (tfsec / checkov)
Kubernetes / Helm — runAsNonRoot, drop privileged/allowPrivilegeEscalation;
no hostPath/hostNetwork/hostPID; resource limits/requests set;
readOnlyRootFilesystem; no default ServiceAccount with broad RBAC / cluster-admin;
pinned image digests; NetworkPolicy present; no secrets in plain env. (kube-score / kubesec)
CI/CD (GitHub Actions et al.) — no pull_request_target running untrusted PR
code; least-privilege top-level permissions:; third-party actions pinned to a
full commit SHA (not a moving tag); no script injection via unsanitized
${{ github.event.* }} in run:; secrets never echoed; no persist-credentials
left on when not needed. (actionlint + zizmor)
Web/proxy — TLS enforced; security headers (HSTS, CSP, X-Content-Type-Options); no directory listing; no server tokens leaking versions.
Steps
- Scope — resolve changed infra files (or
$ARGUMENTS). None → stop. - Tool pass — for each file type, if the matching scanner is installed, run it scoped to the changed files and capture findings verbatim. Note which tools ran.
- Signature pass — for file types with no installed scanner, Grep/Read for the patterns above. Mark these Observed (clear match) vs Suspected.
- Secrets sweep — across all changed infra files, flag high-entropy strings,
AKIA…, private keys, tokens,password=/secret=literals. (Complements/defense's app-code secret scan.) - Report — group by severity; smallest fix per finding as a diff.
Report format
# IaC scan — <scope> @ <date>
Scanners run: hadolint ✓ / tfsec ✗ (signature mode) / actionlint ✓ …
## CRITICAL / HIGH
- <file:line> — <directive> — <rule/CWE> — <risk> — <fix>
## MEDIUM / LOW
- …
## Secrets
- <file:line> — <kind> — rotate + move to a secret managerAnti-patterns (do not do)
- Claiming a misconfig without quoting the directive and naming the risk.
- Scanning the whole repo instead of the changed infra files.
- Applying fixes or rewriting manifests — this scans and drafts; the user applies.
- Treating a pinning/style nit as CRITICAL, or burying an open-to-the-world port.
Related commands
/defense— app-code OWASP/secrets sweep;/iac-scanis its infra counterpart./pentest— deeper security hunt (in-harness pipeline by default; network probing drives clearwing's MCP machinery — authorization-gated — and its hunt/SARIF pipeline runs agent-driven on the session via the bundled bridge, with provider-driven runs billed and ask-first); recommend after/iac-scanfinds HIGH/CRITICAL or when a live environment needs probing./cso— threat-model the deployment topology at design time (/write-plan).
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Vulnetix/pix-ai-coding-assistant★ 9same name
- zeljkoobrenovic/sokrates-skills★ 3same name
- muhammedbassem-pixel/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- a11ySkill
- articleSkill
- basic-reviewSkill
- cache-strategySkill
- clean-codeSkill
- cli-for-agentSkill
- content-writerSkill
- daily-qaSkill
- dbmap-auto-offSkill
- dbmapSkill
- db-optimizeSkill
- debugSkill
- defenseSkill
- diff-walkthroughSkill
- evalSkill
- executing-plansSkill
- finish-branchSkill
- fuzzSkill
- handoffSkill
- humanizeSkill
- kb-advisorSkill
- minimalist-reviewSkill
- pentestSkill
- perf-profileSkill
- playwrightSkill
- pricingSkill
- qa-fullSkill
- quota-resilienceSkill
- subagent-driven-developmentSkill
- superskills-doctorSkill
- superskills-upgradeSkill
- tapestrySkill
- tddSkill
- test-coverageSkill
- validate-ideaSkill
- verifySkill
- web-perfSkill
- worktreesSkill
- write-planSkill
- youtubeSkill
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
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.

