Interview Prep/DevSecOps/Kubernetes Security Posture

How do you harden the kubelet?

AdvancedProductionKubernetes Security Posture
Answer

The kubelet API on port 10250 can exec into pods, so it must not be open.

# KubeletConfiguration
authentication:
  anonymous: {enabled: false}
  webhook: {enabled: true}
authorization:
  mode: Webhook
readOnlyPort: 0
protectKernelDefaults: true
rotateCertificates: true
serverTLSBootstrap: true

Also restrict port 10250 to the control plane and monitoring in the node security group, and keep NodeRestriction admission on so a node can only modify its own Node object and its pods. Managed services set most of this already; verify with kube-bench run --targets node.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security Posture