Skip to main content

More Info:

Enable certificate based kubelet authentication.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Create or obtain a valid client cert/key for the apiserver–kubelet connection (every control plane node)
    • If you already have a designated client cert/key for kubelet auth, copy them to a secure location (e.g. /etc/kubernetes/pki/kubelet-apiserver-client.crt and /etc/kubernetes/pki/kubelet-apiserver-client.key) with permissions 600 and owned by root:root. Example:
    • Ensure this certificate is trusted by the kubelets’ configured client CA and has appropriate client auth usage.
  2. Back up the API server static pod manifest (every control plane node)
  3. Edit the kube-apiserver static pod manifest to add the flags (every control plane node)
    • Open the file in a root editor:
    • Under spec.containers[0].command, add or modify the following entries (one per line, preserving YAML indentation and existing args):
    • Save and exit.
      Operational impact: because this is a static pod manifest, the kubelet will automatically restart the kube-apiserver pod with the new configuration.
  4. Ensure the cert/key paths are mounted into the apiserver container if needed (every control plane node)
    • In the same /etc/kubernetes/manifests/kube-apiserver.yaml, confirm there is a volumeMounts entry pointing to the directory with your cert/key and a matching volumes entry. For example:
    • Adjust path/mountPath only if your cert/key directory differs. Save and exit; the apiserver will restart again if you changed the manifest.
  5. Verify the API server is running with the correct flags (every control plane node)
    After the apiserver pod has restarted and is stable, run:
    Confirm the printed command line includes both:
    --kubelet-client-certificate=/etc/kubernetes/pki/kubelet-apiserver-client.crt
    and
    --kubelet-client-key=/etc/kubernetes/pki/kubelet-apiserver-client.key.
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so this finding cannot be fixed via the Kubernetes API. The required changes must be made directly on every control plane node in /etc/kubernetes/manifests/kube-apiserver.yaml; see the Manual Steps section for the exact host-level remediation.

Additional Reading: