Overview

FieldValue
ID1021
NameManage ephemeral containers in a namespace
Risk CategoryElevation of Privilege
Risk LevelHigh
Role TypeRole
API Groupscore
Resourcespods/ephemeralcontainers
Verbsupdate, patch
TagsCodeExecution LateralMovement PotentialPrivilegeEscalation Tampering WorkloadExecution

Description

Allows adding or modifying ephemeral containers in pods within a specific namespace. This enables injecting code into running pods in that namespace, potentially leading to code execution, lateral movement, tampering, and privilege escalation if sensitive pods are targeted.

Abuse Scenarios

  1. Add an ephemeral debug container to a running pod within the namespace.
kubectl debug -it <pod-name> -n <namespace> --image=busybox --target=<container-name> -- sh
# Example: kubectl debug -it my-db-pod -n production --image=alpine/git --target=db-container -- bash