|Finding ID||Version||Rule ID||IA Controls||Severity|
|Kubernetes allows a user to configure kubelets with dynamic configurations. When dynamic configuration is used, the kubelet will watch for changes to the configuration file. When changes are made, the kubelet will automatically restart. Allowing this capability bypasses access restrictions and authorizations. Using this capability, an attacker can lower the security posture of the kubelet, which includes allowing the ability to run arbitrary commands in any container running on that node.|
|Kubernetes Security Technical Implementation Guide||2022-12-02|
|Check Text ( C-45674r863796_chk )|
| On the Control Plane, change to the manifests' directory at /etc/kubernetes/manifests and run the command: |
grep -i feature-gates *
Review the feature-gates setting if one is returned.
If the feature-gates setting does not exist or feature-gates does not contain the DynamicKubeletConfig flag or the "DynamicKubletConfig" flag is set to "true", this is a finding.
Change to the directory /etc/sysconfig on the Control Plane and each Worker node and execute the command:
grep -i feature-gates kubelet
Review every feature-gates setting if one is returned.
If the feature-gates setting does not exist or feature-gates does not contain the DynamicKubeletConfig flag or the DynamicKubletConfig flag is set to "true", this is a finding.
|Fix Text (F-45632r863797_fix)|
| Edit any manifest file or kubelet config file that does not contain a feature-gates setting or has DynamicKubeletConfig set to "true". |
An omission of DynamicKubeletConfig within the feature-gates defaults to true. Set DynamicKubeletConfig to "false". Restart the kubelet service if the kubelet config file is changed.