Interview Prep/DevSecOps/Kubernetes Security

Which kubelet settings matter for security?

AdvancedConceptKubernetes Security
Answer

The kubelet API on port 10250 can exec into any pod on the node, so it must not be open.

apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
authentication:
  anonymous: { enabled: false }
  webhook: { enabled: true }
authorization:
  mode: Webhook
readOnlyPort: 0
rotateCertificates: true
protectKernelDefaults: true

Webhook mode delegates authorisation to the API server, and the Node authorizer plus the NodeRestriction admission plugin limit each kubelet to its own node's objects. kube-bench checks all of these.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security