Overview

FieldValue
ID1058
NameEvict Pods in a namespace
Risk CategoryDenial of Service
Risk LevelMedium
Role TypeRole
API Groupspolicy
Resourcespods/eviction
Risky Verb Combinations[create]
TagsDenialOfService WorkloadLifecycle

Description

Allows evicting (deleting) pods within a specific namespace using the eviction API. This can disrupt applications running in that namespace, leading to a localized denial of service.

Abuse Scenarios

  1. Evict a specific pod within the namespace by directly calling the eviction API.
bash
# 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" --data '{"apiVersion":"policy/v1","kind":"Eviction","metadata":{"name":"my-app-pod-xyz","namespace":"production"}}' https://127.0.0.1:6443/api/v1/namespaces/production/pods/my-app-pod-xyz/eviction