Containers should use a non-default bridge network

docker

Classification:

compliance

Framework:

cis-docker

Control:

5.30

Description

Containers should use a network other than the default bridge docker0.

Rationale

Containers on the default bridge share one network where they can reach each other. A user-defined network per application isolates them and gives them name resolution.

Audit

Find the containers on the networks of the docker0 bridge:

docker network ls --quiet | xargs docker network inspect --format '{{ .Name }}: {{ .Options }}'
docker ps --quiet --all | xargs docker inspect --format '{{ .Name }}: {{ .NetworkSettings.Networks }}'

Datadog fails the rule when a container joins the default bridge network or a network on the docker0 bridge, and passes it otherwise.

Remediation

Create a network for the application and run its containers on it:

docker network create app
docker run --network app <image>

Impact

None.

Default value

Containers join the default bridge network.

References

  1. https://docs.docker.com/network/bridge/