Skip to main content

More Info:

Automate service accounts management.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, review existing ServiceAccounts to understand what is already in use (run on any machine with kubectl access):
    If needed, create or adjust ServiceAccounts for your workloads according to your environment’s requirements:
  2. On every control plane node, back up the existing kube-apiserver static pod manifest:
  3. On every control plane node, open the kube-apiserver manifest for editing:
  4. In the spec.containers[0].command section, locate the --disable-admission-plugins argument.
    • If it includes ServiceAccount, remove ServiceAccount from the comma-separated list, leaving the other plugins unchanged.
    • If --disable-admission-plugins is not present, no change is needed for this argument.
      Save and exit the editor.
      Note: Editing this file will cause the kubelet to restart the kube-apiserver static pod.
  5. Wait for the kube-apiserver pod to restart and become Ready (run on any machine with kubectl access):
  6. Verify on every control plane node that the kube-apiserver process is now running without ServiceAccount in --disable-admission-plugins:
    Inspect the output and confirm that either --disable-admission-plugins is absent or, if present, its value does not contain ServiceAccount.
kubectl cannot modify the kube-apiserver static pod manifest or its process flags on the control plane node. To remediate this finding, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; see the Manual Steps section for detailed guidance.

Additional Reading: