updated nftables state
This commit is contained in:
parent
abe739eb94
commit
891bf239ae
@ -5,11 +5,12 @@ from urllib.request import urlopen, Request
|
||||
|
||||
|
||||
def get_ips(url="https://ipbl.paulbsd.com"):
|
||||
"""get_jobs fetch jobs from dkron"""
|
||||
"""get_ips fetch ips blacklists from ipbl"""
|
||||
fullurl = f"{url}/ips"
|
||||
req = Request(method="GET", url=fullurl)
|
||||
res = urlopen(req)
|
||||
results = json.loads(res.read())
|
||||
ips = [i["ip"] for i in results]
|
||||
if res.status == 200:
|
||||
return results
|
||||
return ips
|
||||
return None
|
||||
|
@ -2,7 +2,7 @@
|
||||
{% set blackips = salt["bl.get_ips"]() %}
|
||||
|
||||
{% if blackips|length > 0 %}
|
||||
define blacklist = { {{ blackips.join(",") }} }
|
||||
define blacklist = { {{ blackips|join(", ") }} }
|
||||
{% else %}
|
||||
define blacklist = { 127.255.255.255 }
|
||||
{% endif %}
|
Loading…
Reference in New Issue
Block a user