Skip to main content

More Info:

Verify kubelets certificate before establishing connection.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, identify the kube-apiserver static pod manifest and back it up:
  1. Identify the correct CA file that signs kubelet serving certificates (commonly under /etc/kubernetes/pki/):
(Replace /etc/kubernetes/pki/ca.crt with the appropriate kubelet CA file if different in your environment.)
  1. Edit the API server manifest to set --kubelet-certificate-authority to that CA file (this will restart the kube-apiserver because it is a static pod):
Under spec.containers[0].command, either add or update the argument so that there is a line like:
  1. Ensure the CA file is mounted into the kube-apiserver container if it is not already. In the same file, under spec.volumes, confirm or add:
And under spec.containers[0].volumeMounts, confirm or add:
  1. Save the file and exit the editor. The kubelet will detect the manifest change and restart the kube-apiserver. Check that the static pod is running again:
  1. Verify that the kube-apiserver is now running with the correct --kubelet-certificate-authority argument:
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so this finding cannot be fixed via the Kubernetes API. To remediate it, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; see the Manual Steps section for the exact host-level procedure.

Additional Reading: