How to lock down a Kubernetes cluster
Most Kubernetes compromises come from a handful of defaults. These steps close the ones that lead to cluster takeover.
Steps
- Restrict the API server to known networks or a private endpoint; disable anonymous auth.
- Don't expose the Dashboard publicly, and don't bind it to cluster-admin.
- Enforce the 'restricted' Pod Security Standard so pods can't run privileged or as root.
- Add a default-deny NetworkPolicy per namespace, then allow only the flows each service needs.
How to verify
- The API endpoint isn't reachable from the public internet.
- kubectl get networkpolicy -A shows a policy in each workload namespace.
FAQ
- Where do I start if I can only do one thing?
- Get the API server off the public internet. It's the control plane — everything else follows from protecting it.
Have SkyShield check this for you
SkyShield finds this across every server and cloud account and shows the fix in plain words. Free for one server, then from $49 per server a month. Start free.