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
HighAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
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
networkPluginis typicallyazureorkubenet. - Confirm
networkPolicyis set tocalicoorazure. If it isnullor empty, network policy is not enabled.
- Confirm
-
Decide if change is required based on security requirements
- If
networkPolicyis not set, or set inconsistently with your standard (e.g., you mandate Calico but seeazure), 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”).
- If
-
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).
-
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
networkPolicyin-place (check your current AKS version and Azure docs):- Example using Azure CLI (update scenario, if supported):
- 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
networkPolicyfor a new cluster. - Migrate workloads to the new cluster following your change-management process.
- Update IaC (e.g., ARM/Bicep/Terraform) to include the desired
-
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.
- Using kubectl or your GitOps/IaC pipeline, implement at least:
-
Verify and document the final state
- Re-run the Azure CLI check:
- Confirm
networkPolicyreflects 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.
- Re-run the Azure CLI check:
Using kubectl
Using kubectl
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.Automation
Automation

