/ops-infrastructure:iac-attack-surfacefrom ops-infrastructure
Hunts for exploitable IaC misconfigurations in Terraform, Docker, Compose, Kubernetes, Ansible, and cloud-init from an offensive security perspective. Focuses on exposed services, privilege paths, secrets, workload escape, and lateral movement.
Ships in ops-infrastructure. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Hunt through infrastructure-as-code as an authorized offensive security assessment. The goal is to find misconfigurations that create concrete attacker opportunities: initial access, credential exposure, privilege escalation, lateral movement, workload escape, persistence, data exposure, or detection bypass.
This is a misconfiguration review workflow, not an exploitation workflow. Do not execute attacks or change infrastructure unless the user explicitly asks for follow-up implementation.
Accept natural language or:
$iac-attack-surface [scope] [path]
Supported scopes:
terraformdockercomposekubernetesansiblecloud-initall (default)Examples:
$iac-attack-surface$iac-attack-surface terraform ~/engagement/infra$iac-attack-surface compose .Review this Terraform for exploitable misconfigurations and privilege pathsFind offensive issues in these Kubernetes manifestsPrioritize exploitable misconfigurations over generic best-practice advice. Start from attacker questions:
For each finding, explain the attacker utility, prerequisites, blast radius, safe validation method, and remediation. Always distinguish confirmed evidence from inference. If IaC alone cannot prove runtime exposure or effective permissions, list the exact evidence needed.
Scan the target path for:
| Pattern | Type |
|---|---|
*.tf, *.tfvars, .terraform.lock.hcl | Terraform |
Dockerfile*, .dockerignore | Docker |
docker-compose*.yml, compose*.yml | Docker Compose |
*.yaml, *.yml with apiVersion: | Kubernetes |
playbook*.yml, roles/, inventory*, ansible.cfg | Ansible |
cloud-init*.yml, user-data*, launch templates | cloud-init / user data |
.env, .env.*, *.tfstate, *.tfvars | sensitive artifacts |
Exclude generated dependency folders unless they are the subject of the review: .terraform/, node_modules/, .venv/, vendor/.
Look for:
0.0.0.0/0, ::/0, RFC1918-wide rules, or unbounded security-group references,Look for:
Look for:
.env, terraform.tfvars, state files, kubeconfigs, inventories, and vault password files,ARG, ENV, user data, startup scripts, or Kubernetes Secret manifests,Look for:
privileged: true, host networking, host PID/IPC, broad hostPath mounts,/, /var/run, /etc, /home, cloud credential folders, SSH keys, or kubeconfigs,Look for:
Look for:
latest or unpinned installers that create supply-chain insertion points,Look for:
curl | sh, unauthenticated downloads, unsigned binaries, or Git checkouts from mutable branches,.dockerignore, include .git, secrets, local credentials, or test artifacts,Look for:
After identifying candidate misconfigurations, group related evidence into practical paths:
Prefer findings that complete or materially advance one of these paths. Do not bury the report in low-value hardening notes unless they support an attacker path.
Use assessment impact:
Lead with findings, ordered by severity.
## IaC Attack Surface
### Summary
- Critical: 0
- High: 0
- Medium: 0
- Low: 0
- Files reviewed: N
- Scope: terraform|docker|compose|kubernetes|ansible|cloud-init|all
- Primary paths: initial access|credential access|privilege escalation|lateral movement|persistence|impact
### Findings
#### HIGH-1: Internet-exposed instance profile on SSH-accessible host creates cloud privilege path
**File:** `infra/main.tf:42`
**Evidence:** Security group allows `0.0.0.0/0` to TCP/22 and the instance has `admin_instance_profile`.
**Attack path:** Compromise of SSH credentials could expose cloud permissions attached to the instance.
**Prerequisites:** Network reachability and valid SSH credentials or exploitable SSH-facing service.
**Validation:** Confirm runtime security group attachment and effective role permissions in cloud inventory.
**Remediation:** Restrict management ingress, move access behind a bastion/VPN, and reduce instance profile permissions.
**Path stage:** Initial access -> credential access -> privilege escalation
### Attack Path Notes
- Summarize the most important chained paths, even if individual findings are reported separately.
### Evidence Needed
- List runtime evidence needed for inferred risks, such as effective IAM policy, live security group attachment, or current Kubernetes admission controls.
Before recommending validation, confirm the target belongs to the active engagement or operator-controlled environment. Prefer read-only validation commands and inventory checks. If a validation step could change state, increase traffic, trigger alerts, or access sensitive data, present it as a plan and ask for confirmation first.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/nftables-allow-sourceAdd a source IP or CIDR to nftables using the working method from this repo session: live top-of-`input` insertion with `nft -a` verification first, then persistent config update and reload./proxychains-tunnelRun in-scope network commands through a SOCKS5 tunnel with proxychains4, including tunnel readiness checks and evidence capture. Use when traffic must traverse a local SOCKS proxy (for example pivoting through SSH dynamic forwarding)./ssh-opsEstablish and operate scoped SSH sessions for authorized remote command execution with full evidence capture. Use when the operator provides SSH-accessible targets/credentials and Codex must execute commands on a remote host as an interactive user while enforcing OPSEC gating and safe-check behavior.npx claudepluginhub specterops/skills --plugin ops-infrastructureOther plugins' skills for the same job