More Info:
Verifies that the controller-manager.conf kubeconfig file is owned by root:root so only privileged users can read its client credentials.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, confirm the file exists and view its current ownership:
-
On every control plane node, set the ownership of the kubeconfig file to root:root:
-
(Optional, but recommended) On every control plane node, restrict the permissions so only root can read/write:
-
On every control plane node, verify the ownership is now root:root:
Using kubectl
Using kubectl
kubectl cannot modify host-level file ownership for
/etc/kubernetes/controller-manager.conf on control plane nodes. This must be fixed directly on each control plane node’s filesystem; see the Manual Steps section for the exact commands to run over SSH.Automation
Automation
- Copy this script to a file, for example
/usr/local/sbin/fix-controller-manager-kubeconfig-ownership.sh. - Make it executable:
- Run on every control plane node (as root):

