Lion Cipher Lab

Default-deny east-west traffic in Kubernetes with NetworkPolicy

Why it matters

Here is the fact that surprises almost everyone the first time they hear it: in a brand-new Kubernetes cluster, every single pod can open a network connection to every single other pod, in every namespace, on every port. Nothing stands between them. The marketing site can reach the payroll database. The forgotten debug container someone left running six months ago can reach the secrets-fetching sidecar, the internal metrics endpoint and, in a cloud cluster, the instance metadata service that hands out credentials. None of that is a misconfiguration — that is the shipped default, and it stays…

What you'll learn

Steps in this lab

  1. The vocabulary, from absolute zero
  2. The default nobody tells you about: everything can reach everything
  3. The most important fact about NetworkPolicy: it is a contract, not an implementation
  4. Build a throwaway cluster with kind, with the default CNI off and Calico on
  5. Deploy three workloads across two namespaces — and prove the cluster is wide open
  6. Default-deny ingress — and learn why it times out instead of being refused
  7. Allow back exactly what is needed, one rule at a time
  8. Egress — the half everyone skips, and the half that stops exfiltration
  9. Reason about policies like a professional: additive, unordered, and both-ended
  10. The judgment: when NetworkPolicy is the right control, when it is not, and how to roll it out without taking production down

Open the full interactive lab →