More Info:
Do not allow all requests. Enable explicit authorization.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, back up the current API server static pod manifest:
-
On every control plane node, edit the API server manifest to remove
AlwaysAllowand enable RBAC (this edit will automatically restart the kube-apiserver when the file is saved):If--authorization-modeis missing or contains a list includingAlwaysAllow, edit the file manually:and ensure there is a line undercontainers: -> kube-apiserver -> command:similar to: - Wait for the kubelet on the control plane node to detect the modified manifest and restart the kube-apiserver container (this is automatic and briefly disrupts API server availability).
-
Verify on every control plane node that the kube-apiserver is no longer using
AlwaysAllowand is using RBAC instead:Confirm thekube-apiserverprocess includes--authorization-mode=RBACand does not contain--authorization-mode=AlwaysAllow.
Using kubectl
Using kubectl
kubectl cannot change the API server’s
--authorization-mode flag because it is configured via the static pod manifest on each control plane node, not through Kubernetes API objects. To fix this finding, edit /etc/kubernetes/manifests/kube-apiserver.yaml on every control plane node as described in the Manual Steps section.Automation
Automation

