[New Plugin] - net/os-netmap
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.2k
- Forks
- 863
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 10
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.
No
Describe the solution you'd like
Adds a new diagnostic plugin under Interfaces → Diagnostics → Network Map that renders an
interactive network topology as a tidy tree (default) or force-directed graph.
Host discovery
- Reads discovered hosts from the hostwatch SQLite DB (
/var/db/hostwatch/hosts.db,v_hostsview) — IPv4 only; IPv6 link-local addresses filtered out - Resolves hostnames via a three-source priority chain:
dnsmasq.leases→ Unbound PTR records (/var/unbound/host_entries.conf) → static DHCP mappings fromconfig.xml<dhcpd>(each source overwrites the previous)
VPN topology
- Parses
config.xmlfor OpenVPN server instances and reads their status logs (/tmp/openvpn_serverN_status.log) to enumerate connected clients - Parses WireGuard server/peer config from the
config.xmlOPNsense node
NetFlow enrichment
- Queries OPNsense Insight SQLite DBs (
/var/netflow/src_addr_*.sqlite) — selects the finest-granularity DB that covers the requested window (5 min / 1 h / 24 h / 7 d) direction='out'rows (router→host) mapped to download;direction='in'(host→router) to upload
Async nmap scan
scan_start.py(configd entry point) spawnsscan_run.pydetached so configd does not blockscan_run.pyre-validates IP and job UUID before exec; invokes nmap as asubprocesslist (no shell interpolation),--top-ports 1000 -sV -O- Rate-limited per IP (300 s) via a local SQLite DB at
/var/db/netmap_rate.sqlite - Scan target must be IPv4 and belong to a locally configured subnet
Describe alternatives you've considered
This is a new plugin, no alternative found.
Additional context
Implementation constraints
- Uses
\SQLite3PHP class directly —pdo_sqliteis absent on OPNsense 26.x; all handles openedSQLITE3_OPEN_READONLY - Cache files written atomically (tmp + rename): 60 s TTL for topology, 120 s for flow data
- Frontend uses the system
d3.min.js(D3 v3) —layout.tree,layout.force,svg.diagonal; no additional JS bundles required - All HTML output sanitised with
htmlspecialchars()/escH(); panel and canvas use CSS custom properties for OPNsense light/dark theme compatibility
AI disclosure
Developed with AI assistance: Claude Sonnet 4.6 (Anthropic) and Gemini Pro 3.1 (Google)
You can find the repo folder here: https://github.com/bitwire-it/os-netmap
Contributor 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.
Research direction
Start with CONTRIBUTING.md, then inspect the existing plugin structure and the mentioned scan_start.py and scan_run.py entry points. Trace the hostwatch, VPN, NetFlow and config.xml data sources before implementing the diagnostic page. Done means the plugin renders the requested topology and enrichment views while safely performing the asynchronous, rate-limited IPv4 scan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3js, javascript, php, sqlite
- Domain
- backend, databases, devtools, frontend, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100