# Ensure that the Host's Process Namespace is Not Shared

- Source: https://support.icompaas.com/support/solutions/articles/62000234397-ensure-that-the-host-s-process-namespace-is-not-shared
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [CIS Docker Benchmark v1.7.0](https://support.icompaas.com/support/solutions/62000112687) › [CIS Docker Benchmark](https://support.icompaas.com/support/solutions/folders/62000169241)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:**

-   **Level 1**  
    

**Description:**

The Docker container process namespace should not be shared with the host system. This prevents containers from having access to the host's process space, which could allow a container to interfere with or observe processes running on the host.  

**Rationale:**

Sharing the process namespace between the host and containers can lead to potential security risks. A container could access and manipulate the host's process information, increasing the risk of privilege escalation or unauthorized access to the host system.  

**Impact:**

**Pros:**  

-   Prevents containers from accessing or interacting with the host’s process namespace, enhancing isolation and security.  
    
-   Reduces the risk of a container escaping and gaining access to critical system processes.  
    

Cons:  

-   May restrict certain use cases where containers need to interact with host processes, but these are generally rare and can be avoided.  
    

Default Value:

By default, containers do not share the host’s process namespace unless explicitly specified in the Docker run command or Docker Compose configuration.  

Pre-requisites:

-   Administrative access to the host system running Docker.  
    
-   Understanding of Docker command-line options and configuration files.  
    

**Remediation:**

**Test Plan:**

**Using AWS Console:**

1.  Navigate to the EC2 instance running Docker.  
    
2.  Check the Docker container configuration or deployment files (like docker run commands or docker-compose.yml) to ensure the --pid host option is not being used.

**Using AWS CLI:**

1.  Connect to the EC2 instance running Docker.  
    
2.  Run the following command to list all running containers and verify that none of them have the \--pid host flag:

docker ps --filter "pid=host"

  

**Implementation Plan:**

**Using AWS Console:**

1.  Log in to the EC2 instance.  
    
2.  Review the container configurations, including the docker run commands or docker-compose.yml files.
3.  Ensure that the --pid flag is not set to host. If it is, remove it.  
    
4.  Restart the Docker containers:  
      
    

**Using AWS CLI:**

1.  Use SSM to remotely update the Docker configuration and restart any affected containers.  
    
2.  Run the following command to ensure that containers are not using the host's process namespace:  
    

aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=instanceIds,Values=instance\_id" --parameters 'commands=\["docker ps --filter \\"pid=host\\""\]'

  

**Backout Plan:**

**Using AWS Console:**

1.  If the host’s process namespace was previously shared, ensure that containers are properly isolated by removing the \--pid host setting from the configuration files.
2.  Restart Docker containers

**Using AWS CLI:**

-   Use SSM to revert the change if necessary, ensuring the containers no longer share the host's process namespace.  
    
-   Run the following command to stop and restart the container with updated configuration:  
    
    aws ssm send-command --document-name "AWS-RunShellScript" --targets "Key=instanceIds,Values=instance\_id" --parameters 'commands=\["docker restart $(docker ps -q)"\]'
    
      
    

**References:**

-   CIS Docker Benchmark v1.7  
    
-   Docker Documentation: [https://docs.docker.com/](https://docs.docker.com/)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
