---
title: User namespace support should be enabled in Docker
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > User namespace support should be
  enabled in Docker
---

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

# User namespace support should be enabled in Docker
Classification:complianceFramework:cis-dockerControl:2.10 
## Description{% #description %}

The Docker daemon should remap the users of containers to an unprivileged range of the host.

## Rationale{% #rationale %}

With user namespace remapping, root in a container is an unprivileged user on the host, so an escape from the container lands without root privileges.

## Audit{% #audit %}

Look for userns in the security options of the daemon:

```bash
docker info --format '{{ .SecurityOptions }}'
```

Datadog passes the rule when the security options include `name=userns`, or `name=rootless` for a rootless daemon, and fails it otherwise.

## Remediation{% #remediation %}

Set `userns-remap` in `daemon.json`:

```json
{
  "userns-remap": "default"
}
```

Then restart the daemon with `systemctl restart docker`. Containers that need the host's user namespace then run with `--userns=host`.

## Impact{% #impact %}

Remapping changes the owner of files in volumes and bind mounts, and some workloads need `--userns=host`.

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

User namespace remapping is off.

## References{% #references %}

1. [https://man7.org/linux/man-pages/man7/user_namespaces.7.html](https://man7.org/linux/man-pages/man7/user_namespaces.7.html)
1. [https://docs.docker.com/reference/cli/dockerd/#daemon-user-namespace-options](https://docs.docker.com/reference/cli/dockerd/#daemon-user-namespace-options)
