본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)35k · #8207

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-container-escape-detection/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. Privileged containers (full host access)
  2. CAP_SYS_ADMIN capability
  3. Host PID/Network/IPC namespace sharing
  4. Writable hostPath mounts to / or /etc
  5. 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

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#8207
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