Interview Prep/Kubernetes/Security, RBAC and policy

How do you enforce a default-deny network posture in a namespace?

IntermediateScenarioSecurity, RBAC and policy
Answer

Situation read → Compliance requires that pods only talk to what they need.

What I'd do →

  1. Apply a policy with podSelector: {} and policyTypes: [Ingress, Egress]
  2. Add explicit allows for DNS (UDP/TCP 53 to kube-dns)
  3. Add allows per app (frontend to backend, backend to DB)
  4. Test with kubectl exec ... -- nc -zv
  5. Use Cilium or Calico flow logs to find missing rules

Why → Default deny turns the model from allow-all to allow-listed.

Interview tip → Say DNS egress is the thing everyone forgets.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy