---
title: >-
  TLS authentication should be enabled for Docker daemon to restrict remote
  access
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > TLS authentication should be enabled
  for Docker daemon to restrict remote access
---

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

# TLS authentication should be enabled for Docker daemon to restrict remote access
Classification:complianceFramework:cis-dockerControl:2.8 
## Description{% #description %}

A Docker daemon that listens on a TCP socket should require TLS client authentication.

## Rationale{% #rationale %}

Whoever reaches the daemon's API controls the host. Over TCP, TLS with client certificates limits the API to the clients that hold a certificate signed by the CA of the daemon.

## Audit{% #audit %}

Look for TCP hosts and TLS settings on the dockerd command line, in `daemon.json`, and in the `docker.socket` unit:

```bash
ps -o args= -C dockerd
grep -E '"(hosts|tls[a-z]*)"' /etc/docker/daemon.json
systemctl cat docker.socket | grep ListenStream
```

Datadog reads the hosts of `-H` and `--host` or, if they aren't set, `hosts` in `daemon.json`. A host starting with `tcp://`, or without a scheme, is a TCP socket. When dockerd takes its sockets from systemd with `fd://`, Datadog also reads `ListenStream` in the `docker.socket` unit and its drop-ins, where a port, or an address and a port, is a TCP socket. Datadog passes the rule when the daemon has a TCP socket and `tlsverify` with `tlscacert`, `tlscert`, and `tlskey`, fails it when a TCP socket lacks them, and reports it not applicable when the daemon listens only on Unix sockets.

## Remediation{% #remediation %}

Bind the daemon only to Unix sockets, or configure TLS client authentication:

```json
{
  "tlsverify": true,
  "tlscacert": "/etc/docker/ca.pem",
  "tlscert": "/etc/docker/server-cert.pem",
  "tlskey": "/etc/docker/server-key.pem"
}
```

Then restart the daemon with `systemctl restart docker`.

## Impact{% #impact %}

Clients need a certificate signed by the CA of the daemon.

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

The daemon listens only on the Unix socket `/var/run/docker.sock`.

## References{% #references %}

1. [https://docs.docker.com/engine/security/protect-access/](https://docs.docker.com/engine/security/protect-access/)
