SV-235830r627617_rule
V-235830
SRG-APP-000342
DKER-EE-003200
CAT II
10
Set a non-root user for all container images.
Include the following line in all Dockerfiles where username or ID refers to the user that can be found in the container base image or one that is created as part of that same Dockerfile:
USER [username/ID]
Verify that all containers are running as non-root users.
via CLI: As a Docker EE admin, execute the following command using a client bundle:
docker ps -q -a | xargs docker inspect --format '{{ .Id }}: User={{ .Config.User }}'
Ensure that a non-admin username or user ID is returned for all containers in the output.
If User is 0, root or undefined, this is a finding.
V-235830
False
DKER-EE-003200
Verify that all containers are running as non-root users.
via CLI: As a Docker EE admin, execute the following command using a client bundle:
docker ps -q -a | xargs docker inspect --format '{{ .Id }}: User={{ .Config.User }}'
Ensure that a non-admin username or user ID is returned for all containers in the output.
If User is 0, root or undefined, this is a finding.
M
5281