Free overview · medium · Lesson 1 of 8

Reconnaissance and escaping a Pod

The attacker's path from RCE in a container to the node's admin.conf, and the two manifest lines that open it.

The first lesson of the hardening track: the shop in the cluster has a hole that runs commands inside a Pod. You follow the attacker from the first command to cluster admin rights and close the path with a manifest change.

Threat model

The attacker is outside the cluster and has no Kubernetes permissions. All they have is an HTTP request to the storefront that runs their command in the web container. What happens next depends on the privileges that container runs with.

Attack path

  1. A command through the vulnerable application endpoint.
  2. A look around the container: user, environment variables, ServiceAccount token, capabilities, mounts.
  3. Node files through a privileged container and a volume with the node root.
  4. The admin kubeconfig from the node and API requests with full rights.

Checklist

Practice

A lab on the shared kind cluster of the track: attack.sh gets admin rights through the hole in web, you remove the extra fields from the Deployment, the repeated attack is blocked, and the shop keeps taking orders.

Done reading?

Mark the lesson as read to move your track progress forward.

Practice

Fix a local lab. The agent checks your work and gives hints if you get stuck.

Full access to all labs

$134 $67.00 for one year −50%

One payment, no auto-renewal · Terms

Buy for $67.00