LogixLoops
Treat every pod as untrusted, including your own. Put a proxy in front of each one so all traffic is authenticated and encrypted between services. Then write policies that say exactly which service may call which. If an attacker gets code running on a node, they land in a box that can only reach the few services you allowed, instead of the whole cluster.
In a modern cloud-native architecture, assuming internal network traffic is safe is a catastrophic error. A single compromised container in a multi-tenant cluster can laterally scan and exploit the entire network, because the default Kubernetes network model is flat: every pod can reach every other pod.
A namespace does not change this. It scopes names and RBAC. It does not stop packets.
The first NetworkPolicy in any cluster should deny everything, so that every subsequent policy is an explicit, reviewable grant rather than a patch on an open network.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: tenant-a
spec:
podSelector: {} # every pod in the namespace
policyTypes: [Ingress, Egress]
Egress matters as much as ingress and is the half teams routinely skip. Most of what an attacker does after landing in a container, reaching a metadata endpoint, exfiltrating to an external host, pulling a second-stage payload, is outbound.
By injecting an Envoy sidecar proxy into every pod using Istio, we force all traffic to traverse the proxy:
frontend service can talk to api-gateway, but cannot connect directly
to database-core.Implementing this requires discipline, but it ensures that even if an attacker achieves remote code execution on a worker node, their blast radius is contained to the handful of services that workload identity was permitted to reach.
Join our engineering newsletter to get deep-dives like this delivered straight to your inbox every month.