Control: EKS clusters endpoint should restrict public access
Description
Ensure whether AWS Elastic Kubernetes Service (AWS EKS) endpoint is not publicly accessible. The rule is compliant if the endpoint is publicly accessible.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.eks_cluster_endpoint_restrict_public_accessSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.eks_cluster_endpoint_restrict_public_access --shareSQL
This control uses a named query:
select  arn as resource,  case    when resources_vpc_config ->> 'EndpointPublicAccess' = 'true' then 'alarm'    else 'ok'  end as status,  case    when resources_vpc_config ->> 'EndpointPublicAccess' = 'true' then title || ' endpoint publicly accessible.'    else title || ' endpoint not publicly accessible.'  end as reason    , region, account_idfrom  aws_eks_cluster;