EKS cluster has private endpoint access enabled
Amazon EKS cluster has private endpoint access enabled for the Kubernetes API server, allowing control plane traffic to use a VPC-resolved private endpoint.
The check evaluates the cluster's endpointPrivateAccess setting.
Risk
Without private endpoint access, the API server is exposed on the public internet. This expands attack surface and weakens confidentiality and integrity: stolen creds or mis-scoped CIDRs can enable unauthorized API calls, secret reads, pod deployments, and config changes. Availability also depends on internet egress, increasing failure modes.
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks eks_cluster_private_nodes_enabledRecommendation
Enable private endpoint access and disable or tightly restrict the public endpoint.
Require administration from private networks, enforce least privilege with IAM/RBAC, and apply defense in depth via segmentation and logging. If external access is needed, allow only specific CIDRs and monitor API activity.
Remediation
CLI
aws eks update-cluster-config --region <REGION> --name <CLUSTER_NAME> --resources-vpc-config endpointPrivateAccess=trueTerraform
# Terraform: Enable private endpoint access for an EKS cluster
resource "aws_eks_cluster" "<example_resource_name>" {
name = "<example_resource_name>"
role_arn = "<example_resource_id>"
vpc_config {
subnet_ids = ["<example_resource_id>"]
endpoint_private_access = true # Critical: enables private API endpoint access to pass the check
}
}NativeIaC
# CloudFormation: Enable private endpoint access for an EKS cluster
Resources:
<example_resource_name>:
Type: AWS::EKS::Cluster
Properties:
RoleArn: <example_resource_id>
ResourcesVpcConfig:
SubnetIds:
- <example_resource_id>
EndpointPrivateAccess: true # Critical: enables private endpoint access to pass the checkOther
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.eks.eks_client import eks_client
class eks_cluster_private_nodes_enabled(Check):
def execute(self):
findings = []
for cluster in eks_client.clusters:
report = Check_Report_AWS(metadata=self.metadata(), resource=cluster)
report.status = "PASS"
report.status_extended = (
f"EKS cluster {cluster.name} is created with private nodes."
)
if not cluster.endpoint_private_access:
report.status = "FAIL"
report.status_extended = f"Cluster endpoint private access is not enabled for EKS cluster {cluster.name}."
findings.append(report)
return findings