mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
Deprecate rule 2.16 for Docker > 19.03
The upcoming 20.x docker release will always have experimental features enabled, which will stop this test from working. More details can be found in docker/cli##2774 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f3e9c791ce
commit
0f3dfe70fe
1 changed files with 17 additions and 7 deletions
|
@ -387,20 +387,30 @@ check_2_15() {
|
||||||
|
|
||||||
# 2.16
|
# 2.16
|
||||||
check_2_16() {
|
check_2_16() {
|
||||||
|
docker_version=$(docker version | grep -i -A2 '^server' | grep ' Version:' \
|
||||||
|
| awk '{print $NF; exit}' | tr -d '[:alpha:]-,.' | cut -c 1-4)
|
||||||
|
|
||||||
id_2_16="2.16"
|
id_2_16="2.16"
|
||||||
desc_2_16="Ensure that experimental features are not implemented in production (Scored)"
|
desc_2_16="Ensure that experimental features are not implemented in production (Scored)"
|
||||||
check_2_16="$id_2_16 - $desc_2_16"
|
check_2_16="$id_2_16 - $desc_2_16"
|
||||||
starttestjson "$id_2_16" "$desc_2_16"
|
starttestjson "$id_2_16" "$desc_2_16"
|
||||||
|
|
||||||
totalChecks=$((totalChecks + 1))
|
totalChecks=$((totalChecks + 1))
|
||||||
if docker version -f '{{.Server.Experimental}}' | grep false 2>/dev/null 1>&2; then
|
if [ "$docker_version" -le 1903 ]; then
|
||||||
pass "$check_2_16"
|
if docker version -f '{{.Server.Experimental}}' | grep false 2>/dev/null 1>&2; then
|
||||||
resulttestjson "PASS"
|
pass "$check_2_16"
|
||||||
currentScore=$((currentScore + 1))
|
resulttestjson "PASS"
|
||||||
|
currentScore=$((currentScore + 1))
|
||||||
|
else
|
||||||
|
warn "$check_2_16"
|
||||||
|
resulttestjson "WARN"
|
||||||
|
currentScore=$((currentScore - 1))
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
warn "$check_2_16"
|
desc_2_16="$desc_2_16 (Deprecated)"
|
||||||
resulttestjson "WARN"
|
check_2_16="$id_2_16 - $desc_2_16"
|
||||||
currentScore=$((currentScore - 1))
|
info "$desc_2_16"
|
||||||
|
resulttestjson "INFO"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue