CNTR-K8-000850 - Kubernetes Kubelet must deny hostname override.

Information

Kubernetes allows for the overriding of hostnames. Allowing this feature to be implemented within the kubelets may break the TLS setup between the kubelet service and the API server. This setting also can make it difficult to associate logs with nodes if security analytics needs to take place. The better practice is to setup nodes with resolvable FQDNs and avoid overriding the hostnames.

Solution

Run the command:
systemctl status kubelet.
Note the path to the drop-in file.

Determine the path to the environment file(s) with the command:
grep -i EnvironmentFile <path_to_drop_in_file>.

Remove the '--hostname-override' option from any environment file where it is present.

Restart the kubelet service using the following command:
systemctl daemon-reload && systemctl restart kubelet

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_Kubernetes_V2R2_STIG.zip

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-5(6), CAT|II, CCI|CCI-001499, Rule-ID|SV-242404r960960_rule, STIG-ID|CNTR-K8-000850, Vuln-ID|V-242404

Plugin: Unix

Control ID: 09500057dc996891e4522a2d2687502b7161517a431618a6b6f7a6fc893f36d8