From b5159c0c6895e1da0ec95318f03612e85aa02fd6 Mon Sep 17 00:00:00 2001 From: Olivier Huber Date: Sun, 4 Jul 2010 06:13:06 +0200 Subject: [PATCH] [./gestion/gen_confs/firewall6.py] les serveurs adm_only n'ont pas besoin de firewall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit et ceux à l'extérieur ont aussi une configuration totalement différente darcs-hash:20100704041306-8fbb1-78a115df7e24f45837128f1a2b6f30859af5abd0.gz --- gestion/gen_confs/firewall6.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gestion/gen_confs/firewall6.py b/gestion/gen_confs/firewall6.py index 716114ee..a26ea7c7 100755 --- a/gestion/gen_confs/firewall6.py +++ b/gestion/gen_confs/firewall6.py @@ -26,7 +26,7 @@ sys.path.append('/usr/scripts/gestion') from ldap_crans import hostname from config import conf_fw, mid, prefix, role, file_pickle, open_ports -from config import authorized_icmpv6, mac_wifi +from config import authorized_icmpv6, mac_wifi, adm_only from ipt import * # On invoque Ip6tables @@ -238,6 +238,14 @@ ACCEPT') def start(): ''' Démarre le firewall sur la machine considérée ''' + + # On véifie si le serveur n'est pas que sur le vlan adm. Dans ce cas on ne + # fait rien + + if hostname in adm_only: + print "Rien n'a faire, ce serveur est adm-only" + exit(0) + # On rempli machines global machines machines = db.all_machines(graphic = True) @@ -252,6 +260,10 @@ def start(): # On recherche si la machine a des attributs particuliers. if hostname in role.keys(): + if 'external' in role[hostname]: + print "Il faut encore implémenter un firewall pour les serveurs à \ + l'extérieur du réseau Cr@ns" + exit(0) if 'sniffer' not in role[hostname]: basic_fw() for func in role[hostname]: