turbot/docker_compliance
Loading controls...

Control: 5.16 Ensure that the host's process namespace is not shared

Description

The Process ID (PID) namespace isolates the process ID space, meaning that processes in different PID namespaces can have the same PID. This creates process level isolation between the containers and the host.

PID namespace provides separation between processes. It prevents system processes from being visible, and allows process ids to be reused including PID 1. If the host's PID namespace is shared with containers, it would basically allow these to see all of the processes on the host system. This reduces the benefit of process level isolation between the host and the containers. Under these circumstances a malicious user who has access to a container could get access to processes on the host itself, manipulate them, and even be able to kill them. This could allow for the host itself being shut down, which could be extremely serious, particularly in a multi-tenanted environment. You should not share the host's process namespace with the containers running on it.

Remediation

You should not start a container with the --pid=host argument. For example, do not start a container with the command below:

docker run --interactive --tty --pid=host centos /bin/bash

Default Value

By default, all containers have the PID namespace enabled and the therefore the host's process namespace is not shared with its containers.

Usage

Run the control in your terminal:

powerpipe control run docker_compliance.control.cis_v160_5_16

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run docker_compliance.control.cis_v160_5_16 --share

SQL

This control uses a named query:

docker_container_host_process_namespace_shared

Tags