Add trusted IP and network management to Fail2Ban - #279
Merged
Conversation
Owner
|
@Vaso73 solid piece of work. A few things worth calling out:
Reviewing shortly. |
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
Add a global trusted IP/network allowlist to the Fail2Ban section of the Monitor Security page. Administrators can add, edit, and remove IPv4, IPv6, or CIDR entries that Fail2Ban must never ban across the
sshd,proxmox, andproxmenuxjails.Implementation
/etc/fail2ban/jail.d/99-proxmenux-ignore.local[DEFAULT] ignoreipvalues from/etc/fail2ban/jail.localon first use127.0.0.0/8and::1protected and non-removableipaddress/0, multicast, unspecified, duplicate, and already-covered entriesUI
Validation
python3 -m unittest scripts/tests/test_fail2ban_trusted_networks.py -q— 12 tests passednpm run build— passedsshd,proxmox, andproxmenuxSafety notes
The allowlist is global by design so an administrator cannot assume an address is trusted while one jail still bans it. Broad networks are allowed only after an explicit warning;
/0is rejected. Existing configuration is rolled back automatically when Fail2Ban rejects a reload.