mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 08:42:33 +01:00
POSIX test command requires -S for UNIX domain sockets, fixes #94
Signed-off-by: Andreas Stieger <astieger@suse.com>
This commit is contained in:
parent
adf88311e0
commit
c5cb9cdc5c
1 changed files with 2 additions and 2 deletions
|
@ -386,7 +386,7 @@ fi
|
||||||
# 3.25
|
# 3.25
|
||||||
check_3_25="3.25 - Verify that Docker socket file ownership is set to root:docker"
|
check_3_25="3.25 - Verify that Docker socket file ownership is set to root:docker"
|
||||||
file="/var/run/docker.sock"
|
file="/var/run/docker.sock"
|
||||||
if [ -f "$file" ]; then
|
if [ -S "$file" ]; then
|
||||||
if [ "$(stat -c %u%g $file)" -eq 00 ]; then
|
if [ "$(stat -c %u%g $file)" -eq 00 ]; then
|
||||||
pass "$check_3_25"
|
pass "$check_3_25"
|
||||||
else
|
else
|
||||||
|
@ -401,7 +401,7 @@ fi
|
||||||
# 3.26
|
# 3.26
|
||||||
check_3_26="3.26 - Verify that Docker socket file permissions are set to 660"
|
check_3_26="3.26 - Verify that Docker socket file permissions are set to 660"
|
||||||
file="/var/run/docker.sock"
|
file="/var/run/docker.sock"
|
||||||
if [ -f "$file" ]; then
|
if [ -S "$file" ]; then
|
||||||
perms=$(ls -ld "$file" | awk '{print $1}')
|
perms=$(ls -ld "$file" | awk '{print $1}')
|
||||||
if [ "$perms" = "srw-rw----" ]; then
|
if [ "$perms" = "srw-rw----" ]; then
|
||||||
pass "$check_3_26"
|
pass "$check_3_26"
|
||||||
|
|
Loading…
Reference in a new issue