Ensure public access is disabled for AWS Elastic Kubernetes Service (EKS) API servers

MEDIUM

Description

Allowing unrestricted, public access to cloud services could open an application up to external attack. Disallowing this access is typically considered best practice.

Remediation

In AWS Console -

  1. Sign in to the AWS Console and go to the Amazon EKS console.
  2. Select the cluster you want.
  3. Under Networking, click Update.
  4. Enable private access for your cluster's Kubernetes API server endpoint if you wish to have this available on your VPC.
  5. Disable public access for your cluster's Kubernetes API server endpoint.

In Terraform -

  1. In the aws_eks_cluster resource, set the vpc_config.endpoint_private_access field to true to enable private access if you wish to have this available on your VPC.
  2. Set the vpc_config.endpoint_public_access field to false to disable public access.

References:
https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster#endpoint_private_access
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster#endpoint_public_access

Policy Details

Rule Reference ID: AC_AWS_0101
CSP: AWS
Remediation Available: Yes
Resource: aws_eks_cluster
Resource Category: Compute

Frameworks