मुख्य सामग्री पर जाएँ
Skillpedia
डिप्लॉय और क्लाउड (DevOps)35k · #7682

auditing-kubernetes-rbac-privilege-escalation

यह क्या करती है

यह टूल Kubernetes क्लस्टर में access permissions की जाँच करता है ताकि खतरनाक security configurations मिल सकें। यह देखता है कि कोई user या service अपने तय अधिकारों से ज़्यादा privileges कैसे हासिल कर सकता है, जैसे cluster administrator बन जाना।

कब इस्तेमाल करें

  • ✓Kubernetes क्लस्टर की security की समीक्षा करते समय।
  • ✓किसी service में सेंध लगने के बाद यह देखने के लिए कि वह और किन चीज़ों तक पहुँच सकती है।
  • ✓बदलाव करने के बाद यह पक्का करने के लिए कि permissions ज़रूरत भर के ही हैं।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/auditing-kubernetes-rbac-privilege-escalation/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे Kubernetes क्लस्टर में privilege escalation वाली permissions की जाँच करो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

टूल Kubernetes की खास commands इस्तेमाल करके विश्लेषण करता है कि कौन क्या करने की अनुमति रखता है। यह permissions के ऐसे combinations ढूँढता है जो मिलकर किसी को पूरे क्लस्टर पर नियंत्रण दे सकते हैं।

तकनीकी सामग्री (मूल 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 (Role-Based Access Control) एक ऐसा system है जो roles और permissions के आधार पर तय करता है कि Kubernetes में कौन क्या कर सकता है।

'privilege escalation' का क्या मतलब है?

जब कोई user या service सीमित permissions के साथ भी ज़्यादा permissions हासिल कर लेता है, जिससे पूरे system पर नियंत्रण तक जा सकता है।

बहुत ज़्यादा व्यापक permissions खतरनाक क्यों हैं?

अगर हमलावर के हाथ ऐसा account लग जाए जिसके पास व्यापक permissions हों, तो वह पूरे क्लस्टर को नियंत्रित कर सकता है, संवेदनशील data तक पहुँच सकता है या नुकसान पहुँचा सकता है।

जानकारी

लेखक का मूल विवरण

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
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills