/tommy-pentest:performing-live-cluster-penetration-testingfrom tommy-pentest
Runs an authorized internal penetration test from inside a live Kubernetes cluster (Azure AKS focus). Covers pod recon, workload-identity escalation, Key Vault credential access, IMDS reachability, RBAC checks, network-policy gaps, and runtime auth correlation.
Ships in tommy-pentest. 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.
None: SKILL.md is the whole skill.
Internal, authenticated penetration test executed from within a running Kubernetes cluster. The passive skills in this pack (headers, TLS, CORS, SAST, secrets scanning) stop at the perimeter. The most severe real findings — shared workload identity granting every pod the same Key Vault reach, internal endpoints gated only by a shared secret, plaintext credentials in pod env — are only observable from a shell inside a pod. This skill covers that gap.
This skill performs ACTIVE testing against live infrastructure. It runs only after
confirming-pentest-authorizationhas passed AND the operator has explicitly confirmed the target cluster is a dev/test cluster. See Safety rules before any other step. Stop and refuse if either gate is unmet.
confirming-pentest-authorization, with the
target cluster listed as an in-scope target and the time window current.kubectl on PATH, and a kubeconfig whose current context points at the
authorized cluster.Do not run any command from later phases until all of the following pass. If any fails, STOP and report a CRITICAL process finding instead of proceeding.
confirming-pentest-authorization passed and the
cluster is named in the in-scope list. If not, refuse.kubectl config current-context
kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'; echo
Refuse if the context, server host, or any namespace carries a prod marker
(prod, production, prd, live). When in doubt, treat it as prod and stop.--insecure-skip-tls-verify to kubectl calls. Do NOT use this
flag against a named/FQDN endpoint.kubectl get pods -A -o wide
kubectl get ns
kubectl get serviceaccounts -A
For each in-scope service pod, read its declared environment, mounted secrets, and volumes:
kubectl get pod <pod> -n <ns> -o yaml # env, envFrom, volumeMounts, serviceAccountName
kubectl exec <pod> -n <ns> -- env # live env as the process sees it
Flag credential patterns: DATABASE_URL, *_SECRET, *_KEY, *_TOKEN, *_PASSWORD.
Check for Azure workload-identity markers: AZURE_FEDERATED_TOKEN_FILE, AZURE_CLIENT_ID, AZURE_TENANT_ID.
Goal: prove whether a pod's identity can read secrets beyond its own service's need.
AZURE_FEDERATED_TOKEN_FILE present, exchange the federated token for an Azure AD access token scoped to Key Vault using the pod's own AZURE_CLIENT_ID/AZURE_TENANT_ID.kubectl get svc -A # ClusterIP = internal-only surface
For each internal service not exposed via ingress, from a neighbouring pod:
/internal/* endpoint. Cross-service secret acceptance = broken trust boundary./health, /metrics, /debug, admin endpoints on internal ports.kubectl exec <pod> -n <ns> -- curl -s -H "Metadata:true" \
"http://169.254.169.254/metadata/instance?api-version=2021-02-01"
Flag if IMDS is reachable from pods (NetworkPolicy should block 169.254.169.254). If reachable, test managed-identity token retrieval.
kubectl auth can-i --list
kubectl auth can-i get secrets -n <other-ns>
kubectl auth can-i create pods -n <ns>
kubectl auth can-i '*' '*' -A
Any create pods, pods/exec, cross-namespace get secrets, or wildcard verb on a workload SA = privilege-escalation finding. Confirm with auth can-i; do NOT actually exploit write capabilities.
Test TCP connectivity across pods and namespaces. Test egress to public internet (curl https://example.com). Unrestricted egress = exfiltration path.
Cross-reference live routes (OpenAPI/openapi.json) against source auth guards. Flag any route present at runtime with no auth middleware in source. Flag include_in_schema=False routes. Fable is the recommended model for this phase — the correlation is large-context and detail-sensitive.
get, describe, logs, auth can-i, exec for read/probe commands. FORBIDDEN: apply, create, patch, delete, edit, scale, any cluster mutation.--insecure-skip-tls-verify only for IP-based dev endpoints.## Live Cluster Pentest Report
### Environment
- Cluster: {name}
- Context: {kube-context} (dev/test confirmed: yes)
- Namespaces tested: {list}
- Pods exec'd into: {list}
### Findings
#### [SEVERITY] Finding title
- **Phase**: A/B/C/D/E/F/G
- **Pod**: {pod-name} ({namespace})
- **Evidence**: exact command + output snippet (secrets redacted)
- **Exploit chain**: step-by-step
- **Remediation**: one line
### Phase Results Summary
| Phase | Tests Run | Findings | Pass |
|-------|-----------|----------|------|
| A Pod recon | | | |
| B Workload identity | | | |
| C Internal endpoints | | | |
| D IMDS | | | |
| E RBAC / privesc | | | |
| F Network policy | | | |
| G Source correlation | | | |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub thameema/memnos --plugin tommy-pentest2 skills in this plugin