[Netfilter] Restart on invalid data via pubsub
parent
685433b3bf
commit
8bf9ee8308
|
@ -301,6 +301,7 @@ def watch():
|
||||||
pubsub.subscribe('F2B_CHANNEL')
|
pubsub.subscribe('F2B_CHANNEL')
|
||||||
|
|
||||||
while not quit_now:
|
while not quit_now:
|
||||||
|
try:
|
||||||
for item in pubsub.listen():
|
for item in pubsub.listen():
|
||||||
refreshF2bregex()
|
refreshF2bregex()
|
||||||
for rule_id, rule_regex in f2bregex.items():
|
for rule_id, rule_regex in f2bregex.items():
|
||||||
|
@ -316,6 +317,8 @@ def watch():
|
||||||
continue
|
continue
|
||||||
logWarn('%s matched rule id %s (%s)' % (addr, rule_id, item['data']))
|
logWarn('%s matched rule id %s (%s)' % (addr, rule_id, item['data']))
|
||||||
ban(addr)
|
ban(addr)
|
||||||
|
except Exception as ex:
|
||||||
|
logWarn('Could not read logline from pubsub, skipping...')
|
||||||
|
|
||||||
def snat4(snat_target):
|
def snat4(snat_target):
|
||||||
global lock
|
global lock
|
||||||
|
|
Loading…
Reference in New Issue