mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
move old 2.13 to community checks
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
d963b93fcc
commit
82644982a8
1 changed files with 33 additions and 0 deletions
|
@ -21,6 +21,39 @@ check_c_1() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check_c_2
|
||||||
|
check_c_2() {
|
||||||
|
docker_version=$(docker version | grep -i -A2 '^server' | grep ' Version:' \
|
||||||
|
| awk '{print $NF; exit}' | tr -d '[:alpha:]-,.' | cut -c 1-4)
|
||||||
|
totalChecks=$((totalChecks + 1))
|
||||||
|
|
||||||
|
id_c_2="C.2"
|
||||||
|
desc_c_2="Ensure operations on legacy registry (v1) are Disabled"
|
||||||
|
check_c_2="$id_c_2 - $desc_c_2"
|
||||||
|
starttestjson "$id_c_2" "$desc_c_2"
|
||||||
|
|
||||||
|
if [ "$docker_version" -lt 1712 ]; then
|
||||||
|
if get_docker_configuration_file_args 'disable-legacy-registry' | grep 'true' >/dev/null 2>&1; then
|
||||||
|
pass "$check_c_2"
|
||||||
|
resulttestjson "PASS"
|
||||||
|
currentScore=$((currentScore + 1))
|
||||||
|
elif get_docker_effective_command_line_args '--disable-legacy-registry' | grep "disable-legacy-registry" >/dev/null 2>&1; then
|
||||||
|
pass "$check_c_2"
|
||||||
|
resulttestjson "PASS"
|
||||||
|
currentScore=$((currentScore + 1))
|
||||||
|
else
|
||||||
|
warn "$check_c_2"
|
||||||
|
resulttestjson "WARN"
|
||||||
|
currentScore=$((currentScore - 1))
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
desc_c_2="$desc_c_2 (Deprecated)"
|
||||||
|
check_c_2="$id_c_2 - $desc_c_2"
|
||||||
|
info "$check_c_2"
|
||||||
|
resulttestjson "INFO"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_c_end() {
|
check_c_end() {
|
||||||
endsectionjson
|
endsectionjson
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue