Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Benjamin Graillot
scripts
Commits
7ab6f2bc
Commit
7ab6f2bc
authored
Nov 10, 2013
by
Valentin Samir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[firewall4] Methode pour recharger toutes les blacklists
parent
e55e04aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
gestion/gen_confs/firewall4/base.py
gestion/gen_confs/firewall4/base.py
+7
-1
gestion/gen_confs/firewall4/komaz.py
gestion/gen_confs/firewall4/komaz.py
+5
-0
gestion/gen_confs/firewall4/zamok.py
gestion/gen_confs/firewall4/zamok.py
+4
-0
No files found.
gestion/gen_confs/firewall4/base.py
View file @
7ab6f2bc
...
...
@@ -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'
...
...
gestion/gen_confs/firewall4/komaz.py
View file @
7ab6f2bc
...
...
@@ -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'
...
...
gestion/gen_confs/firewall4/zamok.py
View file @
7ab6f2bc
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment