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がスキルを読んで指示に従います。
貼り付け用メッセージ
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
35k特定のタスク向けに用意された指示をAIエージェントに与え、より良く、より速く作業できるようにします。
abusing-shadow-credentials-for-privesc
35kAIエージェントに、明確で構成のしっかりした文章の書き方を教えます。
achieving-cmmc-level-2-compliance
35kエージェントがCMMC Level 2への準拠に向けた環境を整えられるようにします。セキュリティ要件を実装し、必要なドキュメントを管理します。
acquiring-disk-image-with-dd-and-dcfldd
35kエージェントがハードディスクの完全なコピーを作成できるようにします。調査中に情報が失われたり改変されたりしないようにするのに役立ちます。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。