mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
default capabilities are OK to add, closes #207
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
905c5719ef
commit
68ed3dd845
1 changed files with 4 additions and 1 deletions
|
@ -61,7 +61,10 @@ else
|
|||
|
||||
fail=0
|
||||
for c in $containers; do
|
||||
caps=$(docker inspect --format 'CapAdd={{ .HostConfig.CapAdd}}' "$c")
|
||||
container_caps=$(docker inspect --format 'CapAdd={{ .HostConfig.CapAdd}}' "$c")
|
||||
caps=$(echo "$container_caps" | tr "[:lower:]" "[:upper:]" | \
|
||||
sed 's/CAPADD/CapAdd/' | \
|
||||
sed -r "s/AUDIT_WRITE|CHOWN|DAC_OVERRIDE|FOWNER|FSETID|KILL|MKNOD|NET_BIND_SERVICE|NET_RAW|SETFCAP|SETGID|SETPCAP|SETUID|SYS_CHROOT|\s//g")
|
||||
|
||||
if [ "$caps" != 'CapAdd=' -a "$caps" != 'CapAdd=[]' -a "$caps" != 'CapAdd=<no value>' -a "$caps" != 'CapAdd=<nil>' ]; then
|
||||
# If it's the first container, fail the test
|
||||
|
|
Loading…
Reference in a new issue