Common attacks and weaknesses
- Anonymous access or overly broad RBAC giving cluster control.
- Leaked kubeconfig files and service account tokens.
Kubernetes API server.
Commands sent to port 6443 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.
| Service | Port | Transport | Description | Reference | Updated |
|---|---|---|---|---|---|
| sun-sr-https | 6443 | TCP, UDP | Service Registry Default HTTPS Domain | - | 2006-03 |
// source: IANA service name and port number registry
Linux
sudo ss -ltnup 'sport = :6443' # process listening on 6443
sudo lsof -nP -i :6443macOS
sudo lsof -nP -i :6443
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 6443 -State Listen | Select LocalAddress, OwningProcess Get-NetUDPEndpoint -LocalPort 6443 netstat -ano | findstr :6443
From another machine
nmap -p 6443 -sV <host> sudo nmap -sU -p 6443 <host> nc -zv <host> 6443
Block it in the firewall
sudo ufw deny 6443/tcp # Linux (ufw) New-NetFirewallRule -DisplayName "Block 6443" -Direction Inbound -LocalPort 6443 -Protocol TCP -Action Block # Windows
Kubernetes API server.
Port 6443 is registered for TCP and UDP. In practice the service mostly uses TCP.
It is rated 7/10 (high) when exposed to the Internet. Anonymous access or overly broad RBAC giving cluster control. Disable anonymous auth and audit RBAC.
On Linux run "ss -ltnup 'sport = :6443'", on macOS "lsof -nP -i :6443", and on Windows "netstat -ano | findstr :6443" to see the local process. From another machine, "nmap -p 6443 <host>" shows whether it is reachable.