diff --git a/gestion/gen_confs/firewall.py b/gestion/gen_confs/firewall.py index ad966af8..86d73a09 100644 --- a/gestion/gen_confs/firewall.py +++ b/gestion/gen_confs/firewall.py @@ -867,6 +867,12 @@ class firewall_komaz(firewall_crans) : if not self.build_chaine('EXT_VERS_SERVEURS', self.__ext_vers_serveurs) : self.anim.reinit() print OK + # Attention les règles sont à l'envers. Hint '-I' + iptables("-I EXT_VERS_SERVEURS -p tcp --dport ssh -m state --state NEW -j ACCEPT") + iptables("-I EXT_VERS_SERVEURS -p tcp --dport ssh -m state --state NEW\ + -m recent --name SSH --update --seconds 60 --hitcount 4 --rttl -j DROP") + iptables("-I EXT_VERS_SERVEURS -p tcp --dport ssh -m state --state NEW\ + -m recent --name SSH --set") def crans_vers_ext(self) : """ Reconstruit la chaîne CRANS_VERS_EXT """ @@ -875,6 +881,12 @@ class firewall_komaz(firewall_crans) : def ext_vers_crans(self) : """ Reconstruit la chaîne EXT_VERS_CRANS """ self.build_chaine_adherent('EXT_VERS_CRANS',self.__ext_vers_crans) + # Attention les règles sont à l'envers. Hint '-I' + iptables("-I EXT_VERS_CRANS -p tcp --dport ssh -m state --state NEW -j ACCEPT") + iptables("-I EXT_VERS_CRANS -p tcp --dport ssh -m state --state NEW\ + -m recent --name SSH --update --seconds 60 --hitcount 4 --rttl -j DROP") + iptables("-I EXT_VERS_CRANS -p tcp --dport ssh -m state --state NEW\ + -m recent --name SSH --set") def admin_vlan(self) : """ Reconstruit la chaîne ADMIN_VLAN """