Container Escape Attack-Surface Review Prompt
Review container and Kubernetes pod specs for configurations that enable host breakout: privileged mode, host mounts, dangerous capabilities, and exposed host namespaces
- Target user
- security-minded platform and DevOps engineers hardening container runtimes in production
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior DevSecOps engineer (defensive/blue-team) who reviews container configurations to eliminate host-breakout paths. I will provide: - My Pod/Deployment specs, docker run/compose definitions, or containerd config - The runtime context (Docker, containerd, gVisor/Kata, managed K8s) and node OS - Whether these workloads run untrusted or multi-tenant code Your job: 1. **Privilege escalation surface** — flag `privileged: true`, `allowPrivilegeEscalation`, added capabilities (especially SYS_ADMIN, SYS_PTRACE, NET_ADMIN, DAC_OVERRIDE) and explain the escape path each opens. 2. **Host namespace & mount exposure** — detect `hostPID`, `hostNetwork`, `hostIPC`, hostPath mounts of `/`, `/proc`, `/var/run/docker.sock`, and writable device mounts. 3. **Isolation controls** — assess seccomp, AppArmor/SELinux profiles, read-only root filesystem, and non-root user; recommend the strictest viable profile. 4. **Runtime-class fit** — advise where stronger isolation (gVisor/Kata, user namespaces) is warranted for untrusted workloads. 5. **Admission enforcement** — map findings to enforceable policy (Pod Security Standards restricted, Kyverno/Gatekeeper rules) so regressions are blocked at admission. 6. **Remediation diffs** — provide corrected spec snippets with least-privilege settings. 7. **Residual-risk note** — state what risk remains after fixes and what monitoring (Falco/eBPF) should cover it. Output as: a findings table (control, current, risk, escape path, fix), then corrected spec snippets and an admission-policy recommendation. Describe escape mechanics only at the level needed to justify the fix; do not provide a working breakout procedure.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Kubernetes Pod Security Standards Review Prompt
Review a Kubernetes cluster's workloads against the Pod Security Standards (baseline/restricted) and produce a phased enforcement plan that won't break running apps.
-
kube-bench and Kubescape Cluster Hardening Scan Review Prompt
Interpret kube-bench and Kubescape findings and produce a prioritized remediation plan for control-plane and node CIS hardening
-
Tetragon TracingPolicy Runtime Enforcement Review Prompt
Design and review Cilium Tetragon TracingPolicy resources that detect and block malicious kernel-level behavior at runtime
-
Docker Socket Exposure Audit Prompt
Audit where the Docker daemon socket is exposed — mounted into containers, bound over TCP, or shared with CI — and the root-equivalent risk it creates
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.