From 7ebe21823d971e29886c124a1a859a78e885b1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 23 Oct 2017 15:41:03 +0200 Subject: [PATCH] add score and totalChecks to 6_ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/6_docker_security_operations.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/6_docker_security_operations.sh b/tests/6_docker_security_operations.sh index 52979e7..c09a833 100644 --- a/tests/6_docker_security_operations.sh +++ b/tests/6_docker_security_operations.sh @@ -5,6 +5,7 @@ info "6 - Docker Security Operations" # 6.1 check_6_1="6.1 - Avoid image sprawl" +totalChecks=$((totalChecks + 1)) images=$(docker images -q | sort -u | wc -l | awk '{print $1}') active_images=0 @@ -21,9 +22,11 @@ if [ "$active_images" -lt "$((images / 2))" ]; then info " * Only $active_images out of $images are in use" logjson "6.1" "INFO: $active_images" fi +currentScore=$((currentScore + 0)) # 6.2 check_6_2="6.2 - Avoid container sprawl" +totalChecks=$((totalChecks + 1)) total_containers=$(docker info 2>/dev/null | grep "Containers" | awk '{print $2}') running_containers=$(docker ps -q | wc -l | awk '{print $1}') diff="$((total_containers - running_containers))" @@ -36,3 +39,4 @@ else info " * There are currently a total of $total_containers containers, with $running_containers of them currently running" logjson "6.2" "INFO: $running_containers" fi +currentScore=$((currentScore + 0))