Fix BUG-001: resolve banaction interpolation error in fail2ban jails
The container init script (init-fail2ban-config) copies jail.conf from the image's /defaults/ on every start, overwriting any direct edits. The correct fix is jail.local, which is not present in the image defaults and therefore persists across restarts. Changes: - Add Docker/fail2ban-dev-config/fail2ban/jail.local with [DEFAULT] overrides for banaction = iptables-multiport and banaction_allports = iptables-allports. fail2ban loads jail.local after jail.conf so these values are available to all jails during %(action_)s interpolation. - Untrack jail.local from .gitignore so it is committed to the repo. - Fix TypeError in config_file_service: except jail_service.JailNotFoundError failed when jail_service was mocked in tests because MagicMock attributes are not BaseException subclasses. Import JailNotFoundError directly instead. - Mark BUG-001 as Done in Tasks.md.
This commit is contained in:
6
Docker/fail2ban-dev-config/fail2ban/jail.local
Normal file
6
Docker/fail2ban-dev-config/fail2ban/jail.local
Normal file
@@ -0,0 +1,6 @@
|
||||
# Local overrides — not overwritten by the container init script.
|
||||
# Provides banaction so all jails can resolve %(action_)s interpolation.
|
||||
|
||||
[DEFAULT]
|
||||
banaction = iptables-multiport
|
||||
banaction_allports = iptables-allports
|
||||
Reference in New Issue
Block a user