mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-05-25 18:25:29 +00:00
more flexible binary usage, better support for mac os
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
375d32c0db
commit
8aec461d46
3 changed files with 16 additions and 3 deletions
|
@ -93,7 +93,11 @@ check_1_2_2() {
|
|||
starttestjson "$id_1_2_2" "$desc_1_2_2"
|
||||
|
||||
totalChecks=$((totalChecks + 1))
|
||||
docker_users=$(getent group docker)
|
||||
if command -v getent >/dev/null 2>&1; then
|
||||
docker_users=$(getent group docker)
|
||||
else
|
||||
docker_users=$(grep 'docker' /etc/group)
|
||||
fi
|
||||
info "$check_1_2_2"
|
||||
for u in $docker_users; do
|
||||
info " * $u"
|
||||
|
|
|
@ -63,7 +63,7 @@ check_7_3() {
|
|||
|
||||
totalChecks=$((totalChecks + 1))
|
||||
if docker info 2>/dev/null | grep -e "Swarm:*\sactive\s*" >/dev/null 2>&1; then
|
||||
ss -lnt | grep -e '\[::]:2377 ' -e ':::2377' -e '*:2377 ' -e ' 0\.0\.0\.0:2377 ' >/dev/null 2>&1
|
||||
$netbin -lnt | grep -e '\[::]:2377 ' -e ':::2377' -e '*:2377 ' -e ' 0\.0\.0\.0:2377 ' >/dev/null 2>&1
|
||||
if [ $? -eq 1 ]; then
|
||||
pass "$check_7_3"
|
||||
resulttestjson "PASS"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue