---
title: Privileged containers enabled
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Infrastructure as Code (IaC)
  Security > IaC Security Rules > Privileged containers enabled
---

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

# Privileged containers enabled

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**Id:** `dockercompose-privileged-containers-enabled` 

**Platform:** DockerCompose

**Severity:** High

**Category:** Resource Management

#### Learn More{% #learn-more %}

- [Provider Reference](https://docs.docker.com/reference/compose-file/services/#privileged)

### Description{% #description %}

Running a container in privileged mode (`privileged: true`) grants it nearly all Linux kernel capabilities and unrestricted access to all host devices, effectively removing the isolation boundary between the container and the host. A compromised privileged container can trivially escape to the host, read or modify any file, and affect other workloads or the kernel itself. Services should not set `privileged: true`; use targeted `cap_add` entries or specific `devices` mappings instead.

## Compliant Code Examples{% #compliant-code-examples %}

```yaml
services:
  false_value:
    image: alpine
    privileged: false
  omitted:
    image: alpine
```

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```yaml
services:
  risky:
    image: alpine
    privileged: true
```
