Skip to main content

More Info:

Explicitly set a service account private key file for service accounts on the controller manager.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the controller manager static pod manifest:
  2. Identify (or create if needed) the service account private key file on the control plane node (example path below); ensure it is readable by the controller-manager:
  3. Edit the controller manager manifest to add or update the --service-account-private-key-file flag to point to that key file:
  4. If the key file path (/etc/kubernetes/pki/sa.key in this example) is not already mounted into the container, edit the manifest to add a hostPath volume and mount (this restart is automatic when you save the file):
    (Adjust if your manifest structure differs; saving the file will cause the kube-controller-manager static pod to restart.)
  5. Wait 30–60 seconds for the kubelet to restart the static pod, then verify on each control plane node that the controller manager process is using the correct flag and path:
kubectl cannot modify the kube-controller-manager static pod manifest or its process flags. This setting must be changed directly on each control plane node by editing /etc/kubernetes/manifests/kube-controller-manager.yaml; see the Manual Steps section for detailed host-level instructions.

Additional Reading: