OPNsense Forum

English Forums => Development and Code Review => Topic started by: BrownyMaster on December 06, 2026, 02:21:43 AM

Title: Live log: jump from log entry to rule, including NAT – feedback plugin/core hook
Post by: BrownyMaster on December 06, 2026, 02:21:43 AM
Hi all,
I would like to share a small project and ask for feedback before opening pull requests.

The problem. In Firewall → Log Files → Live View, entries of filter rules carry a rule id, so
the details dialog can link to the rule. NAT entries don't: the dialog shows nat rule
and an internal pf rule number, and finding the responsible outbound NAT rule or port forward means
comparing interfaces, addresses and aliases by hand. The same goes for automatic rules and UPnP
mappings, and pf numbers shift with every ruleset reload, so an older entry may point to a rule
that has moved since.

What I built. Live Rule Navigator, a plugin that adds an "Associated Rule" section to the
details dialog:

Screenshots, details and tests: https://github.com/Brownys/os-liverulenav
(https://github.com/Brownys/os-liverulenav/raw/main/docs/images/dialog-firewall-rule.png)

What it needs from core. One small extension point in the live log (17 lines): the details
dialog triggers a jQuery event firewall_log_details with the log record and the dialog body, and
the page loads scripts from www/js/diagnostics/fw_log/. Without such scripts nothing changes.

Patch: https://github.com/Brownys/core/compare/master...live-log-extension-point

Questions to the core team:

Tested on OPNsense 26.7 with IPv4/IPv6, PPPoE WAN, hybrid outbound NAT, port forwards and os-upnp.

Disclosure: the code was written with the help of Claude Code.
I specified the behaviour, reviewed the changes and tested everything on my own firewall.

Thanks for any feedback!
Stephan