Repository navigation
feat(ns-api): add live trace troubleshooting API - #2007
Draft
gsanchietti wants to merge 52 commits into
Draft
gsanchietti wants to merge 52 commits into
gsanchietti wants to merge 52 commits into
Conversation
gsanchietti
force-pushed
the
live_trace
branch
2 times, most recently
from
November 10, 2026 13:16
7534d85 to
9142609
Compare
gsanchietti
force-pushed
the
live_trace
branch
2 times, most recently
from
November 10, 2026 13:53
3bf2808 to
2dd83af
Compare
Add a setup menu entry to open or close access to the web UI port 9090 from the WAN zone. Assisted-by: Claude Code:claude-sonnet-5-5
New images no longer expose the web UI port 9090 on WAN. Existing installations keep their current rule. Assisted-by: Claude Code:claude-sonnet-5-5
The menu was redrawn right after passwd, hiding its output. Show a dialog telling whether the password was changed. Assisted-by: Claude Code:claude-sonnet-5-5
Make the result of the password change and remote access toggle clear at a glance. Assisted-by: Claude Code:claude-opus-5-5
When a feed download failed, adblock logged the full feed URL to syslog. Nethesis DNS feeds configured by ns-threat_shield embed the subscription credentials as https://<system_id>:<secret>@bl.nethesis.it, so the secret ended up in /var/log/messages and in VictoriaLogs. Strip the user:password@ part before logging, keeping the host and path for debugging. Other URL outputs (etag debug line, JSON report, fetch parameters) do not include the feed URL. Assisted-by: Claude Code:claude-opus-5-5
Tbaile
force-pushed
the
release-8.9.0
branch
from
November 10, 2026 16:51
47c67d2 to
b88f978
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
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
feat(threat_shield): custom allow and block lists #2005
Build the UI from the head of the nethsecurity-ui release-8.9.0 branch, which has the Threat Shield custom lists pages. Replace it with the tagged UI release later. Assisted-by: Claude Code:Opus 5.5
gsanchietti
force-pushed
the
live_trace
branch
from
November 12, 2026 17:14
2dd83af to
5f7dfc1
Compare
Live trace lists only the connections of one client, so list_connections() now accepts extra conntrack arguments and returns an empty list when conntrack prints nothing. Assisted-by: Claude Code:claude-opus-5-5
Administrators cannot tell which firewall layer blocks a client. ns.livetrace traces one client for a limited time and reports the blocking layer and rule, DNS queries, live connections and routing hints, using nftables tracing and tcpdump. Assisted-by: Claude Code:claude-sonnet-5-5
Build the UI from the nethsecurity-ui firewall_debug branch to test the live trace page. Drop this commit before merging. Assisted-by: Claude Code:Opus 5.5
gsanchietti
force-pushed
the
live_trace
branch
from
November 17, 2026 10:10
a63a1c5 to
bbcb360
Compare
Tbaile
force-pushed
the
release-8.9.0
branch
from
November 19, 2026 13:24
cdc33d1 to
ecd8564
Compare
This branch has not been deployed
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.
When a client cannot reach something, administrators have to guess which part of the firewall is blocking it. Live trace follows one client IP address for a limited time and reports which layer stopped each new connection: a firewall rule or zone policy, Threat Shield IP (banIP) block lists, DPI (deep packet inspection) rules, the DNS filter or MAC binding. It also lists the client's DNS queries with their result and whether the DNS filter blocks them, its live connections, and routing hints such as a private address sent out to the WAN or a destination with no route.
The new
ns.livetraceAPI (start,stop,status) starts a background collector that marks the first packet of each new connection of the client with nftables tracing, reads the verdicts fromnft monitor traceand DNS traffic fromtcpdump, and writes the results to a state file. Sessions last 10 to 600 seconds, can be filtered by port and protocol, are rate limited, and clean up their nft table and helper processes when they end. The collector reloads its view of the rules when the firewall, banIP or DPI configuration changes during a session. Methods and limitations are documented inpackages/ns-api/README.md.The commit
chore(ns-ui): TEMP build UI from live trace branchbuilds the UI from the nethsecurity-uifirewall_debugbranch, which holds the live trace page, so the image can be tested end to end. It must be dropped before merging.How to test
api-cli ns.livetrace start --data '{"ip": "192.168.100.238", "duration": 120}'api-cli ns.livetrace statuslists each blocked connection with its layer, chain and rule name, the DNS queries withfilteredset for the blocked domain, and the open connectionsfw4 reload) or restart banIP during the session: connections opened afterwards still show the right rule nameapi-cli ns.livetrace stop, thenstatuslists the allowed connections of the session with the rule that accepted them; nons_livetracenft table,nft monitorortcpdumpprocess is leftSee also
Generated by Claude Code:claude-opus-5-5 with nethserver-pr