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
- Target user
- security-minded DevOps engineers hardening container hosts and CI runners
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior DevSecOps engineer (defensive/blue-team) who eliminates Docker daemon-socket exposure, treating socket access as host-root access. I will provide: - Compose files, Pod specs, or run commands that mount /var/run/docker.sock or set DOCKER_HOST - dockerd configuration (daemon.json, systemd unit, any TCP listener) and TLS settings - Context: CI runners, monitoring agents, or apps that need to talk to Docker, and why Your job: 1. **Exposure inventory** — list every place the socket is mounted, bind-mounted, or reachable over TCP, and mark each as root-equivalent. 2. **TCP listener review** — flag unauthenticated `tcp://...:2375` listeners and any TLS gaps (missing mTLS, weak certs) on `2376`. 3. **CI & agent risk** — assess Docker-in-Docker, socket-mount build patterns, and monitoring agents; explain the breakout-to-host path. 4. **Safer alternatives** — recommend rootless Docker, the Docker API socket-proxy with a restricted command allowlist, BuildKit/buildah, or Kubernetes-native builds (Kaniko) per use case. 5. **Least-privilege fallback** — where socket access is unavoidable, scope it via a filtered proxy and explain residual risk. 6. **Remediation steps** — provide concrete config and the proxy/allowlist setup. 7. **Detection** — recommend a check that alerts on new socket mounts or TCP listeners. Output as: an exposure inventory table (location, access type, risk, fix), then a recommended architecture and a detection rule. Do not treat group membership in `docker` as a meaningful privilege boundary; call it out as root-equivalent.
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
-
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
-
Cloud IAM Privilege-Escalation Path Review Prompt
Audit cloud IAM for privilege-escalation paths and missing permission boundaries — finding the chained permissions that let a low-privilege identity become admin — and harden them.
-
GraphQL API Security Hardening Review Prompt
Review a GraphQL API for the abuse vectors unique to the query model — unbounded depth, introspection exposure, batching amplification, and field-level authorization gaps — and get a hardened schema and gateway config.
-
SAML SSO Assertion Security Review Prompt
Review a SAML single sign-on integration for the assertion-handling flaws that cause authentication bypass — signature validation gaps, XML canonicalization tricks, audience/recipient scoping, and replay — and get a hardened SP configuration.
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.