A. B. Khan

Network policy and mesh policy — belt and suspenders

The Mesh Series · Article 20

Network policyAuthorizationPolicyPolicy as codeSPIFFECompliance evidenceIstioKubernetesPCI DSS

Cover: Network policy and mesh policy

The Mesh Series · Article 20 · Where Entra meets Istio

Article 16 built a default-deny mesh: no identity reaches a workload unless a policy names it. It's a strong control. It also has a blind spot, and naming it is the point of this article. The mesh only governs traffic the mesh can see. A pod without a sidecar — a DaemonSet, a debug container someone kubectl exec'd in, a workload that never joined the mesh, a node-level agent — can open a raw socket to your ledger and the mesh's AuthorizationPolicy never gets a vote, because the request never passed through a proxy that could enforce it.

So the identity policy you built operates at Layer 7. Underneath it, at Layers 3 and 4, is a different question the mesh doesn't answer: can this pod open a connection to that pod at all? That's NetworkPolicy, and you want both — not as redundancy, but because each covers exactly the other's gap.

Diagram: network mesh

Two gates at two layers. NetworkPolicy decides whether a packet may even arrive — by pod selector, namespace, and port, enforced by the CNI in the kernel, mesh or no mesh. The mesh's AuthorizationPolicy decides whether an authenticated identity may perform a specific action — by SPIFFE principal, HTTP method, path, and JWT claim. Neither can express the other's rule. NetworkPolicy has no idea what a SPIFFE identity or an HTTP path is; the mesh has no way to stop a connection that never reached its proxy. The pod outside the mesh is caught by the network gate precisely because that gate doesn't depend on the mesh.

Why regulated enterprises should care

Segmentation is a network-layer control in the frameworks, and identity authorization is a separate one — and the regulators are right to keep them separate, because they fail independently.

PCI-DSS is explicit: the cardholder-data environment must be network-segmented from everything else, and that segmentation is tested at the network layer — can a host in the general zone even reach a host in the CDE? That's an L3/L4 question, and NetworkPolicy is how you answer it inside Kubernetes. But PCI also wants least-privilege access control on what authenticated callers may do, which is the L7 identity question the mesh answers. RBI's IT framework and SAMA's CSF read the same way: network segmentation and access control, listed as distinct controls, because a firewall rule and an authorization check protect against different failures. An assessor testing segmentation will try to open a raw connection across the boundary — and if your only control is a mesh policy, a non-mesh pod sails through and you fail the network-segmentation test with your identity controls fully intact.

The belt-and-suspenders framing is exact here. The belt (network policy) holds even if the suspenders (mesh policy) are bypassed, and the suspenders do the fine-grained work the belt can't. You wear both because the failure of either alone is a real, testable gap.

How the pieces come together

Two default-denies, at two layers, each written in its own language.

At L3/L4, a default-deny NetworkPolicy says no pod may receive traffic unless a policy allows it — the network equivalent of Article 16's mesh baseline. Allows are expressed as pod and namespace selectors and ports: pods labelled app=payment-api may reach app=ledger on 8080. This is enforced by the CNI — Cilium, Calico, or Azure's network policy manager — down in the kernel, and it applies to every pod whether or not it's in the mesh.

At L7, the mesh AuthorizationPolicy (Article 16) says no identity may perform an action unless a policy allows it — the SPIFFE identity payment-api may POST /ledger. It sees the request content the network layer can't, and it enforces on cryptographic identity rather than pod labels.

The two compose as independent gates, which is the defense-in-depth pattern from Article 13 applied across OSI layers: a request must satisfy both, and a gap in one is covered by the other. A pod that slips past the mesh is stopped by the network; a connection the network allows is still authorized on identity and action by the mesh.

Show the config

The network gate — default-deny ingress for the namespace, then one narrow allow by label:

Code: networkpolicy

The identity gate sits on top — the same ledger, now governed by who and what, not just which pod:

Code: authzpolicy

