Skip to main content

More Info:

Verifies that —service-account-private-key-file is set so the controller manager can sign service account tokens with a dedicated private key.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, confirm the controller manager is running as a static pod and note the manifest path:
  2. On every control plane node, ensure you have or create a dedicated private key file for service accounts (adjust path/permissions if you already have a key):
  3. On every control plane node, back up the existing static pod manifest:
  4. On every control plane node, edit the controller manager manifest to set the private key file flag. Open the file:
    In the command: (or args:) list for the kube-controller-manager container, add (or update) this entry so it is present exactly once:
    Save and exit. Editing a file in /etc/kubernetes/manifests causes the kubelet to restart the kube-controller-manager pod automatically.
  5. On every control plane node, wait for the controller manager pod to restart and become ready:
  6. On every control plane node, verify that the controller manager process now includes the --service-account-private-key-file flag with the correct path:
kubectl cannot modify the kube-controller-manager static pod manifest or its process flags. This finding must be remediated directly on each control plane node by editing /etc/kubernetes/manifests/kube-controller-manager.yaml; see the Manual Steps section for exact instructions.