Interview Prep/DevSecOps/Kubernetes Security

The Kubernetes API server endpoint is public. Is that a problem, and what do you do?

BeginnerScenarioKubernetes Security
Answer

Situation read → A public endpoint still needs auth, but it exposes the cluster to credential stuffing and zero-day exploits.

What I'd do →

  1. Prefer a private endpoint; access via VPN, bastion or SSM.
  2. If public is needed (for example hosted CI), restrict to known CIDRs: aws eks update-cluster-config --name prod --resources-vpc-config endpointPublicAccess=true,publicAccessCidrs="203.0.113.0/24",endpointPrivateAccess=true.
  3. Confirm anonymous auth gives nothing useful: curl -k https://$API/api should return 401 or 403.
  4. Keep the control plane version current.

Why → Reducing who can reach the API cuts off whole classes of attacks.

Interview tip → Private endpoint plus CI runners inside the VPC is the clean answer.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security