Overview

FieldValue
ID1029
NameManage Roles in a namespace (create, update, patch, delete)
Risk CategoryElevation of Privilege
Risk LevelHigh
Role TypeRole
API Groupsrbac.authorization.k8s.io
Resourcesroles
Risky Verb Combinations[create] · [update] · [patch] · [delete]
TagsPrivilegeEscalation RBACManipulation

Description

Grants permission to create, modify, or delete Roles within a specific namespace. This allows an attacker to define or alter namespaced permissions, potentially granting themselves elevated access to resources within that namespace.

Abuse Scenarios

  1. Create a new Role with full permissions within the namespace.
kubectl create -n <namespace> -f - <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pwned-namespace-admin
rules:
- apiGroups: ["*"]
  resources: ["*"]
  verbs: ["*"]
EOF
# Example: kubectl create -n default -f - <<EOF ... EOF
  1. Delete an existing Role, potentially disrupting application permissions.
kubectl delete role <role-name> -n <namespace>
# Example: kubectl delete role pod-reader -n default