Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)35k · #8207

performing-container-escape-detection

Skill này làm gì

Công cụ này kiểm tra cấu hình container trong cụm Kubernetes để tìm lỗi bảo mật có thể cho phép container “thoát” và truy cập hệ thống máy chủ. Nó tìm các thiết lập rủi ro như quyền đặc biệt (privileged) hoặc gắn kết thư mục nhạy cảm.

Khi nào nên dùng

  • ✓Khi thực hiện đánh giá bảo mật một cụm.
  • ✓Khi điều tra một sự cố bảo mật.
  • ✓Khi chuẩn bị bật các quy tắc bảo mật mới.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-container-escape-detection/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-container-escape-detection/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Quét cụm Kubernetes của tôi để tìm cấu hình container cho phép thoát khỏi container.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng thư viện Python của Kubernetes để kiểm tra thiết lập của từng container. Nó tìm các dấu hiệu cảnh báo như “privileged: true” hoặc các volume mount cho phép truy cập vào phần quan trọng của hệ thống.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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}")
Câu hỏi thường gặp

Container escape là gì?

Đó là khi một chương trình chạy trong container có thể truy cập hoặc điều khiển hệ điều hành của máy chủ đang chạy container, điều vốn không được phép xảy ra.

Capability là gì?

Đây là các quyền đặc biệt mà container có thể được cấp. Một số, như CAP_SYS_ADMIN, rất mạnh và có thể nguy hiểm nếu cấu hình sai.

hostPath mount là gì?

Đó là khi một thư mục trên máy chủ (host) được chia sẻ với container. Nếu thư mục nhạy cảm như “/” hoặc “/etc” bị gắn kết, container có thể truy cập các tệp quan trọng của máy chủ.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8207
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự