UCF STIG Viewer Logo

Kubernetes DynamicKubeletConfig must not be enabled.


Overview

Finding ID Version Rule ID IA Controls Severity
V-242399 CNTR-K8-000460 SV-242399r717021_rule Medium
Description
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.
STIG Date
Kubernetes Security Technical Implementation Guide 2021-04-14

Details

Check Text ( C-45674r712551_chk )
On the Master node, 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 Master 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-45632r717020_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.