5.7 Ensure sshd is not run within containers

Information

The SSH daemon should not be running within the container. You should SSH into the Docker host, and use docker exec to enter a container.

Rationale:

Running SSH within the container increases the complexity of security management by making it

Difficult to manage access policies and security compliance for SSH server

Difficult to manage keys and passwords across various containers

Difficult to manage security upgrades for SSH server

It is possible to have shell access to a container without using SSH, the needlessly increasing the complexity of security management should be avoided.

Impact:

None.

Solution

Uninstall the SSH daemon from the container and use and use docker exec to enter a container on the remote host.

docker exec --interactive --tty <CONTAINER ID> sh

OR

docker attach <CONTAINER ID>

Default Value:

By default, SSH server is not running inside the container. Only one process per container is allowed.

See Also

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

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6, 800-53|CM-7, CSCv7|9.2

Plugin: Unix

Control ID: f0c5563844edce897e32b73e42961cb1ad80673b7114ef9c7d2ac381960720af