From 2f194aa495a3e857257b377fdc1944fcaa584f54 Mon Sep 17 00:00:00 2001 From: Athmane Madjoudj Date: Aug 27 2011 10:10:34 +0000 Subject: Add iptables tests --- diff --git a/tests/p_iptables/iptables_default_rules.sh b/tests/p_iptables/iptables_default_rules.sh new file mode 100755 index 0000000..2b8e5d9 --- /dev/null +++ b/tests/p_iptables/iptables_default_rules.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +t_Log "Running $0 - check iptables default rules" + +(grep "-m state --state ESTABLISHED,RELATED -j ACCEPT" /etc/sysconfig/iptables > /dev/null 2>&1 ) && \ + +(grep "-m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT" /etc/sysconfig/iptables > /dev/null 2>&1 ) && \ + +(grep "-j REJECT --reject-with icmp-host-prohibited" + /etc/sysconfig/iptables > /dev/null 2>&1 ) + +t_CheckExitStatus $? + diff --git a/tests/p_iptables/iptables_kmod_loaded.sh b/tests/p_iptables/iptables_kmod_loaded.sh new file mode 100755 index 0000000..bc0f4bd --- /dev/null +++ b/tests/p_iptables/iptables_kmod_loaded.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Author: Athmane Madjoudj + +t_Log "Running $0 - check if iptables kernel modules are loaded" + +lsmod | grep "ip_tables" > /dev/null 2>&1 + +t_CheckExitStatus $? +