feat(jail-config): add banaction and banaction_allports to blocklist config
Adds iptables-multiport and iptables-allports ban actions to the blocklist-import jail configuration and updates the corresponding test assertions.
This commit is contained in:
@@ -51,6 +51,8 @@ maxretry = 1
|
|||||||
findtime = 1d
|
findtime = 1d
|
||||||
bantime = 86400
|
bantime = 86400
|
||||||
ignoreip = 127.0.0.0/8 ::1 172.16.0.0/12
|
ignoreip = 127.0.0.0/8 ::1 172.16.0.0/12
|
||||||
|
banaction = iptables-multiport
|
||||||
|
banaction_allports = iptables-allports
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_BLOCKLIST_IMPORT_LOCAL = """\
|
_BLOCKLIST_IMPORT_LOCAL = """\
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ class TestEnsureJailConfigs:
|
|||||||
# Blocklist-import jail must have a 24-hour ban time
|
# Blocklist-import jail must have a 24-hour ban time
|
||||||
blocklist_conf = _read(jail_d, _BLOCKLIST_CONF)
|
blocklist_conf = _read(jail_d, _BLOCKLIST_CONF)
|
||||||
assert "bantime = 86400" in blocklist_conf
|
assert "bantime = 86400" in blocklist_conf
|
||||||
|
assert "banaction = iptables-multiport" in blocklist_conf
|
||||||
|
assert "banaction_allports = iptables-allports" in blocklist_conf
|
||||||
|
|
||||||
# .local files must set enabled = true and nothing else
|
# .local files must set enabled = true and nothing else
|
||||||
for local_file in (_MANUAL_LOCAL, _BLOCKLIST_LOCAL):
|
for local_file in (_MANUAL_LOCAL, _BLOCKLIST_LOCAL):
|
||||||
|
|||||||
Reference in New Issue
Block a user