Ensure that your Amazon Elastic Kubernetes Service (EKS) clusters are configured with the Kubernetes API server private endpoint enabled and the public endpoint disabled, so that all communication with the API server stays within your Virtual Private Cloud (VPC). Amazon EKS clusters have two API server endpoints: a private endpoint (internal IP behind an internal load balancer in the cluster's VPC network) and a public endpoint (accessible from outside the VPC). By default, the public endpoint is enabled, allowing the Kubernetes API to be accessed from outside the cluster's VPC network. Disabling public access and enabling private access ensures that all Kubernetes API traffic remains within the VPC, significantly reducing the attack surface.
Although the Kubernetes API requires an authorized token to perform sensitive actions, a vulnerability could potentially expose the API publicly with unrestricted access. An attacker may be able to identify the current cluster and Kubernetes API version and determine whether it is vulnerable to an attack. Unless required, disabling the public endpoint helps prevent such threats and requires the attacker to be on the cluster's VPC network to perform any attack on the Kubernetes API. Enabling the private endpoint ensures that nodes communicate with the API server using the private endpoint, keeping all traffic within the VPC.
Audit
To determine if your Amazon EKS clusters are configured with private endpoint access enabled and public endpoint access disabled, perform the following actions:
Remediation / Resolution
To reconfigure your Amazon EKS clusters to enable the private endpoint and disable public endpoint access, perform the following actions:
Note: Disabling public endpoint access means the Kubernetes API server will only be accessible from within the VPC. Ensure that you have configured VPN, AWS Direct Connect, or bastion host access to manage your cluster before disabling public access.References
- AWS Documentation
- Amazon EKS FAQs
- Amazon EKS clusters
- Amazon EKS cluster endpoint access control
- AWS Command Line Interface (CLI) Documentation
- list-clusters
- describe-cluster
- update-cluster-config
- describe-update