Read them together and the division of labour is clean. The NetworkPolicy says a pod with this label, on this port — cheap, kernel-fast, mesh-independent. The AuthorizationPolicy says this cryptographic identity, this method, this path — rich, identity-aware, content-aware. Same intent, two layers, and a bypass of either is caught by the other.

Security · Audit · Integration

Security property gained. Enforcement at two independent layers. A workload is reachable only by the pods the network allows and actionable only by the identities the mesh allows. A non-mesh pod can't smuggle a raw connection past the network gate, and a network-permitted connection still can't perform an action its identity isn't authorized for.

Audit evidence produced. Two artefacts that map onto two named controls: the NetworkPolicy set is your network-segmentation evidence (the PCI L3/L4 test), and the AuthorizationPolicy set is your identity access-control evidence (least privilege at L7). An assessor testing segmentation with a raw connection and an assessor testing access control with a token get answers from two different, provable policy sets.

How it integrates. This is defense in depth (Article 13) across OSI layers: the mesh identity policy (Article 16) and the network policy are the L7 and L3/L4 halves of one segmentation posture. It closes Part C's security-depth arc — every control from mTLS to authorization to secrets now has a network-layer floor beneath it. And it raises the question the next article answers: you've written a lot of policies; what guarantees they're actually present on every workload?

Alternatives, and when you'd actually pick them

Mesh policy only. The gap this article opened on. Fine only if you can genuinely guarantee every pod is in the mesh — and you usually can't, because DaemonSets, system agents, and debug pods routinely aren't. Without a network floor, any non-mesh pod is an unenforced path to your workloads, and you'll fail a network-segmentation test even with perfect identity policy.

NetworkPolicy only. The other half-measure. It segments by pod and port but has no concept of identity, HTTP method, path, or claim — so it can't express "identity X may POST but not DELETE," and it can't distinguish two workloads sharing a label. Good as a floor, insufficient as the whole control for anything needing least-privilege on actions.

Cilium (eBPF) for both. Cilium enforces L3/L4 in the kernel with eBPF and adds identity-aware and some L7 policy without a per-pod proxy — attractive when you want unified CNI-level enforcement, high performance, and fewer moving parts than a full mesh. The trade is a different (Cilium-native) identity and policy model, and less of Istio's L7/JWT and SPIFFE richness. Reach for it when kernel-level performance and a single enforcement plane outweigh mesh-native L7 identity; run it alongside Istio when you want both.

Azure NPM / Calico. The CNI-level NetworkPolicy implementations on AKS. Which one you get depends on your cluster's network configuration; the policy objects are the standard Kubernetes ones either way. This is a which-engine choice, not a whether — you need a network-policy-capable CNI for any of the above to enforce.

From the toy to the standard

The toy is a default-deny NetworkPolicy and a default-deny AuthorizationPolicy on one namespace. The industry-standard version is segmentation enforced at both layers everywhere: a network floor that denies by default and allows narrowly by pod and port, independent of the mesh; an identity ceiling that denies by default and allows narrowly by SPIFFE principal, method, path, and claim; and the two maintained as the L3/L4 and L7 evidence for two distinct regulatory controls. Neither substitutes for the other, and a bypass of one is caught by the other — belt and suspenders, tested separately, holding together.

Part C has produced a lot of policy: mTLS modes, default-deny mesh rules, scope and role checks, network policies. All of it only protects you if it's actually present — and "we wrote a policy" is not the same as "no workload can ship without one." What stops a deployment that forgot its NetworkPolicy, or its PeerAuthentication, from reaching the cluster at all? That's admission control, and it's where Part C's guarantees get their teeth.

That's Article 21: policy as code — Gatekeeper vs Kyverno.


Next in the series — Article 21: Policy as code — Gatekeeper vs Kyverno.

Key skills & topics in this article

Network policyAuthorizationPolicyPolicy as codeSPIFFECompliance evidenceIstioKubernetesPCI DSS

  • #ServiceMesh
  • #Istio
  • #Azure
  • #dotnet
  • #ZeroTrust
  • #Kubernetes

Also on LinkedIn.