Which TWO of the following configurations are considered best practices for securing the Docker daemon?
Trap 1: Enable the Docker API to listen on TCP port 2375 for remote…
Exposing the Docker API on unencrypted TCP port 2375 allows unauthorized users to execute arbitrary commands with root privileges on the host. This effectively grants full control to any entity with network access, representing a critical security misconfiguration that must be avoided in all production environments.
Trap 2: Mount the Docker socket into all application containers.
Mounting the Docker socket inside a container allows the containerized application to communicate with the host daemon. This effectively permits the container to spawn and manage other containers, leading to trivial container escapes and root-level host access if the application within the container is successfully exploited.
Trap 3: Run the Docker daemon as a non-root user without any additional…
While running as a non-root user is a goal, the default Docker daemon architecture requires elevated privileges to manage network interfaces and mount filesystems. Simply running as a non-root user without proper capability management will break the core functionality required for container orchestration and resource isolation.
- A
Enable the Docker API to listen on TCP port 2375 for remote management.
Why it fails: Exposing the Docker API on unencrypted TCP port 2375 allows unauthorized users to execute arbitrary commands with root privileges on the host. This effectively grants full control to any entity with network access, representing a critical security misconfiguration that must be avoided in all production environments.
- B
Configure the Docker daemon to utilize user namespaces.
User namespaces map the root user inside the container to a non-privileged user on the host. This prevents a container breakout from granting the attacker root access on the underlying operating system, providing a necessary layer of isolation that is critical for multi-tenant containerized host environments.
- C
Mount the Docker socket into all application containers.
Why it fails: Mounting the Docker socket inside a container allows the containerized application to communicate with the host daemon. This effectively permits the container to spawn and manage other containers, leading to trivial container escapes and root-level host access if the application within the container is successfully exploited.
- D
Enforce TLS authentication for the Docker remote API.
Requiring TLS for the Docker remote API ensures that communications are encrypted and that both the client and the server are authenticated. This prevents unauthorized remote command execution and protects sensitive container management traffic from eavesdropping or interception during transit across the corporate network infrastructure.
- E
Run the Docker daemon as a non-root user without any additional privileges.
Why it fails: While running as a non-root user is a goal, the default Docker daemon architecture requires elevated privileges to manage network interfaces and mount filesystems. Simply running as a non-root user without proper capability management will break the core functionality required for container orchestration and resource isolation.