Urgent.News

What's breaking now, across thousands of outlets.

Tech

Kubernetes network policies: your cluster is flat until you say otherwise

Here's a fact that surprises people new to Kubernetes and should genuinely alarm them a little: by default, every pod in your cluster can talk to every other pod, unrestricted, regardless of namespace, regardless of what the two pods actually do. Your carefully separated services, your isolated namespaces, all of that organizational structure means nothing to the network unless you explicitly…

Kubernetes clusters typically allow unrestricted communication between all pods by default. This can be problematic because a single compromised pod could potentially provide an attacker with access to the entire network. Network policies are a mechanism to enforce security by controlling which pods can communicate with each other on which ports and in which direction.

However, most clusters are not currently using network policies despite their importance. When a network policy is applied, it essentially changes the default network behavior from unrestricted to more restrictive. This can lead to unexpected breaks in functionality if not carefully planned.

The recommended approach is to start by identifying the most sensitive workloads that require isolation, such as databases, credential handling systems, or internal services. Apply network policies first to these critical components. Begin with a default-deny posture, only allowing the specific connections required by each application. Test changes in a non-production environment to avoid issues in production, as Kubernetes network policies can silently block traffic without providing clear error messages.

It's also important to verify that your specific Kubernetes setup and networking implementation are actually enforcing the network policies as you expect them to. While the concept of network policies aligns with traditional network segmentation principles, the actual enforcement may vary depending on the underlying CNI plugin and cluster configuration.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

TLS certificates, actually explained, no hand-waving

Most developers use TLS constantly and understand it vaguely, "it's the padlock, it means encrypted," without a clear picture of what's actually happening or, more usefully, what actually breaks and…

  • TLS encrypts data and authenticates servers separately
  • TLS certificates bind public keys to identities via CAs
  • Proper validation checks authority, date range, revocation, and domain matching

More from Wednesday 2 September →