Blame tests/p_iptables/iptables_default_rules.sh

Athmane Madjoudj 2f194a
#!/bin/bash
Athmane Madjoudj 2f194a
# Author: Athmane Madjoudj <athmanem@gmail.com>
Athmane Madjoudj 2f194a
Athmane Madjoudj 2f194a
t_Log "Running $0 - check iptables default rules"
Athmane Madjoudj 2f194a
39f042
if [ "$centos_ver" -ge 7 ];then
fa3726
 t_Log "CentOS $centos_ver uses firewalld and not iptables -> SKIP"
fa3726
 t_CheckExitStatus 0
fa3726
 exit 0
fa3726
fi
fa3726
Karanbir Singh 23b6ba
if [ $SKIP_QA_HARNESS -eq 1 ]; then
Athmane Madjoudj b45181
  echo "Skip, No standard firewall config ..."
Athmane Madjoudj b45181
else
Athmane Madjoudj b45181
Athmane Madjoudj 6e3daf
(grep "state --state ESTABLISHED,RELATED -j ACCEPT" /etc/sysconfig/iptables > /dev/null 2>&1 ) && \
Athmane Madjoudj 2f194a
Athmane Madjoudj 6e3daf
(grep "state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT" /etc/sysconfig/iptables > /dev/null 2>&1 ) && \
Athmane Madjoudj 2f194a
Athmane Madjoudj 6e3daf
(grep "REJECT --reject-with icmp-host-prohibited" /etc/sysconfig/iptables > /dev/null 2>&1 )
Athmane Madjoudj 2f194a
Athmane Madjoudj b45181
fi
Athmane Madjoudj b45181
Athmane Madjoudj 2f194a
t_CheckExitStatus $?
Athmane Madjoudj 2f194a