Skip to main content

More Info:

Enable a network policy engine such as Calico to segment and isolate pod traffic, enforcing least-privilege network communication within the cluster.

Risk Level

High

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify whether network policy is enabled on the AKS cluster
    • Run on: any machine with Azure CLI access and permission on the subscription.
    • Command (replace the placeholders with your real values before running):
    • Review:
      • Confirm networkPlugin is typically azure or kubenet.
      • Confirm networkPolicy is set to calico or azure. If it is null or empty, network policy is not enabled.
  2. Decide if change is required based on security requirements
    • If networkPolicy is not set, or set inconsistently with your standard (e.g., you mandate Calico but see azure), determine:
      • Compliance requirements for pod-to-pod and pod-to-external isolation.
      • Whether application teams rely on unrestricted intra-cluster communication that could be broken by restrictive policies.
    • Document the required target state (e.g., “All AKS clusters must use networkPolicy = azure” or “= calico”).
  3. Review existing Kubernetes NetworkPolicies to understand current behavior
    • Run on: any machine with kubectl access to the cluster.
    • Commands:
    • If there are few or no policies, plan for a staged rollout: start with default-allow policies, then tighten.
    • Identify critical namespaces/workloads that must remain reachable (ingress controllers, DNS, monitoring, logging, gateways).
  4. Plan and apply the configuration change via cloud/IaC tooling
    • Network policy enablement on AKS is a control-plane / cluster-creation-level setting; on many cluster versions it cannot be toggled in-place without recreation.
    • If your cluster/IaC stack supports changing networkPolicy in-place (check your current AKS version and Azure docs):
      • Example using Azure CLI (update scenario, if supported):
    • If in-place change is not supported, plan to:
      • Update IaC (e.g., ARM/Bicep/Terraform) to include the desired networkPolicy for a new cluster.
      • Migrate workloads to the new cluster following your change-management process.
  5. Design and deploy baseline NetworkPolicies for least-privilege
    • Using kubectl or your GitOps/IaC pipeline, implement at least:
      • Namespaced default policies (e.g., a default “deny-all-ingress” and “deny-all-egress” or “allow-necessary-egress-only”) in sensitive namespaces.
      • Explicit allow policies for:
        • DNS to kube-dns/CoreDNS.
        • Ingress from load balancer/ingress controllers to exposed services.
        • Monitoring/logging agents communicating with their backends.
    • Apply these in a test environment first, then progressively in production namespaces.
  6. Verify and document the final state
    • Re-run the Azure CLI check:
    • Confirm networkPolicy reflects the intended engine.
    • Re-run:
    • Validate that critical application paths still function and that unnecessary pod-to-pod communication is blocked according to your baseline policies. Document the result and any exceptions.
kubectl cannot be used to enable or change the cluster-wide network policy engine in AKS; this is configured at the cloud provider / managed control plane level (for example via the Azure portal, az aks, or IaC such as ARM/Bicep/Terraform). Refer to the Manual Steps section for guidance on enabling and configuring a network policy provider like Calico for your cluster.