[Netfilter][Watchdog] Use source IP for ban notification WHOIS lookups - #7383
Open
gitterdoneplease wants to merge 1 commit into
Open
[Netfilter][Watchdog] Use source IP for ban notification WHOIS lookups#7383gitterdoneplease wants to merge 1 commit into
gitterdoneplease wants to merge 1 commit into
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.
Contribution Guidelines
What does this PR include?
Short Description
Fail2ban can expand the address that triggered a ban into a configured network range, such as
/24. Watchdog currently passes that CIDR range towhois, which may not return useful registration data.This change stores the triggering IP in a separate Redis hash keyed by the banned network. Watchdog uses that IP for its WHOIS lookup and falls back to the network address when no source mapping is available.
F2B_ACTIVE_BANSremains keyed by the banned network, preserving existing firewall, Web UI, and unban behavior.This addresses #6843 and implements the separate-key approach discussed in #4759.
Affected Containers
Did you run tests?
What did you tested?
netfilter/main.pywith Python's AST parser.watchdog.shwithbash -n.docker-compose config --quiet.netfilter/main.py./24ban mapping and then observed multiple naturally generated ban notifications.What were the final results? (Awaited, got)
Expected:
Got: