Course contentsShow
← Security
Lesson 1671 of 3,05233. Container SecurityFree lesson

Kubelet Security and Node Hardening

Securing kubelet API, anonymous auth, node authorization, and protecting the node against container escapes.

Kubelet Security and Node Hardening

What you'll learn: How to secure the kubelet component and protect Kubernetes nodes from unauthorized access and container breakout attacks.

What Is the Kubelet and Why Secure It?

The kubelet is the primary node agent running on every Kubernetes worker node. It communicates with the API server to manage containers and exposes its own API for metrics, logs, and pod management. Think of it as the "foreman" on each construction site (node)—if someone compromises the foreman, they control everything happening at that location.

An unsecured kubelet is a critical vulnerability: attackers can execute commands in containers, access secrets, or even compromise the entire node.

Key Kubelet Security Controls

Anonymous Authentication

By default, older kubelets allowed anonymous authentication (requests without credentials). This lets anyone query the kubelet API.

Harden this: Set --anonymous-auth=false to block unauthenticated requests entirely.

Node Authorization

The kubelet should only accept requests from authenticated and authorized sources. Enable Node Authorization mode (--authorization-mode=Webhook) to validate requests against the API server's RBAC policies. This ensures only the API server and authorized service accounts can communicate with the kubelet.

Protecting Against Container Escapes

Even with runtime controls (seccomp, AppArmor), you must harden the node itself:

  • Disable read-only port (--read-only-port=0): This legacy port bypasses authentication entirely
  • Restrict kubelet API access: Use network policies or firewalls to limit which IPs can reach port 10250
  • Enable TLS: Require certificate-based authentication (--client-ca-file) for all kubelet connections
  • Minimize privileged pods: Prevent containers from accessing the host's kubelet certificates or tokens

Key Takeaway: Securing the kubelet with disabled anonymous auth, webhook authorization, and TLS prevents attackers from using the node agent as a pivot point to compromise your entire cluster and underlying infrastructure.