infra-security
БесплатноЗапускает вложенные скриптыНе проверенAudit Infrastructure-as-Code for security misconfigurations before it ships — Terraform (.tf/.tfvars/.hcl), CloudFormation/SAM (YAML/JSON), Kubernetes & Helm…
от superagent-ai★ 82 звезды на GitHubОб этом скилле
Infrastructure-as-Code Security Scanner
This skill turns the model into a cloud security auditor. Read the IaC, find the dangerous misconfigurations, and report each one with a severity and a concrete fix. The analysis runs entirely against files on disk — no live cloud, no credentials, no apply.
The rules encode the consensus from the CIS Benchmarks, AWS Well-Architected, the Kubernetes Pod Security Standards, and the checks that tools like tfsec/trivy, checkov, kube-score, and cfn-nag ship — applied as a source read rather than another scanner to wire up.
How it works: two stages
This skill is deliberately split, the same way skill-security is.
- Stage 1 — the scanner (deterministic, mechanical).
scripts/scan.pydoes the fast, high-recall work: it walks the target, classifies each file by format, and runs line-oriented detectors for the misconfigurations that are unambiguous in text (0.0.0.0/0on port 22,Action: "*",privileged: true,runAsUser: 0, a public-read S3 ACL). It is offline and dependency-free — pure Python standard library, nopip install, nohcl2, nopyyaml. It emits findings withfile:lineand a CI-friendly exit code. - Stage 2 — you (semantic, judgment). The scanner cannot reason about blast radius or compensating controls. You can. You read the flagged resources alongside the rest of the IaC and decide what the scanner cannot: is that
0.0.0.0/0actually reachable, or fronted by a WAF? Does that wildcard IAM policy attach to an internet-facing instance, turning a P1 into a P0? Is the "missing" encryption set by a default elsewhere in the module? Stage 1 finds candidates; you confirm impact, suppress false positives, and catch the judgment-only misconfigs (least-privilege gaps, a missing resource, cross-resource chains) that no regex can see.
The scanner is high-recall, not high-precision on purpose. Trust its file:line anchors; apply your own judgment to severity and validity.
Mental model
Misconfiguration risk is exposure × blast radius, not a checklist tick.
- Exposure — can an attacker reach it? Internet-facing (
0.0.0.0/0, public ACL, public subnet) is the top of the funnel. Internal-only, behind a private subnet or an authn proxy, is far lower. - Blast radius — if reached, what falls? A wildcard IAM policy on a bastion is bad; the same policy on a role assumed by every Lambda is a takeover. Encryption-off on a scratch bucket is P3; on the bucket holding PII it is P1.
The same literal pattern can be P0 or P3 depending on these two axes — which is exactly why the scanner proposes and you decide. When you genuinely cannot tell the blast radius from the IaC alone, say so and rate conservatively with the assumption stated.
Workflow
Three phases, in order.
Phase 1 — Discover and ingest
Run the scanner over the target to get the candidate findings and a file inventory:
python3 scripts/scan.py <target-dir> --format markdown
It classifies files by extension and a content peek:
- Terraform —
.tf,.tfvars,.hcl - CloudFormation / SAM —
.yaml/.yml/.jsonwithAWSTemplateFormatVersionor aResources:map ofAWS::*types - Kubernetes / Helm —
.yaml/.ymlwithapiVersion:andkind:(multi-document streams split on---) - Docker —
Dockerfile*,docker-compose*.yml
Use --format json when you want to fold the findings into your own reasoning programmatically; --severity P0,P1 to focus; the scanner exits 1 when any P0/P1 is present (so it gates a pipeline) and 0 otherwise.
Phase 2 — Evaluate by category
Take the scanner's candidates and read the surrounding IaC. Walk the categories in references/controls.md, confirming impact and looking for the judgment-only gaps the scanner can't:
- Identity & Access (IAM) — wildcard
Action/Resource,*principals in resource policies, over-broad roles attached to compute, missing least privilege, hardcoded credentials. - Network & Firewall —
0.0.0.0/0to sensitive ports (22, 3389, 3306, 5432, 6379, 27017, 9200), databases in public subnets, unnecessary open egress, missing WAF on internet-facing endpoints. - Storage & Data — public S3 ACLs/policies, encryption-at-rest disabled (S3/EBS/RDS/DynamoDB), versioning/logging off on sensitive buckets, public snapshots.
- Compute & Containers — privileged containers, running as root, no
readOnlyRootFilesystem,hostNetwork/hostPID/hostIPC, the Docker socket mounted in, missing resource limits. - Secrets & Encryption — plaintext secrets in variables/env/ConfigMaps, missing TLS, wildcard KMS key policies.
- Logging & Monitoring — CloudTrail/Config/VPC Flow Logs disabled, missing log retention or encryption.
- Supply chain — images on
:latestor from untrusted registries, Terraform modules from unpinned git/HTTP sources.
For each candidate, the deciding question is the mental model: *what is the exposure, and what
Установить infra-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл infra-security?
Audit Infrastructure-as-Code for security misconfigurations before it ships — Terraform (.tf/.tfvars/.hcl), CloudFormation/SAM (YAML/JSON), Kubernetes & Helm manifests, and Docker / Docker Compose. Reads the IaC offline and reports each misconfiguration at file:line with a severity (P0–P3) and a corrected snippet. A dependency-free scanner does the high-recall first pass; the model adds blast-radius and cross-resource judgment. No cloud credentials, no terraform apply, no pip install. Trigger when reviewing a Terraform plan before apply, auditing K8s/Helm manifests or a Dockerfile before deploy, checking CloudFormation for public S3 buckets or open security groups, doing a pre-deployment or compliance (SOC-2 / PCI-DSS / ISO-27001) security review, or when the user asks "audit this Terraform", "is this S3 bucket public?", "is this security group open to the internet?", "is this container running as root?", "what's the blast radius if this infra is wrong?", or "run an IaC security scan".
Как установить скилл infra-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл infra-security запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic