mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
formating
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
d7f1d9753a
commit
17c6262d2f
3 changed files with 27 additions and 28 deletions
|
@ -478,4 +478,3 @@ check_1_2_end() {
|
||||||
check_1_end() {
|
check_1_end() {
|
||||||
endsectionjson
|
endsectionjson
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -299,13 +299,13 @@ check_3_10() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_10"
|
warn "$check_3_10"
|
||||||
warn " * Wrong permissions for $tlscacert"
|
warn " * Wrong permissions for $tlscacert"
|
||||||
resulttestjson "WARN" "Wrong permissions for $tlscacert"
|
resulttestjson "WARN" "Wrong permissions for $tlscacert"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_10"
|
info "$check_3_10"
|
||||||
info " * No TLS CA certificate found"
|
info " * No TLS CA certificate found"
|
||||||
resulttestjson "INFO" "No TLS CA certificate found"
|
resulttestjson "INFO" "No TLS CA certificate found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -331,13 +331,13 @@ check_3_11() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_11"
|
warn "$check_3_11"
|
||||||
warn " * Wrong ownership for $tlscert"
|
warn " * Wrong ownership for $tlscert"
|
||||||
resulttestjson "WARN" "Wrong ownership for $tlscert"
|
resulttestjson "WARN" "Wrong ownership for $tlscert"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_11"
|
info "$check_3_11"
|
||||||
info " * No TLS Server certificate found"
|
info " * No TLS Server certificate found"
|
||||||
resulttestjson "INFO" "No TLS Server certificate found"
|
resulttestjson "INFO" "No TLS Server certificate found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -363,13 +363,13 @@ check_3_12() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_12"
|
warn "$check_3_12"
|
||||||
warn " * Wrong permissions for $tlscert"
|
warn " * Wrong permissions for $tlscert"
|
||||||
resulttestjson "WARN" "Wrong permissions for $tlscert"
|
resulttestjson "WARN" "Wrong permissions for $tlscert"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_12"
|
info "$check_3_12"
|
||||||
info " * No TLS Server certificate found"
|
info " * No TLS Server certificate found"
|
||||||
resulttestjson "INFO" "No TLS Server certificate found"
|
resulttestjson "INFO" "No TLS Server certificate found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -395,13 +395,13 @@ check_3_13() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_13"
|
warn "$check_3_13"
|
||||||
warn " * Wrong ownership for $tlskey"
|
warn " * Wrong ownership for $tlskey"
|
||||||
resulttestjson "WARN" "Wrong ownership for $tlskey"
|
resulttestjson "WARN" "Wrong ownership for $tlskey"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_13"
|
info "$check_3_13"
|
||||||
info " * No TLS Key found"
|
info " * No TLS Key found"
|
||||||
resulttestjson "INFO" "No TLS Key found"
|
resulttestjson "INFO" "No TLS Key found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -427,13 +427,13 @@ check_3_14() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_14"
|
warn "$check_3_14"
|
||||||
warn " * Wrong permissions for $tlskey"
|
warn " * Wrong permissions for $tlskey"
|
||||||
resulttestjson "WARN" "Wrong permissions for $tlskey"
|
resulttestjson "WARN" "Wrong permissions for $tlskey"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_14"
|
info "$check_3_14"
|
||||||
info " * No TLS Key found"
|
info " * No TLS Key found"
|
||||||
resulttestjson "INFO" "No TLS Key found"
|
resulttestjson "INFO" "No TLS Key found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -455,13 +455,13 @@ check_3_15() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_15"
|
warn "$check_3_15"
|
||||||
warn " * Wrong ownership for $file"
|
warn " * Wrong ownership for $file"
|
||||||
resulttestjson "WARN" "Wrong ownership for $file"
|
resulttestjson "WARN" "Wrong ownership for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_15"
|
info "$check_3_15"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -483,13 +483,13 @@ check_3_16() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_16"
|
warn "$check_3_16"
|
||||||
warn " * Wrong permissions for $file"
|
warn " * Wrong permissions for $file"
|
||||||
resulttestjson "WARN" "Wrong permissions for $file"
|
resulttestjson "WARN" "Wrong permissions for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_16"
|
info "$check_3_16"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -511,13 +511,13 @@ check_3_17() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_17"
|
warn "$check_3_17"
|
||||||
warn " * Wrong ownership for $file"
|
warn " * Wrong ownership for $file"
|
||||||
resulttestjson "WARN" "Wrong ownership for $file"
|
resulttestjson "WARN" "Wrong ownership for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_17"
|
info "$check_3_17"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -539,13 +539,13 @@ check_3_18() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_18"
|
warn "$check_3_18"
|
||||||
warn " * Wrong permissions for $file"
|
warn " * Wrong permissions for $file"
|
||||||
resulttestjson "WARN" "Wrong permissions for $file"
|
resulttestjson "WARN" "Wrong permissions for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_18"
|
info "$check_3_18"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -567,13 +567,13 @@ check_3_19() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_19"
|
warn "$check_3_19"
|
||||||
warn " * Wrong ownership for $file"
|
warn " * Wrong ownership for $file"
|
||||||
resulttestjson "WARN" "Wrong ownership for $file"
|
resulttestjson "WARN" "Wrong ownership for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_19"
|
info "$check_3_19"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -595,13 +595,13 @@ check_3_20() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_20"
|
warn "$check_3_20"
|
||||||
warn " * Wrong ownership for $file"
|
warn " * Wrong ownership for $file"
|
||||||
resulttestjson "WARN" "Wrong ownership for $file"
|
resulttestjson "WARN" "Wrong ownership for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_20"
|
info "$check_3_20"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -623,13 +623,13 @@ check_3_21() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_21"
|
warn "$check_3_21"
|
||||||
warn " * Wrong permissions for $file"
|
warn " * Wrong permissions for $file"
|
||||||
resulttestjson "WARN" "Wrong permissions for $file"
|
resulttestjson "WARN" "Wrong permissions for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_21"
|
info "$check_3_21"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
@ -651,13 +651,13 @@ check_3_22() {
|
||||||
currentScore=$((currentScore + 1))
|
currentScore=$((currentScore + 1))
|
||||||
else
|
else
|
||||||
warn "$check_3_22"
|
warn "$check_3_22"
|
||||||
warn " * Wrong permissions for $file"
|
warn " * Wrong permissions for $file"
|
||||||
resulttestjson "WARN" "Wrong permissions for $file"
|
resulttestjson "WARN" "Wrong permissions for $file"
|
||||||
currentScore=$((currentScore - 1))
|
currentScore=$((currentScore - 1))
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "$check_3_22"
|
info "$check_3_22"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
resulttestjson "INFO" "File not found"
|
resulttestjson "INFO" "File not found"
|
||||||
currentScore=$((currentScore + 0))
|
currentScore=$((currentScore + 0))
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -12,7 +12,7 @@ check_5() {
|
||||||
check_running_containers() {
|
check_running_containers() {
|
||||||
# If containers is empty, there are no running containers
|
# If containers is empty, there are no running containers
|
||||||
if [ -z "$containers" ]; then
|
if [ -z "$containers" ]; then
|
||||||
info " * No containers running, skipping Section 5"
|
info " * No containers running, skipping Section 5"
|
||||||
running_containers=0
|
running_containers=0
|
||||||
else
|
else
|
||||||
running_containers=1
|
running_containers=1
|
||||||
|
|
Loading…
Reference in a new issue