TMA-DOCKER-2.8
Ensure TLS authentication for Docker daemon is configured
CriticalLevel 1Automateddocker
Description
When the daemon listens on a TCP socket, anyone who can reach it controls the host unless TLS client verification is enabled. Compliant when no tcp:// host is configured, or when tlsverify, tlscacert, tlscert and tlskey are all set. The audit reads the running dockerd command line (ps) together with /etc/docker/daemon.json.
How it is checked
Audit method: Shell command
shell
args=$(ps -eo args 2>/dev/null) || exit 1; s=$(printf '%s\n' "$args" | grep '[d]ockerd'; cat /etc/docker/daemon.json 2>/dev/null); if printf '%s\n' "$s" | grep -q 'tcp://'; then for k in tlsverify tlscacert tlscert tlskey; do printf '%s\n' "$s" | grep -Eq -e "--$k|\"$k\"" || { echo "missing $k"; exit 0; }; done; fi; echo compliant- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Configure "tlsverify": true, "tlscacert", "tlscert" and "tlskey" in /etc/docker/daemon.json (or the equivalent dockerd flags) for any tcp:// listener, or remove the TCP listener, then restart the Docker daemon.
Properties
- Operating systems
- Any
- Tags
- dockerdaemontls
- Reference
- CIS Docker Benchmark v1.9.0 - 2.8 Ensure TLS authentication for Docker daemon is configured
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target docker