docker-bench-security
docker-bench-security copied to clipboard
[Bug] 1.1.2 Users list empty (broken by filtration)
The following is in docker-bench-security/tests/1_host_configuration.sh:
docker_users=$(grep 'docker' /etc/group)
if command -v getent >/dev/null 2>&1; then
docker_users=$(getent group docker)
fi
docker_users=$(printf "%s" "$docker_users" | awk -F: '{print $4}')
docker_users=$(grep 'docker' /etc/group)=>docker:x:110:
docker_users=$(getent group docker)=>docker:x:110:
docker_users=$(printf "%s" "$docker_users" | awk -F: '{print $4}')=>``
The last line destroys the content of docker_users.
Originally thought it had to deal with getent, but it doesn't so ignore that part in the initial post.