diff --git a/gestion/gen_confs/firewall.py b/gestion/gen_confs/firewall.py index 7a94c408..54461ae1 100644 --- a/gestion/gen_confs/firewall.py +++ b/gestion/gen_confs/firewall.py @@ -482,9 +482,11 @@ class firewall_komaz(firewall_crans) : ('dc', 'DirectConnect'), ('kazaa', 'KaZaa'), ('ares', 'Ares'), + ('bit', 'Bittorrent'), ('gnu', 'GNUtella') ] - filtres_p2p_bloq = [ ('bit', 'Bittorrent'), ] + filtres_p2p_bloq = [ + ] ports_p2p = [ '412', '1214', '4662:4665' , '6346:6347', '6699', '6881:6889' ] diff --git a/surveillance/deconnexion.py b/surveillance/deconnexion.py index 55fab1ae..fe5a930b 100644 --- a/surveillance/deconnexion.py +++ b/surveillance/deconnexion.py @@ -427,8 +427,6 @@ for ip, id_p2p, nombre in fraudeurs: #s'il est averti if nombre <= p2p.limite[protocole] or [ip, protocole] in avertisp2p: continue - if id_p2p == 1: - continue # Récupération des ref de la machine machines = ldap.search('ipHostNumber=%s' % ip, 'w' )['machine'] @@ -470,7 +468,7 @@ for ip, id_p2p, nombre in fraudeurs: # Vérification du nombre de déconnexions ######################################### nb_decos = len([ x for x in proprio.blacklist() if int(x.split('$')[0]) > time()-365*24*3600 and x.split('$')[2] == 'autodisc_p2p' ]) - if nb_decos >= 3: + if nb_decos >= 3 and protocole != "Bittorrent": fichier_ps = generate_ps('p2p', proprio, ldap) # Envoi du mail à disconnect @@ -483,6 +481,9 @@ for ip, id_p2p, nombre in fraudeurs: mail.sendmail(p2p.expediteur, p2p.expediteur, corps) # L'adhérent n'est pas encore blacklisté - fin = int(time()) + 24*3600 + if protocole == "Bittorrent": + fin = int(time()) + 2*3600 + else: + fin = int(time()) + 24*3600 proprio.blacklist(['now', fin, 'autodisc_p2p', hostname]) proprio.save()