feat: persist ignoreip allowlist to jail.local (optional) - #2
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional Persist to jail.local toggle for the ignoreip allowlist. When on, add/remove also edits the
[DEFAULT] ignoreipline in jail.local so entries survive a fail2ban restart (runtimefail2ban-clientstill applies them immediately).services/jaillocal.pywith pure, fully-tested line transforms (add_ip/remove_ip/parse_entries) + best-effort IO that never raises.BASTION_JAIL_LOCALenv + commented compose mount.Test plan
python -m pytest -q→ 107 passed. New:tests/test_jaillocal.py(12), persist-integration cases intests/test_ignoreip.py.Summary by cubic
Adds an optional Persist to jail.local toggle for the ignoreip allowlist. When enabled, add/remove also updates the
[DEFAULT] ignoreipline injail.localso entries survive a fail2ban restart; runtime updates still apply immediately.BASTION_JAIL_LOCALenv; commented Docker volume example for read-write mount.services/jaillocal.pywith pure line transforms (parse_entries,add_ip,remove_ip) and best‑effort file IO that never raises.ignoreip.add/removenow persist when the setting is on; no-op persistence ifjail.localis missing or read-only, with a warning.Written for commit 2927aee. Summary will update on new commits.