Overview

FieldValue
ID1057
NameEvict Pods cluster-wide
Risk CategoryDenial of Service
Risk LevelMedium
Role TypeClusterRole
API Groupspolicy
Resourcespods/eviction
Verbscreate
TagsDenialOfService WorkloadLifecycle

Description

Permits evicting (deleting) pods across all namespaces using the eviction API. This can be used to cause denial of service by disrupting running applications throughout the cluster.

Abuse Scenarios

  1. Evict all pods from a specific node, causing disruption.
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
# Example: kubectl drain minikube --ignore-daemonsets --delete-emptydir-data
  1. Evict a specific pod by directly calling the eviction API.
# Replace <kubernetes-api-server> with your API server address
# Replace <token> with your authentication token
curl -k -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -X POST \
  --data '{"apiVersion":"policy/v1","kind":"Eviction","metadata":{"name":"<pod-name>","namespace":"<namespace>"}}' \
  https://<kubernetes-api-server>/api/v1/namespaces/<namespace>/pods/<pod-name>/eviction
# Example: curl -k -H "Authorization: Bearer $(cat ~/.kube/config | grep token: | awk '{print $2}')" -H "Content-Type: application/json" -X POST --data '{"apiVersion":"policy/v1","kind":"Eviction","metadata":{"name":"my-app-pod-xyz","namespace":"default"}}' https://127.0.0.1:6443/api/v1/namespaces/default/pods/my-app-pod-xyz/eviction