Overview

FieldValue
ID1020
NameManage ephemeral containers cluster-wide
Risk CategoryElevation of Privilege
Risk LevelCritical
Role TypeClusterRole
API Groupscore
Resourcespods/ephemeralcontainers
Verbsupdate, patch
TagsCodeExecution ElevationOfPrivilege LateralMovement Tampering WorkloadExecution

Description

Permits adding or modifying ephemeral containers in any pod across the cluster. This is highly risky as it allows injecting arbitrary code into running pods, facilitating code execution, lateral movement, tampering with live applications, and privilege escalation.

Abuse Scenarios

  1. Add an ephemeral debug container to a running pod to gain shell access.
kubectl debug -it <pod-name> -n <namespace> --image=busybox --target=<container-name> -- sh
# Example: kubectl debug -it my-app-pod -n default --image=nicolaka/netshoot --target=my-app-container -- sh