---
title: The Docker socket file should be owned by root and Docker group
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > The Docker socket file should be owned
  by root and Docker group
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# The Docker socket file should be owned by root and Docker group
Classification:complianceFramework:cis-dockerControl:3.15 
## Description{% #description %}

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

## Rationale{% #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{% #audit %}

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

```bash
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{% #remediation %}

Set the owner and group:

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

## Impact{% #impact %}

None.

## Default value{% #default-value %}

Docker creates the socket with owner root and group docker.

## References{% #references %}

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