2.1.9 Ensure that the --keep-terminated-pod-volumes argument is set to false

Information

Unmount volumes from the nodes on pod termination.

Rationale:

On pod termination, you should unmount the volumes. Those volumes might have sensitive data that might be exposed if kept mounted on the node without any use. Additionally, such mounted volumes could be modified and later could be mounted on pods. Also, if you retain all mounted volumes for a long time, it might exhaust system resources and you might not be able to mount any more volumes on new pods.

Solution

Edit the kubelet service file '/etc/systemd/system/kubelet.service.d/10-kubeadm.conf' on each worker node and set the below parameter in 'KUBELET_SYSTEM_PODS_ARGS' variable.

--keep-terminated-pod-volumes=false

Based on your system, restart the 'kubelet' service. For example:

systemctl daemon-reload
systemctl restart kubelet.service

Impact:

Volumes will not be available for debugging.

See Also

https://workbench.cisecurity.org/files/1788

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b., CSCv6|14

Plugin: Unix

Control ID: 879ea79dadf01473599720d1ba97b1a289abee0c0528b5f9035ccc4a1da679e5