Kubernetes 101 : Uncovering insecure ports
Kubernetes · Security
Checking & Securing the Kubernetes API Server
You can quickly check whether the insecure port is open on its default port with a simple curl command — replace <IP> with the host running the API server, or use localhost if you're SSH'd in directly:
curl <IP>:8080
{
"paths": [
"/api",
"/api/v1",
"/apis",
...
]
}
If you get a list of API endpoints back, the insecure port is open. If you see Connection refused — that's the right answer. The port is closed and all traffic goes through TLS.
✅ To further restrict access, set --anonymous-auth=false on the API server.
By default, RBAC only allows limited access for anonymous users (health and discovery checks —
useful for load balancers, but that's about it).
To enable RBAC on the control plane, two things need to be in place:
- Set --authorization-mode on the API server to include the RBAC authorization module.
- Include the Node authorizer in the --authorization-mode list. Combined with the NodeRestriction admission controller, this enables proper RBAC for kubelets.
We'll go deeper into RBAC in a later post — there's a lot to unpack there.