[gen_confs/firewall.py] blacklistage sur zamok, corrections
darcs-hash:20100530132203-bd074-e0cb6111ff6f6f54d99c3ff1f63fc2b8587baba8.gz
This commit is contained in:
parent
3bb3c56e55
commit
3530aa6b7f
1 changed files with 2 additions and 0 deletions
|
@ -1117,6 +1117,7 @@ class firewall_zamok(firewall_crans) :
|
|||
def blacklist(self):
|
||||
"""Fondamentalement, bloque l'accès internet sur zamok aux
|
||||
adhérents sanctionnés"""
|
||||
iptables("-F OUTPUT")
|
||||
self.filter_table()
|
||||
|
||||
blacklist_sanctions = ('upload', 'warez', 'p2p', 'autodisc_p2p', 'autodisc_upload', 'bloq')
|
||||
|
@ -1131,6 +1132,7 @@ class firewall_zamok(firewall_crans) :
|
|||
if s in sanctions:
|
||||
try:
|
||||
uid = adh.uidNumber()
|
||||
iptables("-A OUTPUT -m owner --uid-owner %s -d 127.0.0.1/8 -j ACCEPT" % uid)
|
||||
iptables("-A OUTPUT -m owner --uid-owner %s -d 138.231.136.1/21 -j ACCEPT" % uid)
|
||||
iptables("-A OUTPUT -m owner --uid-owner %s -d 138.231.144.1/21 -j ACCEPT" % uid)
|
||||
iptables("-A OUTPUT -m owner --uid-owner %s -j REJECT" % uid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue