本文へスキップ
Skillpedia
セキュリティ35k · #8254

performing-kubernetes-penetration-testing

できること

このツールは、Kubernetesと呼ばれるシステムのセキュリティをチェックします。攻撃者に悪用されてシステムを乗っ取られる可能性のある弱点を見つけるために、攻撃を模擬的に再現します。

使う場面

  • ✓Kubernetesクラスターに対して、許可を得たうえでセキュリティテストを実施するとき。
  • ✓セキュリティ対策が実際の攻撃に対して有効かどうかを検証するとき。
  • ✓システムの定期的なセキュリティ監査を行うとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-kubernetes-penetration-testing/SKILL.md

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

使い方

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

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-kubernetes-penetration-testing/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のKubernetesクラスターのセキュリティをチェックして、脆弱性がどこにあるか教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

kube-hunterやKubescapeなどの専用ツールを使い、Kubernetesのさまざまな部分に対して攻撃手法を模擬的に試します。目的は、攻撃者がどのようにしてアクセスや制御を得られるかを明らかにすることです。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Performing Kubernetes Penetration Testing

Overview

Kubernetes penetration testing systematically evaluates cluster security by simulating attacker techniques against the API server, kubelet, etcd, pods, RBAC, network policies, and secrets. Using tools like kube-hunter, Kubescape, peirates, and manual kubectl exploitation, testers identify misconfigurations that could lead to cluster compromise.

When to Use

  • When conducting security assessments that involve performing kubernetes penetration testing
  • 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

  • Authorized penetration testing engagement
  • Kubernetes cluster access (various levels for different test scenarios)
  • kube-hunter, kubescape, kube-bench installed
  • kubectl configured
  • Network access to cluster components

Core Concepts

Kubernetes Attack Surface

Component Port Attack Vectors
API Server 6443 Auth bypass, RBAC abuse, anonymous access
Kubelet 10250/10255 Unauthenticated access, command execution
etcd 2379/2380 Unauthenticated read, secret extraction
Dashboard 8443 Default credentials, token theft
NodePort Services 30000-32767 Service exposure, application exploits
CoreDNS 53 DNS spoofing, zone transfer

MITRE ATT&CK for Kubernetes

Phase Techniques
Initial Access Exposed Dashboard, Kubeconfig theft, Application exploit
Execution exec into container, CronJob, deploy privileged pod
Persistence Backdoor container, mutating webhook, static pod
Privilege Escalation Privileged container, node access, RBAC abuse
Defense Evasion Pod name mimicry, namespace hiding, log deletion
Credential Access Secret extraction, service account token theft
Lateral Movement Container escape, cluster internal services

Workflow

Step 1: External Reconnaissance

# Discover Kubernetes services
nmap -sV -p 443,6443,8443,2379,10250,10255,30000-32767 target-cluster.com

# Check for exposed API server
curl -k https://target-cluster.com:6443/api
curl -k https://target-cluster.com:6443/version

# Check anonymous authentication
curl -k https://target-cluster.com:6443/api/v1/namespaces

# Check for exposed kubelet
curl -k https://node-ip:10250/pods
curl http://node-ip:10255/pods  # Read-only kubelet

Step 2: Automated Scanning with kube-hunter

# Install kube-hunter
pip install kube-hunter

# Remote scan
kube-hunter --remote target-cluster.com

# Internal network scan (from within cluster)
kube-hunter --internal

# Pod scan (from within a pod)
kube-hunter --pod

# Generate report
kube-hunter --remote target-cluster.com --report json --log output.json

Step 3: CIS Benchmark Assessment with kube-bench

# Run kube-bench on master node
kube-bench run --targets master

# Run on worker node
kube-bench run --targets node

# Check specific sections
kube-bench run --targets master --check 1.2.1,1.2.2,1.2.3

# JSON output
kube-bench run --json > kube-bench-results.json

# Run as Kubernetes job
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml
kubectl logs -l app=kube-bench

Step 4: Framework Compliance with Kubescape

# Install kubescape
curl -s https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash

# Scan against NSA/CISA hardening guide
kubescape scan framework nsa

# Scan against MITRE ATT&CK
kubescape scan framework mitre

# Scan against CIS Kubernetes Benchmark
kubescape scan framework cis-v1.23-t1.0.1

# Scan specific namespace
kubescape scan framework nsa --namespace production

# JSON output
kubescape scan framework nsa --format json --output kubescape-report.json

Step 5: RBAC Exploitation Testing

# Check current permissions
kubectl auth can-i --list

# Check specific high-value permissions
kubectl auth can-i create pods
kubectl auth can-i create pods --subresource=exec
kubectl auth can-i get secrets
kubectl auth can-i create clusterrolebindings
kubectl auth can-i '*' '*'  # cluster-admin check

# Enumerate service account tokens
kubectl get serviceaccounts -A

…
よくある質問

Kubernetesとは何ですか?

Kubernetesは、多数のコンピューター上で同時に動作するアプリケーションを管理・整理し、正常に動き続けて常に利用できるように支えるシステムです。

ペネトレーションテストとは何ですか?

悪意のある攻撃者より先に脆弱性を見つけて修正するために、専門家が許可を得たうえでシステムへの侵入を試みるセキュリティテストです。

このツールを使うには技術的な知識が必要ですか?

はい。このツールは、Kubernetesとペネトレーションテストをすでに理解しているセキュリティの専門家向けです。

詳細

作者による元の説明

Evaluates Kubernetes cluster security by actively simulating attacker techniques against the API server, kubelet, etcd, pods, RBAC, network policy, and secrets, using kube-hunter, Kubescape, peirates, and manual kubectl exploitation to find paths to cluster compromise. Use for an authorized penetration test or hands-on validation that controls actually stop an attacker. Keywords: kube-hunter, Kube

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8254
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

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

コメント

  • …

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

似ているスキル