Docker
TMA-DOCKER-7.3
Ensure that all Docker swarm overlay networks are encrypted
MediumLevel 1Automateddocker
Description
Overlay network traffic between swarm nodes is unencrypted by default. On an active swarm node every overlay network must have the encrypted option; compliant when swarm mode is inactive.
How it is checked
Audit method: Shell command
shell
st=$(docker info --format '{{.Swarm.LocalNodeState}}') || exit 1; [ "$st" = active ] || { echo compliant; exit 0; }; ns=$(docker network ls --filter driver=overlay --quiet) || exit 1; [ -z "$ns" ] && { echo compliant; exit 0; }; out=$(docker network inspect --format '{{.Name}} {{index .Options "encrypted"}}' $ns) || exit 1; bad=$(printf '%s\n' "$out" | awk 'NF<2 {print $1}'); [ -z "$bad" ] && echo compliant || printf 'unencrypted overlay: %s\n' $bad- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Create overlay networks with --opt encrypted (docker network create -d overlay --opt encrypted <name>) and move services onto them.
Properties
- Operating systems
- Any
- Tags
- dockerswarmnetwork
- Reference
- CIS Docker Benchmark v1.9.0 - 7.3 Ensure that all Docker swarm overlay networks are encrypted
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
shell
tmaegis scan --target docker