misc/sonar: new plugin, dashboard widget that visualises the live firewall log
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 8/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, php
Research direction
This is a proposal for a new plugin, not a defined change. Start with the existing Firewall widget that reads /api/diagnostics/firewall/stream_log and with the proposed layout under misc/sonar (Makefile, src/opnsense/www/js/widgets/Sonar.js, Metadata/Sonar.xml). Done means maintainers answer the four questions on category, GeoIP handling, existing country-lookup APIs and the map data, and the author splits the work into reviewable PRs.
Written by the indexing model from the issue text.
Description
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- When the request is meant for an existing plugin, I've added its name to the title.
Is your feature request related to a problem? Please describe.
Hi, before opening a PR I'd like your feedback on a new plugin. Our community is crucial in shaping the ongoing development of our open-source OPNsense® software products.
The Firewall widget shows the live log as a list of lines. That is precise, but it is hard to see at a glance where traffic is coming from, which ports are being probed and what the firewall is blocking right now.
Describe the solution you'd like
What it is
Sonar is a dashboard widget that turns the live firewall log into a picture of what is happening right now. It reads the same stream as the Firewall widget (/api/diagnostics/firewall/stream_log) and only uses existing read-only core endpoints (interface names, interface overview, system resources, CPU and traffic streams). It changes no configuration.
Views, switched by a small selector in the widget header:
| View | What it shows |
|---|---|
| Sonar | a tilted radar disc with a rotating sweep; each remote address is a blip (green pass, red block, blue NAT), inbound on the outer ring, outbound on the inner one |
| Map | a world map with animated arcs from origin to destination and the country flag; blocked inbound connections fly as small missiles and are intercepted on a shield around the firewall |
| Flow | a live Sankey diagram: origin (country or local hosts) → interface → service (port) → decision (pass, NAT or the blocking rule) |
| Citadel | the network as an isometric city under an energy dome: one district per interface, one building per local host; blocked inbound traffic hits the dome as meteors, outbound traffic rises as beams |
| Black hole | the firewall as a black hole; each remote address is a star in orbit, and every blocked connection spirals into the event horizon; stars of the same country form constellations |
| Digital rain | one column per destination port; each event falls as a drop coloured by action, blocked drops shatter on the firewall floor, so a port scan shows up as a storm |
Common to all views:
- a side panel when the widget is wide: events and blocks in the last 60 s, inbound/outbound split, top attacking countries, most targeted ports, top blocking rules, last attacks;
- hover shows country, address, port, direction and rule label; click opens Live View filtered on that address, like the Firewall widget;
- a fullscreen button, and optional sound cues (off by default);
- plain Canvas 2D, no new JavaScript libraries; animation pauses when the tab is hidden; colours come from the active theme, so it works with light and dark themes; reduced motion is respected.
Package
misc/sonar/ (or another category you prefer)
Makefile PLUGIN_NAME=sonar, PLUGIN_VERSION=1.0
pkg-descr
src/opnsense/www/js/widgets/Sonar.js (+ one file per view)
src/opnsense/www/js/widgets/Metadata/Sonar.xml
src/opnsense/www/js/widgets/Sonar-map.json Natural Earth 1:110m outlines, public domain, ~140 KB
+ a small read-only API for the country lookup (below)
About 4,300 lines of JavaScript for the six views. I'm happy to split it: first PR with the Sonar view only, then the map and flow views, then the others.
Dependencies and setup (for users)
-
Logging on rules. Sonar only sees what the firewall logs: enable "Log packets" on the rules you want to watch (Firewall → Rules); default block rules already log.
-
Country data (Map, Flow, Black hole, flags). Uses the free MaxMind GeoLite2 database with the user's own account, exactly as described in the MaxMind GeoIP setup how-to:
- create a free account at maxmind.com (GeoLite2 sign-up);
- generate a license key ("My License Key", answer "no" to geoipupdate);
- in Firewall → Aliases → GeoIP settings, enter
https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=<LICENSE_KEY>&suffix=zipand Apply; - create at least one GeoIP alias, so the lists are downloaded.
Without it the Sonar, Citadel and Digital rain views work normally; the country-based views show a hint pointing to those settings.
-
No other packages. No external services, no telemetry, nothing leaves the firewall.
GeoIP data
The plugin will not ship any GeoIP-derived data. MaxMind requires every user of their lists to have an account and accept their terms, so countries are resolved on the firewall from the lists each user already downloads with their own key (/usr/local/share/GeoIP/alias/), through a small read-only endpoint in the plugin. In my local build the widget used a compact table generated from my own lists; that file stays out of the package.
Questions before I open the PR
- Is a plugin the right place, and is
misc/sonar(packageos-sonar) a good category and name? - Is resolving countries server-side from the user's own GeoIP lists acceptable, and should the widget show the attribution "This product includes GeoLite2 data created by MaxMind" when the map is visible?
- Is there already an API that maps an address to a country from the GeoIP alias data that I should reuse instead of adding one?
- Is shipping the public-domain map outlines as a static JSON file next to the widget fine?
I'm happy to maintain the plugin. Maintainer: igortoledo007 (please reach me here on GitHub).
Describe alternatives you've considered
- Proposing it to core: as an optional plugin it stays out of the way of users who don't want it, like the Tailscale, vnStat and Wake on LAN widgets.
- The Insight / Reporting pages: they show history and totals, not what is happening right now.
Additional context
AI disclosure
Developed with AI assistance: Claude (Anthropic), a mix of the Fable 5.2 and Opus 5.5 models. I reviewed and tested it on my own OPNsense 26.7.9 firewall.
Screenshots
Taken on my own firewall running OPNsense 26.7.9 (Forja theme from #5921), fullscreen except the first; addresses, interface, gateway and host names are blurred.
- The widget on the dashboard (Map view)
- Sonar
- Map
- Flow
- Citadel
- Black hole
- Digital rain
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 926
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 25
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opnsense/plugins
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
opnsense/plugins#5976 · 1 comment ·
Maintainers usually reply within 1 day
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directiveOpenincomplete
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
opnsense/plugins#5973 · 1 comment ·
Maintainers usually reply within 1 day
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)Possibly taken @bringha1 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
q-feeds-connector: "error in configd communication" every update when the Unbound DNSBL rebuild takes longer than 120sPossibly taken @mhatipog claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
All issues in opnsense/plugins
Similar issues
-
15.0
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/opentelemetry-php-distro#176 ·
Maintainers usually reply within 2 days
-
No Code Attached Yet
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
joomla/joomla-cms#48941 ·
Maintainers usually reply within 1 day
-
needs-triage Platform(Default)
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug new
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
moodle-an-hochschulen/moodle-theme_boost_union#1500 ·
Maintainers usually reply within 1 day