From 92083d9d69841ab87823ab56f1ee11caf8379f94 Mon Sep 17 00:00:00 2001 From: pauget Date: Sun, 12 Dec 2004 13:53:49 +0100 Subject: [PATCH] Le firewall est en place sur komaz ! darcs-hash:20041212125349-41617-5d4af909c49123dd1040c8b0bb6b1f65376a5d06.gz --- gestion/gen_confs/firewall_komaz.py | 5 +++++ gestion/gen_confs/generate.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gestion/gen_confs/firewall_komaz.py b/gestion/gen_confs/firewall_komaz.py index 7ea226f3..ab285647 100755 --- a/gestion/gen_confs/firewall_komaz.py +++ b/gestion/gen_confs/firewall_komaz.py @@ -17,6 +17,9 @@ # MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR # PURPOSE. """ Firewall de Komaz """ +import sys +sys.path.append('/usr/scripts/gestion') + import syslog from lock import * from ldap_crans import crans_ldap, ann_scol, machine @@ -259,6 +262,8 @@ class firewall_komaz : iptables('-t nat -A TEST_VIRUS_FLOOD %s -j RETURN' % self.filtre_flood) # Les limites en négatif ca ne marche pas. self.anim.cycle() iptables('-t nat -A TEST_VIRUS_FLOOD -j LOG_FLOOD') + self.anim.reinit() + print OK def stop(self): """ Arrête le firewall """ diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index 8832e45b..8f11a59a 100755 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -30,7 +30,7 @@ elif hostname == 'nectaris' : args_autorises += [ 'conf_wifi', 'bornes_wifi=' , 'droits-nectaris', 'dhcp-nectaris'] elif hostname == 'sila' : args_autorises += [ 'bl_squid_upload', 'blacklist_virus' , 'blacklist_warez' , 'bl_chbre_invalide', 'bl_carte_etudiant' ] -elif hostname == 'egon' : +elif hostname == 'komaz' : args_autorises += [ 'firewall-komaz' , 'firewall-komaz-ports' , 'firewall-komaz-blacklist'] # On vérifie que l'on est root @@ -406,14 +406,14 @@ elif hostname == 'sila' : except: if auto: db.services_to_restart('bl_chbre_invalide') -elif hostname == 'egon' : +elif hostname == 'komaz' : if 'firewall-komaz' in to_do.keys() or \ 'firewall-komaz-ports' in to_do.keys() or \ 'firewall-komaz-blacklist' in to_do.keys() : - from classe_firewall import firewall_komaz + from firewall.komaz import firewall_komaz fw = firewall_komaz() fw.debug = debug - + cprint('Reconfiguration firewall','gras') if 'firewall-komaz' in to_do.keys() : if auto : db.services_to_restart('-firewall-komaz')