Skip to main content

More Info:

Verifies that —kubelet-certificate-authority is set so the API server verifies kubelet certificates, preventing man-in-the-middle attacks against the kubelet connection.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, confirm the current API server flags and locate the manifest:
  1. Ensure you have or generate the CA certificate that issued the kubelet client certificates (example path used below). Copy it to the control plane node if needed and place it somewhere readable by the kube-apiserver, for example:
  1. On every control plane node, edit the API server static pod manifest:
Under the command: section (or - -- arguments list), add or modify the flag so it reads:
Ensure there is only one --kubelet-certificate-authority entry.
  1. Save the file and exit. The kubelet will automatically restart the kube-apiserver static pod when the manifest changes. Monitor the restart and confirm the pod is running:
  1. Check the API server logs for successful startup and no certificate validation errors toward kubelets:
  1. Verify that the --kubelet-certificate-authority flag is now set correctly on every control plane node:
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so it cannot be used to set --kubelet-certificate-authority. This must be fixed directly on every control plane node by editing /etc/kubernetes/manifests/kube-apiserver.yaml; see the Manual Steps section for the required procedure.