Free overview · hard · Lesson 2 of 8

RBAC through the attacker's eyes

What an attacker does with a ServiceAccount token: other ServiceAccounts through create pods, bind, impersonate, and a Secret leak through the aggregated view role.

The second lesson of the hardening track. The attacker already runs commands in the web Pod, and every Pod holds the token of its ServiceAccount. The lesson shows what that token turns into when the role was granted "just in case", and how to find it before the attacker does.

Threat model

The attacker has the application's ServiceAccount token and the cluster API address. The token has no direct permission to read Secrets. The attacker looks for bypass paths: create an object that runs under a stronger ServiceAccount, grant themselves permissions, or act under someone else's name.

Attack paths

  1. A Pod under someone else's ServiceAccount in the same namespace, with the result read from the log.
  2. A RoleBinding to someone else's ClusterRole with the bind verb.
  3. Requests in the name of another ServiceAccount with the impersonate verb.
  4. Secrets through the built-in view role, into which a third-party chart mixed its own role.

Checklist

Practice

Two labs on the shared cluster of the track. In the first, the stolen web token creates a Pod under the backup ServiceAccount and reads every Secret in the cluster. In the second, the token has three bypass paths, and you need to close all of them without breaking the shop's status page.

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