0423-k8s-client-ca-kubelet Ensure the client CA file parameter is set as needed¶
Rule ID¶
- 0423-k8s-client-ca
Category¶
- container
Severity¶
- info
Supported Versions¶
- Linux
Description¶
- If using Kubelet, enable Kubelet authentication with a certificate
Scan Frequency¶
0 */30 * * *
Rationale¶
- By default, Kubelet allows all authenticated requests (even anonymous requests) without requiring explicit authorization checks from the sender. You should restrict this behavior because it is not safe to run on untrusted and/or public networks.
Risk Items¶
- Container Security
Audit Method¶
- Execute the following command to verify:
Remediation¶
- Execute the following command:
Set
--client-ca-file=<path/to/client-ca-file>Note: If the--client-ca-fileparameter exists, set it to the corresponding CA file path. If this parameter does not exist, check the file specified by the-configparameter used to start kubelet, and check the configuration itemauthentication: x509: clientCAFilein the file, setting it to the corresponding file path. For kubelet servers started with command-line arguments, the configuration specified by-configtakes precedence.
After setting these parameters and ensuring they are correct, restart kubelet:
Impact¶
- You need to configure TLS on the API server. The certificate file path should theoretically be the local CA certificate, typically configured as:
/etc/kubernetes/pki/ca.crt
Default Value¶
- By default,
--client-ca-fileis not set
References¶
CIS Controls¶
- None