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

auditing-kubernetes-rbac-privilege-escalation

できること

このツールは、Kubernetesクラスターのアクセス権限を確認して、危険なセキュリティ設定を見つけます。ユーザーやサービスが、意図された以上の権限を得てしまう方法を探します。たとえばクラスター管理者になってしまうケースなどです。

使う場面

  • ✓Kubernetesクラスターのセキュリティを見直すとき。
  • ✓あるサービスが侵害された後、そのサービスが他に何にアクセスできるかを確認したいとき。
  • ✓変更を加えた後も、権限が必要最小限に保たれているかを確認するため。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/auditing-kubernetes-rbac-privilege-escalation/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“私のKubernetesクラスターで、権限昇格につながる権限がないか確認してください。”

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

仕組み

このツールは特定のKubernetesコマンドを使って、誰が何をできるかを分析します。単体では問題がなくても、組み合わせるとクラスター全体を制御できてしまう権限の組み合わせを探します。

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

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

Auditing Kubernetes RBAC Privilege Escalation

Legal Notice: This skill is for authorized security testing and educational purposes only. Enumerating and exercising RBAC permissions affects a live cluster's access posture. Only test clusters you own or are explicitly authorized in writing to assess.

Overview

Kubernetes Role-Based Access Control (RBAC, MITRE ATT&CK T1078 Valid Accounts) governs what every user and service account may do via Role/ClusterRole rules bound by RoleBinding/ClusterRoleBinding. Because workloads run with a mounted service-account token by default, an attacker who compromises one pod inherits that account's RBAC rights. Over-permissive bindings turn a single compromised pod into a cluster takeover: certain verbs and resources are "RBAC-equivalent to cluster-admin."

Per the Kubernetes "RBAC Good Practices" guidance and Unit 42 research, the dangerous primitives are:

  • escalate on roles — grant yourself any permission, even ones you do not hold.
  • bind on clusterroles — create a binding to cluster-admin.
  • impersonate on users/groups/serviceaccounts — act as any subject including system:masters.
  • create/update/patch on pods — schedule a privileged pod or mount the node, escaping to the host (T1611).
  • create on pods/exec, pods/attach, pods/ephemeralcontainers — run code in any existing pod.
  • get/list/watch on secrets — list returns full secret contents, including other service-account tokens.
  • create on serviceaccounts/token — mint tokens for more privileged accounts.
  • update/patch on validatingwebhookconfigurations/mutatingwebhookconfigurations, nodes/proxy, certificatesigningrequests/approval — admission/CSR abuse to cluster-admin.
  • Wildcards (verbs: ["*"], resources: ["*"]) — implicit super-privilege.

This skill systematically enumerates effective permissions for every subject, maps which subjects hold these escalation primitives, and produces remediation evidence. Source: Kubernetes RBAC Good Practices; Unit 42 Kubernetes RBAC research.

When to Use

  • During an authorized Kubernetes security assessment or cluster penetration test
  • After compromising a pod, to determine what its service-account token can reach
  • When reviewing RBAC drift before a production go-live
  • When validating least-privilege after a platform migration or Helm rollout

Prerequisites

  • kubectl configured against the target cluster (your own credentials, or a captured service-account token)
  • Read access to RBAC objects (most audits run with a cluster-reader or admin context)
  • Audit tooling:
    # rbac-police - find escalation paths (Cymulate)
    curl -L https://github.com/PaloAltoNetworks/rbac-police/releases/latest/download/rbac-police-linux-amd64 -o rbac-police
    chmod +x rbac-police
    
    # kubectl-who-can - which subjects can perform an action (Aqua)
    kubectl krew install who-can
    
    # rakkess - access matrix of resources x verbs for the current/another subject
    kubectl krew install access-matrix
    
    # rbac-lookup - which roles a subject has (FairwindsOps)
    kubectl krew install rbac-lookup
    

Objectives

  • Inventory all Role, ClusterRole, RoleBinding, and ClusterRoleBinding objects
  • Enumerate effective permissions per subject using kubectl auth can-i --as
  • Identify subjects holding RBAC-equivalent-to-admin primitives
  • Trace token-mounting pods to over-privileged service accounts
  • Demonstrate (in a lab) one escalation path end-to-end
  • Output a prioritized findings report with least-privilege remediation

MITRE ATT&CK Mapping

Technique ID Name Tactic
T1078 Valid Accounts Defense Evasion / Persistence / Privilege Escalation
T1098 Account Manipulation Persistence
T1528 Steal Application Access Token Credential Access
T1613 Container and Resource Discovery Discovery
T1611 Escape to Host Privilege Escalation

Workflow

Step 1: Inventory RBAC Objects

# All roles and bindings, cluster-wide
kubectl get clusterroles,clusterrolebindings -o wide
kubectl get roles,rolebindings --all-namespaces -o wide

# Dump full RBAC for offline analysis
kubectl get clusterroles,clusterrolebindings,roles,rolebindings \
  --all-namespaces -o yaml > rbac-dump.yaml

# Who is bound to cluster-admin?
kubectl get clusterrolebindings -o json | \

…
よくある質問

RBACとは何ですか?

RBAC(ロールベースのアクセス制御)は、ロールと権限に基づいて、Kubernetes内で誰が何をできるかを定義する仕組みです。

「権限昇格」とはどういう意味ですか?

権限の限られたユーザーやサービスが、より大きな権限を手に入れてしまうことです。最終的にはシステム全体を制御されてしまう可能性があります。

権限が広すぎると、なぜ危険なのですか?

攻撃者が広い権限を持つアカウントを乗っ取ると、クラスター全体を制御したり、機密データにアクセスしたり、被害を与えたりできてしまうためです。

詳細

作者による元の説明

Finds over-permissive RBAC roles and service-account token abuse paths in a Kubernetes cluster using kubectl auth can-i, rbac-police, kubectl-who-can, and rakkess, tracing which subjects can escalate toward cluster-admin. Use when reviewing who can escalate privileges in a cluster, hunting exploitable RoleBindings during an authorized review, or validating least privilege after an RBAC change. Key

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

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

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

0

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

コメント

  • …

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

似ているスキル