Commit 7ab6f2bc authored by Valentin Samir's avatar Valentin Samir

[firewall4] Methode pour recharger toutes les blacklists

parent e55e04aa
......@@ -29,9 +29,10 @@ class firewall(utils.firewall_tools) :
self.reloadable = {
'blacklist_hard' : self.blacklist_hard,
'test_mac_ip' : self.test_mac_ip,
'blacklists' : self.blacklists,
}
self.use_ipset = [self.blacklist_hard, self.test_mac_ip]
self.use_ipset = [self.blacklist_hard, self.test_mac_ip, self.blacklists]
self.ipset['mac_ip']={
'adh' : Ipset("MAC-IP-ADH","macipmap","--from 138.231.136.0 --to 138.231.151.255"),
......@@ -48,6 +49,11 @@ class firewall(utils.firewall_tools) :
"""Met à jours les blacklists pour les ip présentent dans la liste ``ips``"""
self.blacklist_hard_maj(ips)
def blacklists(self, table=None, fill_ipset=False, apply=False):
"""Recharge toutes les blacklists"""
self.blacklist_hard(table=table, fill_ipset=fill_ipset, apply=apply)
def raw_table(self):
"""Génère les règles pour la table ``raw`` et remplis les chaines de la table"""
table = 'raw'
......
......@@ -46,6 +46,11 @@ class firewall(base.firewall_routeur):
self.blacklist_soft_maj(ips)
self.blacklist_upload_maj(ips)
def blacklists(self, table=None, fill_ipset=False, apply=False):
self.blacklist_hard(table=table, fill_ipset=fill_ipset, apply=apply)
self.blacklist_soft(table=table, fill_ipset=fill_ipset, apply=apply)
self.blacklist_upload(table=table, fill_ipset=fill_ipset, apply=apply)
def raw_table(self):
"""Génère les règles pour la table ``raw`` et remplis les chaines de la table"""
table = 'raw'
......
......@@ -89,6 +89,10 @@ class firewall(base.firewall):
self.blacklist_output('filter', apply=True)
self.blacklist_hard_maj(ips)
def blacklists(self, table=None, fill_ipset=False, apply=False):
self.blacklist_hard(table=table, fill_ipset=fill_ipset, apply=apply)
self.blacklist_output(table=table, apply=apply)
def blacklist_output(self, table=None, apply=False):
"""Empêche les gens blacklisté d'utiliser zamok comme relaie"""
chain='BLACKLIST-OUTPUT'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment