Interview Prep/DevSecOps/Kubernetes Security

How do you control which external domains pods can reach?

AdvancedScenarioKubernetes Security
Answer

Situation read → Standard NetworkPolicy works on IPs, not domains. Egress control by domain needs more tooling.

What I'd do →

  1. Cilium CiliumNetworkPolicy with toFQDNs rules (for example matchName: api.stripe.com) plus DNS visibility.
  2. Or an egress gateway or proxy (Istio egress gateway, Squid) that pods must use, with an allowlist.
  3. At the VPC level, AWS Network Firewall domain lists or a NAT with filtering.
  4. Start in log-only mode to build the allowlist from real traffic.

Why → Egress control blocks data exfiltration and command-and-control callbacks.

Interview tip → Say you learn real traffic first, then enforce, to avoid breaking apps.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security