Skip to main content

More Info:

Create clusters with a private endpoint and disable the public API server endpoint so the control plane is only reachable from within your virtual network.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. Review current API server endpoints (Azure CLI – any machine with az and access):
    • Confirm whether enablePrivateCluster/privateCluster is true (private endpoint enabled).
    • Confirm enablePublicFqdn is false and authorizedIpRanges is empty (no public access), or that public access is intentionally restricted to minimal CIDRs.
  2. Identify and review the AKS-managed private endpoint in the virtual network (Azure Portal or CLI – any machine):
    • In the Portal: go to the cluster → Networking → verify “Private cluster” is enabled and note the linked virtual network and subnet.
    • Or via CLI, list private endpoints and find the one targeting the AKS control plane:
    • Confirm the private endpoint is in the intended subnet and that network security groups/firewall rules allow required access from your admin/jump-host subnets.
  3. Check private DNS configuration for the cluster’s private endpoint (Azure CLI – any machine):
    • List private DNS zones and links:
    • Confirm there is a private DNS zone (for example, privatelink.<region>.azmk8s.io) and that it is linked to the same virtual network used by the cluster’s private endpoint with registrationEnabled as appropriate.
  4. Decide on desired exposure policy (governance decision – no command):
    • Decide if the cluster must be private-only (recommended) or if restricted public CIDRs are required for specific use cases.
    • Document approved admin networks (on-prem, VPN, peering, jump hosts) that should reach the private endpoint, and any exceptional public CIDRs if you will allow them.
  5. Apply configuration to enforce private-only or restricted public access (Azure CLI – any machine):
    • To disable the public API endpoint entirely (preferred):
    • If you must keep a public endpoint but restrict it, supply specific CIDR ranges (and optionally hide the public FQDN):
    • Ensure that private cluster mode is enabled at creation time for new clusters (cannot be toggled later), using --enable-private-cluster in your az aks create/IaC definitions.
  6. Verify final state matches the benchmark intent (Azure CLI – any machine):
    • Confirm privateCluster is true, privateFqdn is set, enablePublicFqdn is false, and either authorizedIpRanges is [] (no public access) or restricted to the explicitly approved CIDRs.
kubectl cannot change the API server’s public/private endpoint configuration because it is managed at the AKS control-plane / Azure resource level. Make the changes through the Azure portal, az CLI, or your IaC (ARM/Bicep/Terraform) instead, and follow the guidance in the Manual Steps section.
How to interpret the output (what indicates a problem):
  • Each line is one cluster.
  • Focus on these columns:
    • privateClusterEnabled and/or enablePrivateEndpoint should be true to indicate private endpoint usage.
    • fqdn represents the public API server endpoint (public FQDN).
    • privateFqdn represents the private endpoint DNS name.
Potential issues to flag manually:
  1. Public access still enabled:
    • fqdn is non-empty AND
    • Either:
      • privateClusterEnabled is false and enablePrivateEndpoint is false (no private endpoint at all), or
      • You have a policy that public endpoint must be fully disabled (even with IP restrictions).
  2. No private endpoint:
    • privateClusterEnabled=false AND enablePrivateEndpoint=false AND privateFqdn is empty.
  3. Weak restriction when public endpoint must be off:
    • If your requirement is “no public access at all”:
      • Any cluster with a non-empty fqdn should be reviewed, even if apiServerAuthorizedIpRanges is populated.
This script does not change configuration; it only surfaces clusters that need manual review and potential remediation via Azure CLI, portal, or IaC.