lacework-global-319
Set the kubelet configuration file ownership to root:root (Automated)
This rule has been changed to automated, see Automated Policies for CIS Amazon EKS 1.1.0 for details.
Profile Applicability
• Level 1
Description
Ensure that root:root owns any configuration file the kubelet refers to with the --config
argument.
Rationale
The kubelet reads various parameters, including security settings, from a config file specified by the --config
argument. If this file is specified you should restrict its file permissions to maintain the integrity of the file. The file should be writable by only the administrators on the system.
Impact
None
Audit
First, SSH to the relevant worker node:
To check to see if the Kubelet Service is running:
sudo systemctl status kubelet
The output should return Active: active (running) since..
Run the following command on each node to find the appropriate Kubelet config file:
ps -ef | grep kubelet
The output of the above command should return something similar to --config /etc/kubernetes/kubelet/kubelet-config.json
which is the location of the Kubelet config file.
Run the following command:
stat -c %U:%G /etc/kubernetes/kubelet/kubelet-config.json
The output of the above command is the Kubelet config file's ownership. Verify that the ownership is set to root:root
Remediation
Run the following command (using the config file location identified in the Audit step):
chown root:root /etc/kubernetes/kubelet/kubelet-config.json