---
title: Shared host PID namespace
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Infrastructure as Code (IaC)
  Security > IaC Security Rules > Shared host PID namespace
---

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

# Shared host PID namespace

{% 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-shared-host-pid-namespace` 

**Platform:** DockerCompose

**Severity:** Medium

**Category:** Resource Management

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

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

### Description{% #description %}

Setting `pid: host` allows a container to see and interact with all processes running on the host, including sending signals to and inspecting memory of processes outside the container. This breaks process isolation and can be exploited to disrupt host services, leak sensitive process data, or escalate privileges. Services should omit the `pid` field or set it to a container-scoped value instead of `host`.

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

```yaml
services:
  private:
    image: alpine
    pid: private
  service_share:
    image: alpine
    pid: service:private
```

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

```yaml
services:
  risky:
    image: alpine
    pid: host
```
