5.15 Ensure that the host's process namespace is not shared

Information

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.

Rationale:

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.

Impact:

Container processes cannot see processes on the host system. In certain circumstances, you may want your container to share the host's process namespace. For example, you could build a container containing debugging tools such as strace or gdb, and want to use these tools when debugging processes on the host. If this is desired, then share specific host processes using the -p switch.

For example:

docker run --pid=host rhel7 strace -p 1234

Solution

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.

See Also

https://workbench.cisecurity.org/files/3353

Item Details

Category: SYSTEM AND COMMUNICATIONS PROTECTION

References: 800-53|SC-4, CSCv6|18, CSCv7|14.1

Plugin: Unix

Control ID: 0450a94d1538717160baf427ddd54624c356a789554c726cff0cd64655210ea4