Skip to main content

More Info:

Without NetworkPolicies, pods accept traffic from any source by default. Every namespace should define at least one NetworkPolicy to control pod-level traffic.

Risk Level

High

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify namespaces missing NetworkPolicies (run on any machine with kubectl access):
  2. For each namespace that needs a strict default, create a default-deny-all policy (run on any machine with kubectl access; replace NAMESPACE with one from the list above):
  3. For namespaces where you cannot fully deny all traffic, create an initial restrictive policy and adjust later (example allowing only intra-namespace traffic; run on any machine with kubectl access and replace NAMESPACE):
  4. Review and customize policies in critical namespaces (e.g., kube-system, monitoring, ingress) to avoid breaking traffic (run on any machine with kubectl access):
  5. Optionally export policies to manifests for version control (run on any machine with kubectl access):
  6. Verification (run on any machine with kubectl access):
On any machine with kubectl access to the cluster:
  1. List namespaces currently missing NetworkPolicies (for your awareness):
  1. Create a default-deny NetworkPolicy in each namespace that lacks one (replace the namespace list as needed, or paste from the previous command’s output):
Adjust the for ns in ... list to include every namespace that should receive a default-deny policy, based on your environment and application needs.
  1. Verification (same command used by the audit):