mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
add 1.2.9, #ref https://github.com/docker/docker-bench-security/pull/359
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
6105f02a16
commit
28f16f0afd
1 changed files with 36 additions and 1 deletions
|
@ -319,7 +319,42 @@ check_1_2_8() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 1.2.9 Ensure auditing is configured for Docker files and directories -/etc/sysconfig/docker (Scored)
|
# 1.2.9
|
||||||
|
check_1_2_9() {
|
||||||
|
id_1_2_9="1.2.9"
|
||||||
|
desc_1_2_9="Ensure auditing is configured for Docker files and directories - /etc/sysconfig/docker"
|
||||||
|
check_1_2_9="$id_1_2_9 - $desc_1_2_9"
|
||||||
|
starttestjson "$id_1_2_9" "$desc_1_2_9"
|
||||||
|
|
||||||
|
totalChecks=$((totalChecks + 1))
|
||||||
|
file="/etc/sysconfig/docker"
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
if command -v auditctl >/dev/null 2>&1; then
|
||||||
|
if auditctl -l | grep $file >/dev/null 2>&1; then
|
||||||
|
pass "$check_1_2_9"
|
||||||
|
resulttestjson "PASS"
|
||||||
|
currentScore=$((currentScore + 1))
|
||||||
|
else
|
||||||
|
warn "$check_1_2_9"
|
||||||
|
resulttestjson "WARN"
|
||||||
|
currentScore=$((currentScore - 1))
|
||||||
|
fi
|
||||||
|
elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then
|
||||||
|
pass "$check_1_2_9"
|
||||||
|
resulttestjson "PASS"
|
||||||
|
currentScore=$((currentScore + 1))
|
||||||
|
else
|
||||||
|
warn "$check_1_2_9"
|
||||||
|
resulttestjson "WARN"
|
||||||
|
currentScore=$((currentScore - 1))
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
info "$check_1_2_9"
|
||||||
|
info " * File not found"
|
||||||
|
resulttestjson "INFO" "File not found"
|
||||||
|
currentScore=$((currentScore + 0))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# 1.2.10
|
# 1.2.10
|
||||||
check_1_2_10() {
|
check_1_2_10() {
|
||||||
|
|
Loading…
Reference in a new issue