5.9 Ensure that the host's network namespace is not shared

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

When the networking mode on a container is set to --net=host, the container is not placed inside a separate network stack. Effectively, applying this option instructs Docker to not containerize the container's networking. The consequence of this is that the container lives 'outside' in the main Docker host and has full access to its network interfaces.

Rationale:

Selecting this option is potentially dangerous. It allows the container process to open reserved low numbered ports in the way that any other root process can. It also allows the container to access network services such as D-bus on the Docker host. A container process could potentially carry out undesired actions, such as shutting down the Docker host. This option should not be used unless there is a very specific reason for enabling it.

Impact:

None.

Solution

You should not pass the --net=host option when starting any container.

Default Value:

By default, containers connect to the Docker bridge when starting and do not run in the context of the host's network stack.

See Also

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