Skip to main content

More Info:

Do not allow all requests. Enable explicit authorization.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the current API server static pod manifest:
  2. On every control plane node, edit the API server manifest to remove AlwaysAllow and enable RBAC (this edit will automatically restart the kube-apiserver when the file is saved):
    If --authorization-mode is missing or contains a list including AlwaysAllow, edit the file manually:
    and ensure there is a line under containers: -> kube-apiserver -> command: similar to:
  3. 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).
  4. Verify on every control plane node that the kube-apiserver is no longer using AlwaysAllow and is using RBAC instead:
    Confirm the kube-apiserver process includes --authorization-mode=RBAC and does not contain --authorization-mode=AlwaysAllow.
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.

Additional Reading: