Le firewall est en place sur komaz !

darcs-hash:20041212125349-41617-5d4af909c49123dd1040c8b0bb6b1f65376a5d06.gz
This commit is contained in:
pauget 2004-12-12 13:53:49 +01:00
parent 74e4c5de26
commit 92083d9d69
2 changed files with 9 additions and 4 deletions

View file

@ -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 """

View file

@ -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')