本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)35k · #8207

performing-container-escape-detection

できること

このツールは、Kubernetesクラスターのコンテナ設定を確認し、コンテナが「エスケープ」してホストシステムにアクセスできてしまうセキュリティ上の欠陥を探します。特権アクセスや重要なディレクトリのマウントなど、危険な設定を検出します。

使う場面

  • ✓クラスターのセキュリティ監査を行うとき。
  • ✓セキュリティインシデントを調査するとき。
  • ✓新しいセキュリティルールを有効にする前。

スキルのリンク

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

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-container-escape-detection/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に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

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル