SV-242397r1137638_rule
V-242397
SRG-APP-000033-CTR-000090
CNTR-K8-000440
CAT I
10
1. Remove staticPodPath setting on Kubernetes worker nodes:
a. On each Worker node, run the command:
ps -ef | grep kubelet
b. Note the path to the config file (identified by --config).
c. Edit the Kubernetes kubelet file in the --config directory on the Worker nodes. Remove the setting "staticPodPath".
d. Restart the kubelet service using the following command:
systemctl daemon-reload && systemctl restart kubelet
2. Remove Kubelet Systemd Service Arguments:
a. Modify the systemd Service File. Run the command:
sudo systemctl edit --full kubelet
(Example Return:ExecStart=/usr/bin/kubelet --pod-manifest-path=/etc/kubernetes/manifests)
b. Find and remove --pod-manifest-path.
c. Save and exit the editor.
d. Restart the kubelet service using the following command:
systemctl daemon-reload && systemctl restart kubelet
If staticPodPath is missing in the Kubelet config and in the systemd arguments, the node does not support static pods.
1. To find the staticPodPath setting on Kubernetes worker nodes, follow these steps:
a. On the Worker nodes, run the command:
ps -ef | grep kubelet
b. Note the path to the Kubelet configuration file (identified by --config).
(ls /var/lib/kubelet/config.yaml is the common location.)
c. Run the command:
grep -i staticPodPath <path_to_config_file>
If any of the Worker nodes return a value for "staticPodPath", this is a finding.
If staticPodPath is not in the config file, check if it is set as a command-line argument.
2. Check Kubelet Systemd Service Arguments.
a. Run the following command to check the Kubelet service:
sudo systemctl cat kubelet | grep pod-manifest-path
If there is no output, staticPodPath is not set in systemd arguments.
If there is any return, this is a finding.
(Example Return:ExecStart=/usr/bin/kubelet --pod-manifest-path=/etc/kubernetes/manifests
This means static pods are defined in /etc/kubernetes/manifests.)
V-242397
False
CNTR-K8-000440
If staticPodPath is missing in the Kubelet config and in the systemd arguments, the node does not support static pods.
1. To find the staticPodPath setting on Kubernetes worker nodes, follow these steps:
a. On the Worker nodes, run the command:
ps -ef | grep kubelet
b. Note the path to the Kubelet configuration file (identified by --config).
(ls /var/lib/kubelet/config.yaml is the common location.)
c. Run the command:
grep -i staticPodPath <path_to_config_file>
If any of the Worker nodes return a value for "staticPodPath", this is a finding.
If staticPodPath is not in the config file, check if it is set as a command-line argument.
2. Check Kubelet Systemd Service Arguments.
a. Run the following command to check the Kubelet service:
sudo systemctl cat kubelet | grep pod-manifest-path
If there is no output, staticPodPath is not set in systemd arguments.
If there is any return, this is a finding.
(Example Return:ExecStart=/usr/bin/kubelet --pod-manifest-path=/etc/kubernetes/manifests
This means static pods are defined in /etc/kubernetes/manifests.)
M
5376