How do you secure the ingress layer of a cluster serving public traffic?
IntermediateScenarioKubernetes Security
Answer
Situation read → The ingress controller is the internet-facing entry. Harden it like an edge proxy.
What I'd do →
- Terminate TLS with cert-manager certs, enforce TLS 1.2+ and HSTS.
- Put a WAF in front (AWS WAF on the ALB, Cloud Armor, or ModSecurity/Coraza rules).
- Rate limit per client IP and set request size limits.
- Disable risky annotations: for ingress-nginx, keep
allow-snippet-annotations: false(snippets enable config injection). - Patch the controller quickly; the 2025 "IngressNightmare" CVEs in ingress-nginx showed why.
Why → One misconfigured controller exposes every app behind it.
Interview tip → Mention IngressNightmare and the admission webhook exposure lesson.
More on Kubernetes Security
What are the 4Cs of cloud native security?BeginnerWhat happens to a request between `kubectl apply` and etcd from a security point of view?IntermediateExplain Role, ClusterRole, RoleBinding and ClusterRoleBinding.BeginnerHow do you check what a user or service account is allowed to do?BeginnerWhich RBAC permissions are effectively cluster-admin in disguise?AdvancedHow do service account tokens work now, and what is `automountServiceAccountToken`?Intermediate