Common attacks and weaknesses
- Anonymous kubelet access allows command execution in any pod on the node.
Kubelet API on every Kubernetes node.
Commands sent to port 10250 create and control containers or cluster resources on the host. Everything is encrypted: someone on the path only sees unreadable bytes.
Unofficial use. The IANA assignment below differs from what is usually found on this port in practice.
No entry. The port is free for any application, so check what uses it on your hosts.
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :10250' # process listening on 10250
sudo lsof -nP -i :10250macOS
sudo lsof -nP -i :10250
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 10250 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 10250 netstat -ano | findstr :10250
From another machine
nmap -p 10250 -sV <host> nc -zv <host> 10250
Block it in the firewall
sudo ufw deny 10250/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 10250" -Direction Inbound -LocalPort 10250 -Protocol TCP -Action Block # Windows
Kubelet API on every Kubernetes node.
Port 10250 is registered for TCP.
It is rated 9/10 (critical) when exposed to the Internet. Anonymous kubelet access allows command execution in any pod on the node. Set --anonymous-auth=false and --authorization-mode=Webhook.
On Linux run "ss -ltnup 'sport = :10250'", on macOS "lsof -nP -i :10250", and on Windows "netstat -ano | findstr :10250" to see the local process. From another machine, "nmap -p 10250 <host>" shows whether it is reachable.