From 986aaa67fbb3880d3772c59b16636264de0ee3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Fri, 21 Apr 2017 14:24:02 +0200 Subject: [PATCH] supress grep is auditd rules is missing 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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/1_host_configuration.sh b/tests/1_host_configuration.sh index 586966a..f6ec92a 100644 --- a/tests/1_host_configuration.sh +++ b/tests/1_host_configuration.sh @@ -50,10 +50,10 @@ if command -v auditctl >/dev/null 2>&1; then else warn "$check_1_5" fi -elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then - pass "$check_1_5" +elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + pass "$check_1_5" else - warn "$check_1_5" + warn "$check_1_5" fi # 1.6 @@ -66,7 +66,7 @@ if [ -d "$directory" ]; then else warn "$check_1_6" fi - elif grep "$directory" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$directory" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_6" else warn "$check_1_6" @@ -86,7 +86,7 @@ if [ -d "$directory" ]; then else warn "$check_1_7" fi - elif grep "$directory" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$directory" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_7" else warn "$check_1_7" @@ -106,7 +106,7 @@ if [ -f "$file" ]; then else warn "$check_1_8" fi - elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_8" else warn "$check_1_8" @@ -126,7 +126,7 @@ if [ -e "$file" ]; then else warn "$check_1_9" fi - elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_9" else warn "$check_1_9" @@ -146,7 +146,7 @@ if [ -f "$file" ]; then else warn "$check_1_10" fi - elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_10" else warn "$check_1_10" @@ -166,7 +166,7 @@ if [ -f "$file" ]; then else warn "$check_1_11" fi - elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_11" else warn "$check_1_11" @@ -186,7 +186,7 @@ if [ -f "$file" ]; then else warn "$check_1_12" fi - elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_12" else warn "$check_1_12" @@ -206,7 +206,7 @@ if [ -f "$file" ]; then else warn "$check_1_13" fi - elif grep "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then + elif grep -s "$file" "$auditrules" | grep "^[^#;]" 2>/dev/null 1>&2; then pass "$check_1_13" else warn "$check_1_13"