From 1454b300a06f333968955974e522a7667d89d36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Thu, 14 Apr 2016 21:27:24 +0200 Subject: [PATCH] add 1.4 again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/1_host_configuration.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/1_host_configuration.sh b/tests/1_host_configuration.sh index b29abdc..e430853 100644 --- a/tests/1_host_configuration.sh +++ b/tests/1_host_configuration.sh @@ -22,6 +22,21 @@ else pass "$check_1_2" fi +# 1.4 +check_1_4="1.4 - Remove all non-essential services from the host - Network" +# Check for listening network services. +listening_services=$(netstat -na | grep -v tcp6 | grep -v unix | grep -c LISTEN) +if [ "$listening_services" -eq 0 ]; then + warn "1.4 - Failed to get listening services for check: $check_1_4" +else + if [ "$listening_services" -gt 5 ]; then + warn "$check_1_4" + warn " * Host listening on: $listening_services ports" +else + pass "$check_1_4" + fi +fi + # 1.5 check_1_5="1.5 - Keep Docker up to date" docker_version=$(docker version | grep -i -A1 '^server' | grep -i 'version:' \