TMAegisBêta
Plus de règles pour eks

Amazon EKS

TMA-EKS-5.4.1

Restrict EKS control plane endpoint access with private access and public CIDR allowlists

ÉlevéeNiveau 1Automatiséeeks

Description

This recommendation is about reducing exposure of the Kubernetes API server without necessarily making it private-only. The intended end state is that private endpoint access is enabled, and if the public endpoint remains enabled, it is narrowed to a small set of trusted source CIDR ranges instead of remaining open to all internet addresses. Requires the aws CLI with eks:DescribeCluster; the cluster comes from EKS_CLUSTER and the region from AWS_REGION/AWS_PROFILE. Private access must be on and any public endpoint must not allow 0.0.0.0/0.

Méthode de vérification

Méthode d'audit: Commande shell

shell
out=$(aws eks describe-cluster --name "${EKS_CLUSTER:?set EKS_CLUSTER}" --query 'cluster.resourcesVpcConfig.[endpointPrivateAccess,endpointPublicAccess,join(`
`,publicAccessCidrs || `[]`)]' --output text) || exit 1
set -- $out
priv=$1; pub=$2; cidrs=${3:-}
if [ "$priv" != True ]; then echo "noncompliant: endpointPrivateAccess=$priv"
elif [ "$pub" = True ] && { [ -z "$cidrs" ] || printf '%s' "$cidrs" | grep -q '0\.0\.0\.0/0'; }; then echo "noncompliant: public endpoint open to $cidrs"
else echo compliant; fi
Sortie attendue
compliant

Méthode de correction

Méthode de correction: Recommandation ou correctif d'infrastructure

By enabling private endpoint access to the Kubernetes API server, all communication between your nodes and the API server stays within your VPC. You can also limit the IP addresses that can access your API server from the internet, or completely disable internet access to the API server. With this in mind, you can update your cluster accordingly using the AWS CLI to ensure that Private Endpoint Access is enabled. If you choose to also enable Public Endpoint Access then you should also configure a list of allowable CIDR blocks, resulting in restricted access from the internet. If you specify no CIDR blocks, then the public API server endpoint is able to receive and process requests from all IP addresses by defaulting to ['0.0.0.0/0'].

Propriétés

Systèmes d'exploitation
Tous
Étiquettes
eksmanaged-servicesnetwork
Référence
CIS Amazon Elastic Kubernetes Service (EKS) Benchmark v2.0.0 - 5.4.1 Restrict EKS control plane endpoint access with private access and public CIDR allowlists

Vérifier cet hôte

Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.

shell
tmaegis scan --target eks