Google Kubernetes Engine (GKE)
TMA-GKE-5.6.2
Use VPC native GKE clusters with alias IP address ranges
Mô tả
Use VPC native GKE clusters with alias IP address ranges so Pod and Service IP addresses are allocated from subnet secondary IP address ranges in the cluster’s VPC network. This provides native VPC routing for GKE workloads and avoids relying on custom static routes for Pod routing. Requires gcloud with container.clusters.get; the cluster comes from GKE_CLUSTER and GKE_LOCATION (optional GKE_PROJECT, else the gcloud default project).
Cách kiểm tra
Phương pháp kiểm tra: Lệnh shell
v=$(gcloud container clusters describe "${GKE_CLUSTER:?set GKE_CLUSTER}" --location "${GKE_LOCATION:?set GKE_LOCATION}" ${GKE_PROJECT:+--project=$GKE_PROJECT} --format='value(ipAllocationPolicy.useIpAliases)') || exit 1
if [ "$v" = True ]; then echo compliant; else echo "noncompliant: ipAllocationPolicy.useIpAliases=$v"; fi- Đầu ra mong đợi
compliant
Cách khắc phục
Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng
VPC native networking is selected at cluster creation and cannot be enabled on an existing routes based cluster. To remediate a noncompliant cluster, create a new GKE cluster with alias IP address ranges enabled, migrate workloads to the new cluster, validate application connectivity, and decommission the routes based cluster after migration is complete. gcloud container clusters create $CLUSTER_NAME \ --location $LOCATION \ --project $PROJECT_ID \ --enable-ip-alias For production clusters, define or select appropriate subnet secondary IP address ranges for Pods and Services before cluster creation. Proper IP range planning helps avoid Pod or Service IP exhaustion as the cluster scales. • Note: VPC native networking is selected at cluster creation and cannot be enabled on an existing routes based cluster.
Thuộc tính
- Hệ điều hành
- Bất kỳ
- Thẻ
- gkemanaged-servicesnetwork
- Tham chiếu
- CIS Google Kubernetes Engine (GKE) Benchmark v2.0.0 - 5.6.2 Use VPC native GKE clusters with alias IP address ranges
Kiểm tra máy này
Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.
tmaegis scan --target gke