More Info:
Automate service accounts management.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
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:
-
On every control plane node, back up the existing kube-apiserver static pod manifest:
-
On every control plane node, open the kube-apiserver manifest for editing:
-
In the
spec.containers[0].commandsection, locate the--disable-admission-pluginsargument.- If it includes
ServiceAccount, removeServiceAccountfrom the comma-separated list, leaving the other plugins unchanged. - If
--disable-admission-pluginsis 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.
- If it includes
-
Wait for the kube-apiserver pod to restart and become Ready (run on any machine with kubectl access):
-
Verify on every control plane node that the kube-apiserver process is now running without
ServiceAccountin--disable-admission-plugins:Inspect the output and confirm that either--disable-admission-pluginsis absent or, if present, its value does not containServiceAccount.
Using kubectl
Using kubectl
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.Automation
Automation

