TMAegisベータ
alibaba のその他のルール

Alibaba Cloud

TMA-ALIBABA-7.9

Ensure Kubernetes Cluster is created with Private cluster enabled

中レベル 1自動alibaba

説明

A private cluster is a cluster that makes your master inaccessible from the public internet. In a private cluster, nodes do not have public IP addresses, so your workloads run in an environment that is isolated from the internet. Nodes have addresses only in the private address space. With a Private cluster enabled, VPC network peering gives you several advantages over using external IP addresses or VPNs to connect networks, including: Network Latency: Public IP networking suffers higher latency than ... Lists ACK clusters (aliyun cs GET /clusters) and fails any whose master_url has a public api_server_endpoint; a clusterless account is compliant. Read-only aliyun CLI calls; credentials and default region come from the CLI's normal profile (aliyun configure, ~/.aliyun/config.json or ALIBABA_CLOUD_* environment variables). JSON output is parsed with sed/awk. A missing CLI or credential fails the check.

チェック方法

監査方法: シェルコマンド

shell
out=$(aliyun cs GET /clusters 2>/dev/null) || exit 1
printf '%s\n' "$out" | grep -q '"cluster_id"' || { echo compliant; exit 0; }
printf '%s\n' "$out" | awk '
/"cluster_id"/ { id = $0; sub(/^[^:]*:[[:space:]]*"/, "", id); sub(/".*/, "", id) }
/"master_url"/ { if ($0 ~ /[{,]\\"api_server_endpoint\\":\\"https?:/) { print "public API endpoint on cluster listed near " id; n++ } }
END { if (!n) print "compliant" }'
期待される出力
compliant

修正方法

修正方法: ガイダンスまたは IaC パッチ

Remove the API server's public endpoint (ACK console > cluster > Basic Information > API Server Public Endpoint > Unbind EIP) and access the cluster through the internal endpoint, a VPN or a bastion.

プロパティ

オペレーティングシステム
すべて
タグ
alibabaack
参照
CIS Alibaba Cloud Foundation Benchmark v2.0.1 - 7.9 Ensure Kubernetes Cluster is created with Private cluster enabled

このホストをチェック

監査が許可されているマシンで実行してください。スキャンは読み取り専用です。

shell
tmaegis scan --target alibaba