CNTR-R2-000160 The Kubernetes API server must have anonymous authentication disabled.

Information

The Kubernetes API Server controls Kubernetes via an API interface. A user who has access to the API essentially has root access to the entire Kubernetes cluster. To control access, users must be authenticated and authorized. By allowing anonymous connections, the controls put in place to secure the API can be bypassed.

Setting anonymous authentication to "false" also disables unauthenticated requests from kubelets.

While there are instances where anonymous connections may be needed (e.g., health checks) and Role-Based Access Controls (RBAC) are in place to limit the anonymous access, this access should be disabled, and only enabled when necessary.

Solution

Edit the RKE2 Configuration File /etc/rancher/rke2/config.yaml on the RKE2 Control Plane and set the following "kube-apiserver-arg" argument:

- anonymous-auth=false

Once the configuration file is updated, restart the RKE2 Server. Run the command:
systemctl restart rke2-server

See Also

https://workbench.cisecurity.org/benchmarks/0

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3, CAT|I, CCI|CCI-000213, Rule-ID|SV-254562r960792_rule, STIG-ID|CNTR-R2-000160, Vuln-ID|V-254562

Plugin: Unix

Control ID: 5c6a51972866c960ec557e9169d658b3a2869f81fa742a49625e7375d7825dc2