SV-235804r627539_rule
V-235804
SRG-APP-000141
DKER-EE-001990
CAT II
10
Document the ports required for each container in the SSP.
Fix the Dockerfile of the container image to expose only needed ports by the containerized application. Ignore the list of ports defined in the Dockerfile by NOT using -P (UPPERCASE) or --publish-all flag when starting the container. Use the -p (lowercase) or --publish flag to explicitly define the ports needed for a particular container instance.
Example:
docker run --interactive --tty --publish 5000 --publish 5001 --publish 5002 centos /bin/bash
Ensure that mapped ports are the ones that are needed by the containers.
This check should be executed on all nodes in a Docker Enterprise cluster.
via CLI:
Linux: As a Docker EE Admin, execute the following command using a Universal Control Plane (UCP) client bundle:
docker ps --quiet | xargs docker inspect --format '{{ .Id }}: Ports={{ .NetworkSettings.Ports }}'
Review the list and ensure that the ports mapped are the ones that are really needed for the container. If there are any mapped ports that aren't documented by the System Security Plan (SSP), then this is a finding.
V-235804
False
DKER-EE-001990
Ensure that mapped ports are the ones that are needed by the containers.
This check should be executed on all nodes in a Docker Enterprise cluster.
via CLI:
Linux: As a Docker EE Admin, execute the following command using a Universal Control Plane (UCP) client bundle:
docker ps --quiet | xargs docker inspect --format '{{ .Id }}: Ports={{ .NetworkSettings.Ports }}'
Review the list and ensure that the ports mapped are the ones that are really needed for the container. If there are any mapped ports that aren't documented by the System Security Plan (SSP), then this is a finding.
M
5281