Is port 6443 (Kubernetes API server) exposed to the internet?
Port 6443 is the default port of the Kubernetes API server, the single endpoint that controls every workload, secret and node in a cluster. AdminKit's port check does not test 6443, so this guide shows how to test your own cluster from outside, what anonymous access allows, and how to restrict it.
By AdminKit team, Netbase JSC · Updated
Key takeaways
- Port 6443 is the default HTTPS port of the Kubernetes API server. Every
kubectlcommand, controller and node talks to the cluster through it. - Anonymous requests are on by default. With RBAC, the anonymous user gets only discovery and non-sensitive information, unless someone has bound more rights to it.
- One mistaken binding, such as
cluster-adminforsystem:unauthenticated, turns a reachable 6443 into full control of the cluster. - AdminKit’s port check does not test 6443. Test it manually from outside your network, then restrict the endpoint to the networks that need it.
What runs on port 6443?
The API server, kube-apiserver, is the front end of the Kubernetes control plane. The Kubernetes ports and protocols reference lists TCP 6443 as the Kubernetes API server port, used by “All”: nodes, controllers, administrators and automation. The kube-apiserver reference documents the flag behind it, --secure-port, with a default of 6443, as the port on which to serve HTTPS with authentication and authorization.
The same documentation set says where it listens. Controlling Access to the Kubernetes API states that by default the API server listens on port 6443 on the first non-localhost network interface, protected by TLS, and that in a typical production cluster the API serves on port 443 instead. The bind address is set with --bind-address. In other words, a control-plane host with a public interface listens on that public interface unless someone decides otherwise.
The control plane uses other ports too, and they matter for the same reason:
| Port | Component | Who should reach it |
|---|---|---|
| 6443 | Kubernetes API server | Nodes, administrators, CI, from trusted networks only |
| 2379-2380 | etcd server client API | The API server and etcd peers only |
| 10250 | Kubelet API (every node) | The control plane only |
| 10257, 10259 | kube-controller-manager, kube-scheduler | Localhost only |
| 30000-32767 | NodePort Services | Whatever those Services are meant to serve |
Why is an exposed API server a risk?
The API server is the cluster. Anyone who can create a pod there can choose its image, its mounts and its service account. The RBAC good practices page lists rights that let a user escalate, including creating workloads, reading Secrets, and the escalate, bind and impersonate verbs. It also warns that a workload able to mount the host filesystem has many ways to escalate privileges on that node.
So the question for an exposed 6443 is what an unknown caller can do. That depends on two layers: whether the request is accepted as some user at all (authentication), and what that user may do (authorization). Kubernetes is safe by default on the second layer and permissive on the first, which is why a reachable endpoint is not automatically a breach but is always one configuration mistake away from one.
What can an anonymous request do?
Kubernetes accepts unauthenticated requests by default. The authentication documentation says that requests not rejected by another authentication method are treated as anonymous requests, with the username system:anonymous and the group system:unauthenticated. Anonymous access is enabled by default when an authorization mode other than AlwaysAllow is used, and you can turn it off with --anonymous-auth=false.
What the anonymous user gets is then up to authorization. The RBAC documentation describes the default API discovery roles: system:public-info-viewer is bound to both authenticated and unauthenticated users and allows read-only access to non-sensitive information about the cluster. The same page notes that before Kubernetes v1.14, system:basic-user and system:discovery were also bound to system:unauthenticated by default, so very old clusters, and clusters upgraded from them with the old bindings kept, give anonymous callers more.
Recent releases let you narrow anonymous access further. The authentication page describes an anonymous section in the authentication configuration file, stable since v1.34, that can enable anonymous requests only for the health endpoints /livez, /readyz and /healthz. Any other endpoint is then unreachable anonymously, even if an RBAC rule would allow it.
How does a reachable 6443 turn into a compromise?
The usual path is not a software flaw but a binding. The RBAC good practices page tells administrators to review bindings for the system:unauthenticated group and remove them where possible, because such a binding “gives access to anyone who can contact the API server at a network level.” The RBAC page itself shows, under a heading marked strongly discouraged, a command that grants cluster-admin to all service accounts, and warns that this gives any user with read access to Secrets, or the ability to create any pod, full access to the cluster.
Copying a “make it work” binding from a tutorial is how these end up in real clusters. A binding that grants cluster-admin, or any broad role, to system:anonymous or system:unauthenticated means that every caller who reaches 6443 is a cluster administrator. From there they can read every Secret, run a privileged pod on any node and persist inside the cluster.
Leaked credentials are the second path. A kubeconfig file with a long-lived token or client certificate, committed to a repository or left on a laptop, works from anywhere the API server is reachable. Restricting 6443 to known networks does not fix the leak, but it makes the stolen credential useless from the rest of the internet.
Is my managed cluster’s API endpoint public?
Often, yes. The OWASP Kubernetes Security Cheat Sheet states that, unless you restrict it, the control plane is reachable from the internet on EKS, AKS and GKE. It summarizes each provider’s default: the EKS API server endpoint is public by default, the AKS API server gets a public IP address by default, and the GKE DNS-based endpoint is reachable from the public internet by default and controlled by IAM. For each it names the restriction to apply: a private endpoint or trusted CIDRs on EKS, a private cluster or authorized IP ranges on AKS, and IAM plus VPC Service Controls or authorized networks on GKE.
The providers’ own documentation says the same. The Amazon EKS user guide states that by default the API server endpoint is public to the internet, with access secured by a combination of AWS IAM and Kubernetes RBAC. Microsoft’s AKS page on authorized IP ranges states that AKS assigns the API server a public IP address by default, and describes how to limit it to the address ranges you list.
The OWASP section adds a point that is easy to miss: network controls limit who can reach the API server, but authentication and RBAC still decide what they can do. On GKE, it notes, IAM permissions alone are enough to work with cluster resources, so the review has to cover cloud IAM as well as RBAC.
How do you check your own exposure?
AdminKit’s open ports check tests nine TCP ports on the public IP you connect from, and 6443 is not on that list. For a self-managed cluster, find the address the API server is published on: the server: line in your kubeconfig, or the control-plane host’s public IP, which what is my IP shows if you run it from that host. Then test from a machine outside your network. The address below is from the documentation range; use your own:
curl -sk --max-time 5 https://203.0.113.5:6443/version
curl -sk --max-time 5 https://203.0.113.5:6443/api/v1/namespaces
-k skips certificate checks because the cluster CA is not in your system store. Read the replies like this:
| Reply | What it means |
|---|---|
| Connection refused or timeout | Nothing answered on 6443 from where you tested. Try 443 too, in case the API is served there. |
A JSON reply from /version with a gitVersion field | The API server is reachable and answers anonymous discovery requests. Reachability is the finding: restrict the network. |
401 Unauthorized JSON | Reachable, and anonymous requests are switched off. Credentials still work from anywhere. |
403 Forbidden JSON naming system:anonymous | Reachable, anonymous requests are on, and RBAC refused this one. |
| A list of namespaces from the second command | Anonymous callers can read cluster resources. Treat this as an incident. |
Only test clusters you own or are authorized to test.
How do you confirm the settings inside the cluster?
With admin credentials, ask the API server what the anonymous user may do, and look for bindings to the anonymous identities:
kubectl auth can-i --list --as=system:anonymous --as-group=system:unauthenticated
kubectl get clusterrolebindings,rolebindings -A -o wide | grep -E 'system:(anonymous|unauthenticated)'
The first command should list only discovery and health paths. The second should show only the default system:public-info-viewer binding and nothing you added. On a kubeadm control plane, the static pod manifest for the API server holds its flags; check --anonymous-auth, --authorization-mode (which should include Node,RBAC and never AlwaysAllow), --bind-address and --secure-port.
Check the kubelets as well. The kubelet authentication and authorization page explains that the kubelet’s HTTPS endpoint on port 10250 also accepts anonymous requests unless it is started with --anonymous-auth=false, and that its authorization can be delegated to the API server. The OWASP cheat sheet adds that kubelets allow unauthenticated access to this API by default and that production clusters should enable kubelet authentication and authorization.
How do you fix an exposed API server?
- Restrict the endpoint by network. Allow 6443 only from your nodes, your administrators’ VPN or bastion range and your CI runners. On a managed service, use its private endpoint or authorized-network setting described above.
- Remove bindings for anonymous identities. Delete any binding to
system:anonymousorsystem:unauthenticatedbeyond the defaults, and never grantcluster-adminto a group. - Turn anonymous access off or narrow it. Use
--anonymous-auth=false, or the authentication configuration file to allow anonymous requests only on health endpoints, after checking that your load balancer health checks still pass. - Keep RBAC tight. Follow the RBAC good practices page: least privilege, namespace-scoped roles, no wildcards, nobody in
system:mastersand periodic review of who holds escalation verbs. - Lock down the other control-plane ports. etcd on 2379-2380 should accept only the API server, and the kubelet API on 10250 should accept only the control plane, with anonymous access off.
- Rotate exposed credentials. If a kubeconfig, token or client certificate may have leaked while 6443 was public, revoke and reissue it, then review the API server audit log for requests you cannot explain.
Does the same question apply to other container ports?
Yes. The Docker Engine API on port 2375 is the single-host version of the same problem: a management API that grants root-level control to whoever reaches it, safe only behind authentication and a network boundary. Web dashboards for clusters and containers often sit on port 8080 and other admin ports, and the OWASP cheat sheet advises against exposing the Kubernetes dashboard to the public without additional authentication.
Which servers may you test with these checks?
Every check this page links to is for assets you own or are explicitly authorized to test. Never scan, probe, or attempt to connect to a network or device you don’t control. AdminKit’s active checks only ever run against the IP making the request or an asset you’ve verified ownership of. See our Disclaimer and Acceptable Use Policy for the full terms.
This guide is part of AdminKit’s machine protocols cluster, which covers management APIs and network services that are safe only when their exposure is deliberate.
This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.
Frequently asked questions
Is it normal for port 6443 to be reachable?
It has to be reachable from the nodes, from the people who run kubectl and from your CI system. It does not have to be reachable from the whole internet. The Kubernetes ports reference lists 6443 as the API server port for all clients, and the OWASP Kubernetes Security Cheat Sheet advises limiting access to the API server to trusted networks.
Does the API server allow anonymous requests?
By default, yes. The kube-apiserver reference documents --anonymous-auth with a default of true: requests that no other authenticator rejects are treated as the user system:anonymous in the group system:unauthenticated. What that user can do is decided by authorization, normally RBAC, and the default RBAC bindings give it read access only to API discovery and non-sensitive cluster information.
Does AdminKit's port check scan port 6443?
No. The port check tests a fixed list of nine TCP ports (23, 554, 1883, 8883, 502, 7547, 80, 443, 8080) on the public IP you connect from. Test 6443 manually from a machine outside your network with the curl command in this guide, and only against clusters you own or are authorized to test.
My cloud provider runs the control plane. Is 6443 still my problem?
Yes. A managed service runs the API server for you, but you choose who can reach its endpoint. The OWASP cheat sheet notes that unless you restrict it, the control plane is reachable from the internet on EKS, AKS and GKE, and describes each provider's private-endpoint or authorized-network option.
Is moving the API server to port 443 safer?
No. The Kubernetes documentation notes that production clusters often serve the API on 443, either by changing --secure-port or by placing a load balancer on 443 in front of 6443. The port number changes nothing about who can connect. Authentication, RBAC and network restrictions are what protect the API.
Sources
- Kubernetes Docs — Controlling Access to the Kubernetes API (transport security, port 6443)
- Kubernetes Docs — Ports and Protocols
- Kubernetes Docs — kube-apiserver command line reference (--secure-port, --anonymous-auth)
- Kubernetes Docs — Authenticating (anonymous requests)
- Kubernetes Docs — Using RBAC Authorization (default roles and bindings)
- Kubernetes Docs — Role Based Access Control Good Practices
- Kubernetes Docs — Kubelet authentication/authorization
- OWASP Cheat Sheet Series — Kubernetes Security Cheat Sheet
- Amazon EKS User Guide — Control network access to cluster API server endpoint
- Microsoft Learn — Secure access to the API server using authorized IP address ranges in AKS
Want AdminKit to watch this for you?
Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.
Talk to an expert
Huy Nguyen (David), Founder & CEO, Netbase JSC
Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.