Interview Prep/Kubernetes/Security Hardening & Compliance

What is a default-deny NetworkPolicy baseline?

BeginnerProductionSecurity Hardening & Compliance
Answer

Each application namespace starts with deny-all ingress and egress, plus explicit allows: DNS to CoreDNS, ingress from the ingress controller namespace, and specific service-to-service flows. It limits lateral movement after a compromise and documents the real dependency graph.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: { name: default-deny }
spec:
  podSelector: {}
  policyTypes: [Ingress, Egress]
All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security Hardening & Compliance