Repository navigation
feat(threat_shield): custom allow and block lists - #2003
Merged
Merged
Conversation
This was referenced Nov 6, 2026
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
4 times, most recently
from
November 10, 2026 10:12
719973b to
9f6e2c3
Compare
Tbaile
force-pushed
the
release-8.9.0
branch
from
November 10, 2026 16:51
47c67d2 to
b88f978
Compare
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
3 times, most recently
from
November 11, 2026 10:16
f140bd5 to
d207ca2
Compare
gsanchietti
marked this pull request as ready for review
November 11, 2026 10:29
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
from
November 11, 2026 11:26
d207ca2 to
26756b5
Compare
The threat_shield inventory fact reports the number of enabled custom allowlist URLs and custom blocklists. Refs #2005 Assisted-by: Claude Code:claude-opus-5-5
ns.threatshield manages remote allowlist URLs and custom blocklists, and lists the Nethesis global allowlist as a read-only built-in row, enabled only with a subscription. Edits replace the whole entry. Custom list names can't clash with builtin feeds, and a custom list is always listed as custom. Threat Shield IP status no longer depends on the Nethesis allowlist URL. Refs #2005 Assisted-by: Claude Code:claude-opus-5-5
ts-ip rebuilds ban_allowurl and banip.custom.feeds from the ns_allowurl and ns_blockfeed sections. Legacy ban_allowurl entries are moved once to ns_allowurl sections, also on upgrade. The post-commit hook runs ts-ip and drops the banIP backups of lists whose URL changed; ts-fail2ban runs once per commit. On upgrade the feed copy is refreshed without starting fail2ban. Refs #2005 Assisted-by: Claude Code:claude-opus-5-5
A non-empty banip.custom.feeds holds a copy of banip.feeds and banIP reads only that file, so rerun ts-ip after a banip upgrade to pick up new or changed upstream feeds. Refs #2005 Assisted-by: Claude Code:claude-opus-5-5
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
2 times, most recently
from
November 11, 2026 17:01
a1d2a45 to
eef7242
Compare
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
4 times, most recently
from
November 12, 2026 08:07
13fcde6 to
8d7bd3a
Compare
Tbaile
approved these changes
Nov 12, 2026
Tbaile
left a comment
Collaborator
There was a problem hiding this comment.
There's no way to have some sort of notice if a list fails the download? Making them look into the logs is going to hurt us in the end 😢
The Threat Shield IP page had nothing to show when fail2ban banned nobody, even while banIP lists dropped traffic all the time. New method list-blocklist-bans: the addresses dropped by banIP lists in the last hour, read from VictoriaLogs, one row per address, list and direction, most hits first, at most 500 rows. It returns an empty list when VictoriaLogs can't be reached. Assisted-by: Claude Code:Opus 5.5
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
from
November 12, 2026 09:50
8d7bd3a to
e4f07d9
Compare
Member
Author
Yes, only if we drop banip 😈 |
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
from
November 12, 2026 09:58
e4f07d9 to
7e926a1
Compare
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
from
November 12, 2026 10:32
7e926a1 to
6ca2196
Compare
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
from
November 12, 2026 10:37
6ca2196 to
27c682e
Compare
m-dilorenzi
approved these changes
Nov 12, 2026
gsanchietti
force-pushed
the
custom_allowlist_blocklist
branch
from
November 12, 2026 13:25
27c682e to
8cf53a8
Compare
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.
Threat Shield IP only accepts the Nethesis feeds and the banIP built-in feeds. Administrators asked to add their own remote lists of IP addresses to block or to never block. Refs #2005.
This adds custom allowlists and custom blocklists, both downloaded from a URL. They work with or without a subscription. The Nethesis global allowlist is shown as a fixed row in the allowlists: enabled with a subscription, disabled without one, and it can't be changed or deleted. Existing configurations keep working: old hand-made allowlist URLs become custom allowlist rows on upgrade.
ns.threatshield: new methods to list, add, edit and delete allowlist URLs and custom blocklists. Onlyhttp/httpsURLs with safe characters are accepted.ts-iprebuilds the banIP allowlist and feed settings from the configuration, so changes apply right after saving.list-blocklist-bans: the addresses dropped by banIP lists in the last hour, read from VictoriaLogs, one row per address, most hits first (at most 500). The Threat Shield IP page shows them in a new tab, so it no longer looks empty when nothing triggers fail2ban.How to test
nft list set inet banIP allowlist.v4andnft list set inet banIP <name>.v4contain the list addresses.ban_allowurlentry: it shows up as a custom allowlist namedallow1.ubus call ns.threatshield list-blocklist-bans: it lists the banned addresses with their list, direction, hits and last seen time.See also
The
chore(ns-ui): TEMPcommit builds the UI from NethServer/nethsecurity-ui#852: drop it before merging.Generated by Claude Code:claude-haiku-5-5 with nethserver-pr