Kubernetes Architecture and Attack Surface
You'll learn how Kubernetes's distributed architecture creates multiple entry points that attackers can exploit if components aren't properly secured.
Understanding Kubernetes Components
Kubernetes orchestrates containers across a cluster of machines, but this coordination requires several critical components working together:
Control Plane Components
API Server - The central management hub that handles all API requests. It's the gateway for kubectl commands, automation tools, and internal components. Risk: If compromised, an attacker controls the entire cluster.
etcd - A distributed key-value store holding all cluster state and secrets (credentials, configurations). Think of it as Kubernetes's memory. Risk: Direct access means reading sensitive data and manipulating cluster state.
Scheduler - Decides which worker nodes run which containers based on resource availability and policies. Risk: A malicious scheduler could place workloads on compromised nodes or trigger resource exhaustion.
Controller Manager - Runs background processes that maintain desired cluster state (restarting failed pods, managing deployments). Risk: Compromised controllers can disrupt operations or deploy malicious workloads.
Node Components
kubelet - An agent on each worker node that ensures containers are running as specified. It communicates directly with the API server. Risk: If compromised, an attacker gains node-level access and can manipulate containers.
The Attack Surface
Each component exposes network endpoints, often with powerful privileges. Without proper authentication, authorization (RBAC), and network policies, attackers can:
- Access the API server anonymously
- Read secrets directly from etcd
- Manipulate kubelet APIs to execute commands inside containers
- Exploit inter-component communication channels
Key Takeaway: Kubernetes's distributed architecture means security failures in any single component—API server, etcd, kubelet, scheduler, or controllers—can compromise your entire container environment, making defense-in-depth essential.