For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/default_rules/ftc-kn6-yz8.md. A documentation index is available at /llms.txt.

The Docker socket file should be owned by root and Docker group

docker

Classification:

compliance

Framework:

cis-docker

Control:

3.15

Description

The Docker socket should be owned by user root and group docker.

Rationale

Whoever can use the Docker socket controls the Docker daemon, and through it the host. Its owner can change it, so the owner and group should be only root and the docker group.

Audit

Show the owner and group of /var/run/docker.sock:

stat -c '%U:%G' /var/run/docker.sock

Datadog passes the rule when /var/run/docker.sock belongs to root:docker, fails it when it belongs to another user or group, and reports it not applicable when the path is absent.

Remediation

Set the owner and group:

chown root:docker /var/run/docker.sock

Impact

None.

Default value

Docker creates the socket with owner root and group docker.

References

  1. https://docs.docker.com/reference/cli/dockerd/#daemon-socket-option
  2. https://docs.docker.com/reference/cli/dockerd/#bind-docker-to-another-hostport-or-a-unix-socket