performing-container-escape-detection
하는 일
이 도구는 Kubernetes 클러스터의 컨테이너 설정을 검사해, 컨테이너가 탈출해 호스트 시스템에 접근할 수 있게 하는 보안 결함을 찾습니다. 특권(privileged) 접근이나 민감한 디렉터리 마운트 같은 위험한 설정을 찾습니다.
사용하는 경우
- ✓클러스터에 대해 보안 감사를 수행할 때.
- ✓보안 사고를 조사할 때.
- ✓새 보안 규칙을 적용하기 전에.
스킬 링크
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-container-escape-detection/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“컨테이너가 탈출할 수 있는 설정이 있는지 내 Kubernetes 클러스터를 스캔해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 도구는 Kubernetes Python 라이브러리를 사용해 각 컨테이너의 설정을 검사합니다. 'privileged: true' 같은 위험 신호나, 핵심 시스템 부분에 접근을 허용하는 볼륨 마운트를 찾습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Performing Container Escape Detection
When to Use
- When conducting security assessments that involve performing container escape detection
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Familiarity with container security concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Instructions
Audit Kubernetes pods for container escape vectors including privileged mode, dangerous capabilities, host namespace sharing, and writable hostPath mounts.
from kubernetes import client, config
config.load_kube_config()
v1 = client.CoreV1Api()
pods = v1.list_pod_for_all_namespaces()
for pod in pods.items:
for container in pod.spec.containers:
sc = container.security_context
if sc and sc.privileged:
print(f"PRIVILEGED: {pod.metadata.namespace}/{pod.metadata.name}")
Key escape vectors:
- Privileged containers (full host access)
- CAP_SYS_ADMIN capability
- Host PID/Network/IPC namespace sharing
- Writable hostPath mounts to / or /etc
- Docker socket mount (/var/run/docker.sock)
Examples
# Check for docker socket mounts
for vol in pod.spec.volumes or []:
if vol.host_path and "docker.sock" in (vol.host_path.path or ""):
print(f"Docker socket exposed: {pod.metadata.name}")
자주 묻는 질문
'컨테이너 탈출'이란 무엇인가요?
컨테이너 안에서 실행되는 프로그램이 컨테이너가 실행 중인 서버의 운영체제에 접근하거나 제어하게 되는 것입니다. 원래는 불가능해야 합니다.
'Capabilities'란 무엇인가요?
컨테이너가 가질 수 있는 특별한 권한입니다. CAP_SYS_ADMIN 같은 일부는 매우 강력해서, 잘못 설정하면 위험합니다.
'hostPath 마운트'란 무엇인가요?
서버(호스트)의 디렉터리가 컨테이너와 공유되는 것입니다. '/'나 '/etc' 같은 민감한 디렉터리가 마운트되면, 컨테이너가 서버의 중요한 파일에 접근할 수 있게 됩니다.
상세 정보
작성자의 원본 설명
Audits container and pod configuration for escape-enabling misconfiguration using the Kubernetes Python client - privileged flags, dangerous capability grants, host path mounts, shared namespaces, and CVE-2022-0492 style cgroup abuse. Use when sweeping a cluster for workloads that could break out, producing a posture report, or checking configuration before enforcement is switched on. Keywords: pr
인기도
- GitHub 스타
- 35k
- 순위
- #8207
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 8. 31.
댓글
- …
이 저장소의 다른 스킬
abusing-dpapi-for-credential-access
35kAI 에이전트에게 특정 작업을 위한 준비된 지침을 제공해, 더 잘하고 더 빠르게 처리하도록 합니다.
abusing-shadow-credentials-for-privesc
35kAI 에이전트가 명확하고 잘 구성된 텍스트를 쓰도록 가르칩니다.
achieving-cmmc-level-2-compliance
35kCMMC Level 2 규정 준수를 위한 환경을 준비하도록 돕습니다. 보안 요구 사항을 구현하고 필요한 문서를 관리합니다.
acquiring-disk-image-with-dd-and-dcfldd
35k에이전트가 하드 드라이브의 정확한 복사본을 만들도록 돕습니다. 조사 중 정보가 손실되거나 변경되지 않도록 하는 데 유용합니다.
비슷한 스킬
openclaw-update
394k에이전트가 설치 방식에 맞는 방법을 골라 기존 OpenClaw Gateway를 업데이트하고, 세션이 계속 작동하도록 돕습니다.
diagnose-gateway
394k에이전트가 설정, 채널, 포트를 확인해 OpenClaw Gateway가 왜 실패하는지 찾되, 아무것도 바꾸지 않도록 돕습니다.
crabbox-apps
394k에이전트가 임시 클라우드 머신에서 앱을 열고 실행한 뒤, 그 화면을 채팅의 측면 패널에 보여 주도록 돕습니다.