Skip to main content

More Info:

Disable public IP addresses for cluster nodes, so that they only have private IP addresses. Private Nodes are nodes with no public IP addresses.

Risk Level

Low

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • AWS Startup Security Baseline
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CIS EKS
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Manual Steps

  1. Review current EKS cluster endpoint and node networking configuration
    • Run on any machine with AWS CLI access:
    • Inspect .cluster.resourcesVpcConfig:
      • endpointPublicAccess
      • publicAccessCidrs
      • endpointPrivateAccess
      • subnetIds (to verify they are private subnets for nodes)
  2. Confirm whether worker nodes are using public IPs
    • Get the nodegroup names:
    • For each nodegroup:
    • Check .resourcesVpcConfig.subnets and then inspect those subnets:
    • Confirm they are private subnets (no direct route to an Internet Gateway) and that your nodegroups are not configured with public IP assignment (check ec2:AssociatePublicIpAddress in Launch Template or nodegroup config via the console/IaC).
  3. Decide on the desired access model for the control plane endpoint
    • If the cluster should be reachable only from inside the VPC or via VPN/Direct Connect, plan to:
      • Set endpointPrivateAccess=true
      • Set endpointPublicAccess=false
    • If you must keep public endpoint access temporarily, define the minimal publicAccessCidrs necessary (e.g., specific office/VPN egress IPs).
    • Ensure alternative access (bastion, VPN, Direct Connect) is in place before removing broad public access so operational access is not lost.
  4. Update the cluster endpoint access configuration (if changes are needed)
    • To enable private access and restrict public access to specific CIDRs (example):
    • To disable public access entirely and use only private access:
    • Wait for the update to complete:
  5. Ensure all nodegroups use only private IPs
    • For managed nodegroups:
      • Reconfigure or recreate nodegroups so that:
        • They use only private subnets.
        • Public IP assignment is disabled in the nodegroup or its Launch Template (via AWS console or your IaC).
    • For each updated or recreated nodegroup, verify that new EC2 instances have no public IP:
    • Confirm PublicIp is empty for all instances.
  6. Verify the final state against the benchmark intent
    • Confirm cluster endpoint config:
    • Confirm worker nodes have only private IPs (re-run instance check from step 5).
    • Document any justified exceptions where limited public access (endpointPublicAccess=true with tightly scoped publicAccessCidrs) is required for business or operational reasons.
kubectl cannot modify whether an EKS cluster uses private nodes or adjust its VPC/private/public endpoint settings; those are managed control-plane and VPC settings configured via the AWS console, CLI, or IaC. Refer to the Manual Steps section for how to review and change the cluster’s networking configuration.
Explanation of results (what indicates a problem):
  • For control-plane / cluster endpoint:
    • ControlPlaneEndpointPublicAccess == true without a justified restriction in PublicAccessCidrs (e.g., it is 0.0.0.0/0 or very broad) requires review.
    • ControlPlaneEndpointPrivateAccess == false means the API server is not reachable purely over private networking and should be reviewed.
  • For worker nodes:
    • AnyNodeHasPublicIP == true means at least one node reports an ExternalIP.
      • This indicates a potential violation of “Private Nodes only” and those nodes must be checked in the AWS console/VPC to confirm whether the ExternalIP is a real, routable public IP.
    • NodeDetails shows, per node, the internal and external addresses. Any non-empty external= field marks that node for manual review.
This script is read-only: it does not change any configuration. Use it from any machine with kubectl and aws CLI access.