fix: check_2_7 not working as intended

- #L152 use jq on first if statement, as it is used on the second if statement too (dependency already given)
- #L154 fixed key which is searched for
- fixed several wrongly placed closing brackets
This commit is contained in:
TBF + Partner AG 2024-11-19 23:13:23 +01:00 committed by GitHub
parent ff26d67f25
commit 30e2af962b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -149,16 +149,16 @@ check_2_7() {
local check="$id - $desc" local check="$id - $desc"
starttestjson "$id" "$desc" starttestjson "$id" "$desc"
if $(grep -qE "host.*tcp://" "$CONFIG_FILE") || \ if $(get_docker_configuration_file_args 'hosts' | grep 'tcp://' > /dev/null 2>&1) || \
[ $(get_docker_cumulative_command_line_args '-H' | grep -vE '(unix|fd)://') > /dev/null 2>&1 ]; then [ $(get_docker_cumulative_command_line_args '-H' | grep -vE '(unix|fd)://' > /dev/null 2>&1) ]; then
if [ $(get_docker_configuration_file_args '"tlsverify":' | grep 'true') ] || \ if [ $(get_docker_configuration_file_args 'tlsverify' | grep 'true') ] || \
[ $(get_docker_cumulative_command_line_args '--tlsverify' | grep 'tlsverify') >/dev/null 2>&1 ]; then [ $(get_docker_cumulative_command_line_args '--tlsverify' | grep 'tlsverify' >/dev/null 2>&1) ]; then
pass -s "$check" pass -s "$check"
logcheckresult "PASS" logcheckresult "PASS"
return return
fi fi
if [ $(get_docker_configuration_file_args '"tls":' | grep 'true') ] || \ if [ $(get_docker_configuration_file_args '"tls":' | grep 'true') ] || \
[ $(get_docker_cumulative_command_line_args '--tls' | grep 'tls$') >/dev/null 2>&1 ]; then [ $(get_docker_cumulative_command_line_args '--tls' | grep 'tls$' >/dev/null 2>&1) ]; then
warn -s "$check" warn -s "$check"
warn " * Docker daemon currently listening on TCP with TLS, but no verification" warn " * Docker daemon currently listening on TCP with TLS, but no verification"
logcheckresult "WARN" "Docker daemon currently listening on TCP with TLS, but no verification" logcheckresult "WARN" "Docker daemon currently listening on TCP with TLS, but no verification"