Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Light <eric@ericlight.com>2016-04-15 15:18:11 +0300
committerMichael Boelen <michael@cisofy.com>2016-04-15 15:18:11 +0300
commit9c2229483ff6b2a9a7f5ed7b4bda35e0c37c2406 (patch)
tree638ebaf3aad0cd8dba6bf475c36302e1c8d70cee /include/tests_tooling
parente86c68e3c54ae92329046745ce41aa2a74788f64 (diff)
Replaced call to iptables with $IPTABLESBINARY (#167)
* Replaced call to iptables with $IPTABLESBINARY * Check for iptables before checking Fail2Ban chain
Diffstat (limited to 'include/tests_tooling')
-rw-r--r--include/tests_tooling30
1 files changed, 14 insertions, 16 deletions
diff --git a/include/tests_tooling b/include/tests_tooling
index ad67292a..e3e86118 100644
--- a/include/tests_tooling
+++ b/include/tests_tooling
@@ -251,20 +251,23 @@
LogText "Checking for fail2ban iptables chains"
- CHECK_CHAINS=`iptables -L | grep fail2ban`
- if [ ! "${CHECK_CHAINS}" = "" ]; then
- LogText "Result: found at least one iptables chain for fail2ban"
- Display --indent 4 --text "- Checking for Fail2Ban iptables chain" --result OK --color GREEN
- else
- LogText "Result: Fail2Ban installed but iptables chain not present - fail2ban will not work"
+ if [ -f $IPTABLESBINARY ]; then
+
+ CHECK_CHAINS=`$IPTABLESBINARY -L | grep fail2ban` 2>&1
+ if [ ! "${CHECK_CHAINS}" = "" ]; then
+ LogText "Result: found at least one iptables chain for fail2ban"
+ Display --indent 4 --text "- Checking for Fail2Ban iptables chain" --result OK --color GREEN
+ else
+ LogText "Result: Fail2Ban installed but iptables chain not present - fail2ban will not work"
+ Display --indent 4 --text "- Checking for Fail2Ban iptables chain" --result WARNING --color RED
+ AddHP 0 3
+ ReportWarning "${TEST_NO}" "M" "Check config to see why iptables does not have a fail2ban chain" "$FAIL2BAN_CONFIG"
+ fi
+ else
Display --indent 4 --text "- Checking for Fail2Ban iptables chain" --result WARNING --color RED
- AddHP 0 3
- ReportWarning "${TEST_NO}" "M" "Check config to see why iptables does not have a fail2ban chain" "$FAIL2BAN_CONFIG"
+ ReportWarning "${TEST_NO}" "H" "iptables doesn't seem to be installed; Fail2Ban will not work" "$FAIL2BAN_CONFIG"
fi
-
-
fi
-
fi
# Test : TOOL-5014
@@ -284,11 +287,6 @@
fi
-
-
-
-
-
#
#################################################################################
#