syn

Setting up Syn

This guide takes you from a fresh clone to a working install: a scheduled review job (collect, analyze, correlation review), an urgent watcher (the Elasticsearch pull, once per event window, default 5 min), the HTTPS dashboard with phone push alerts, and the optional Ask AI chat.

Syn is read-only against your network. It queries Elasticsearch and the UniFi cloud API, and it never changes Security Onion, the gateway or any device.

architecture


0. What you need

Component Required? Used for
Linux host with Docker, Python 3.10+ at /usr/bin/python3, git, openssl, systemd (user services) yes runs the scheduler, the host broker and the dashboard container
AI provider with an API key: any OpenAI-compatible API (OpenAI, OpenRouter, Groq, Mistral, Together, DeepSeek, Gemini’s OpenAI endpoint, vLLM…) or Anthropic recommended event research (Send to research) and the chat. Pick a strong model that supports tool calling. The watcher (every event window, default 5 min) uses no LLM.
Local OpenAI-compatible model server (any server offering /v1/chat/completions with JSON-schema structured output, e.g. llama.cpp, vLLM, SGLang, Ollama) optional, recommended the event reviewer (called continuously, so a local model saves API cost); can also serve the review job or chat
Decision-model server (System One API, /v1/systemone, on loopback: llama.cpp llama-server or SGLang) optional, recommended decides correlation links and labels events, see CORRELATION.md. Off = the event reviewer decides links
Security Onion 2.4 (or any Elasticsearch with the same Suricata/Zeek data streams) yes network sensor and data store
Elastic Agent via Fleet on your endpoints (Elastic Defend + osquery integrations) recommended endpoint findings, host posture
UniFi gateway + UniFi Site Manager API key optional gateway IDS, admin audit, flows. Skipped when missing.
UniFi DHCP export CSV optional friendly device names. Without it, names come from DHCP/DNS.
Cloudflare Tunnel (or any reverse proxy) optional reach the dashboard and receive push notifications away from home

The host needs no extra Python packages: everything is the standard library. The dashboard image installs its own dependencies. The exact interface each part must offer (APIs, structured output, tool calling, context sizes, key privileges) is listed in ARCHITECTURE.md → Requirements by component.

1. Clone and run setup

The repo can live anywhere; the scripts find their own folder. This guide uses ~/netmon:

git clone <this repository's clone URL> ~/netmon
cd ~/netmon
./setup.sh

setup.sh is safe to re-run. It never overwrites existing files. It:

./setup.sh --check only reports what is present or missing.

2. Describe your network (the Settings page)

All network-specific values live in the Syn database (dashboard/state/netmon.db, table cfg), never in git and never in JSON files. setup.sh loads the *.example.json templates as a starting point; after the dashboard is running, an admin edits them as tables on More → Settings (tabs: Network policy, Endpoint policy, Known benign, Site). Changes save automatically as you edit (there is no Save button) and the server rejects invalid values (bad regexes, an allow rule without a source or destination, a bad network range). Jobs read the new values on their next run; a few dashboard-wide site values (crown jewels, host IPs used by risk scoring) need a dashboard restart. To load a settings file by hand: python3 store.py cfg-import <site|policy|host_policy|known_benign> file.json; python3 store.py cfg-export <doc> prints one back out.

Settings tab What to put in it
Site Your internal CIDR and prefixes, Elasticsearch URL, sensor IP, this host’s IP and name, gateway name/DNS IP, home WAN IP, VPN prefixes, honeypot IPs, Fleet host name → IP (host_ips), crown-jewel hosts (scored highest impact), and sensitive_terms (host/user names the push guard should block). Optional pivot links (🔎 buttons): kibana_url (Kibana base, e.g. https://so.example.lan/kibana/), kibana_data_view (Discover data view id, default logs-*), unifi_web_url (UniFi Network web app base, e.g. https://unifi.ui.com/consoles/<console-id>/network/default/ or https://<gateway-ip>/network/default/) and unifi_paths (label → page path under it). Leave kibana_url empty to hide the buttons. If you’ll publish your own fork, also fill in github_user, github_repo and image_repo.
Network policy Quick start: click Auto-discover from UniFi (see below). Network zones (CIDR per VLAN), zone_roles (zone → dmz, protected, mgmt, user or iot), device_classes (MAC or IP → iot, camera, media, game, personal, work, server, k8s or infra), and allow rules for expected cross-zone flows, and the detection sensitivity tables: scan_thresholds, upload_spike, beacon and spike_thresholds (DNS long names, DNS volume, IDS signature spike, external fan-out, failed connections: a floor, a multiple of the device’s normal, a variation factor, history days and a severity or off). Each is described in its ⓘ bubble and on the event cards in Related events. Anything else on a sensitive port, from the DMZ, or from IoT/cameras to servers is reported as a segmentation violation.
Endpoint policy Endpoint rules: expected admin source IPs (admin_sources), Fleet host → LAN IP (endpoint_ips), trusted tool paths (replace /home/YOUR_USER), syslog patterns, osquery posture expectations and per-host exceptions. The defaults are sensible; adjust the paths and IPs.
Known benign Suricata signatures, IP names and domains you have explained as benign. The review model can add to this (add_known_benign).
sec_accepted.json (file, git-ignored) Reviewed security-scan findings (filled in by secfindings.py accept-current). Start empty.

Auto-discover from UniFi

On More → Settings → Network policy (admin only), Discover from UniFi builds a proposal from your UniFi console and shows it before anything is changed. It needs the UniFi API key (More → Configuration). Code: discover.py (python3 discover.py prints a preview; --apply [--overwrite] writes it).

On the same page, Auto-tune thresholds (admin only) replays about two weeks of per-device history and daily snapshots against the scan, beacon, upload and spike thresholds and lists recommended values with the reason and the before/after finding counts. Nothing is saved until you tick the proposals you want and press Accept selected. Proposals only make a noisy detection less noisy; severity and min_days are never touched. Code: tuning.py.

Discovered From
zones one per enabled UniFi network that has a subnet (rest/networkconf), named from the network name (Kubeworld → kubeworld) or vlanN. A subnet that already has a zone keeps its name.
zone_roles the network name (dmz/untrusted, IPMI/mgmt, server/kube/AI/lab, IoT/camera/guest), UniFi’s guest flag, then what lives in the network (mostly servers → protected). Anything else is user.
device_classes UniFi’s device fingerprint category per client (camera, game console, TV/speaker, phone/tablet/watch, laptop, VM/server…), hostname hints (kube-/talos → k8s, ipmi → infra, cam → camera), and the zone role for unfingerprinted hosts. UniFi’s own switches, access points and gateways are infra.
internal_prefixes (Site) prefixes that cover all discovered subnets, so non-10.x networks count as internal.

Apply only adds what is missing; Apply & overwrite differences also replaces existing roles and classes where UniFi disagrees. It never deletes. Fingerprints are a guess (a smart plug may show as a camera), so review the device table and correct anything in the Settings tables afterwards. Not discovered: allow rules, which are your exceptions; add them as you review segmentation violations.

Zone roles drive the rules, so zone names are free-form: dmz = internet-exposed (flows from it into other zones are violations, higher risk factor), protected = servers/clusters (IoT/camera access and cross-zone access flagged, impact 5), mgmt = IPMI/infrastructure (impact 4), user (3), iot (2). Without zone_roles, the legacy names dmz, servers, k8s, ai are still recognised.

Optional extras:

3. Secrets

Secret Where Notes
Elasticsearch API key ~/.config/netmon/secrets.env → ES_API_KEY=<key>, or Configuration → Integrations Create a read-only key: Kibana → Stack Management → API keys, with read + view_index_metadata on logs-*.
UniFi Site Manager API key ~/.config/netmon/secrets.env → UNIFI_API_KEY=<key>, or Configuration → Integrations https://unifi.ui.com → API. Optional.
Web search key (optional) ~/.config/netmon/secrets.env → FIRECRAWL_API_KEY, BRAVE_API_KEY or TAVILY_API_KEY Only if you pick that search backend (step 7c). DuckDuckGo needs no key, nor does a self-hosted Firecrawl (the cloud key is never sent to it).
AI provider API keys AI pipeline configuration → AI providers on the dashboard Stored in the Syn database (owner-only file dashboard/state/netmon.db, mode 600). See step 7b.
Dashboard login + host broker key dashboard/.env Created by setup.sh (DASH_PASS, NETMON_BROKER_URL, NETMON_BROKER_KEY).

The secrets file is plain KEY=value lines, mode 600, outside the repo (set NETMON_SECRETS to use another path). Values saved on the dashboard’s Configuration page take precedence over it. None of these are ever committed: .gitignore and the push gate block them.

In Kibana Fleet, give your endpoint agent policies these integrations:

Hosts then appear on the dashboard’s Endpoints page after the next collection.

5. First collection (manual)

cd ~/netmon
/usr/bin/python3 esq.py logs-zeek-so '{"size":0}'      # connectivity test: prints hit totals
/usr/bin/python3 collect.py 24                          # → snapshot document `data/<stamp>` in the Syn database
/usr/bin/python3 analyze.py                             # → `data/<stamp>.analysis` document + baseline

Behaviour rules (traffic spikes, new destinations and so on) need 3 days of baseline before they fire. Static rules (IDS, threat intel, segmentation, endpoint findings) work from day one.

6. Dashboard

cd ~/netmon/dashboard && ./deploy.sh

Audit log (Elasticsearch logs-syn)

Every user action and every AI conversation is written to the Elasticsearch index logs-syn and shown on More → Audit log (admins only, see the user guide). One-time setup with an Elasticsearch account that can manage templates (Kibana → Dev Tools, or curl):

  1. Index template (fixed mapping, so prompts and answers are full-text searchable): PUT _index_template/syn-audit with the body in docs/audit_index_template.json, then PUT logs-syn.
  2. A key for the dashboard that can only add and read entries: POST _security/api_key {"name": "syn-audit", "role_descriptors": {"syn_audit": {"indices": [{"names": ["logs-syn"], "privileges": ["create_doc", "read", "view_index_metadata"]}]}}} (create it as a user, not with another API key: Elasticsearch refuses keys with privileges derived from an API key).
  3. Paste the encoded value on More → Audit log → Change the audit key or index, Test, Save (stored in the Syn database). NETMON_AUDIT_ES_KEY in dashboard/.env works too.

Until a key works, entries wait in dashboard/state/audit_spool.jsonl (max 50 MB) and are sent automatically. Full reference: AUDIT_LOG.md.

Collection windows (arrival time)

The watcher (every event window, default 5 min) and the review job select events by when Elasticsearch stored them (event.ingested), not by when they happened (@timestamp). When Logstash or the Security Onion ingest pipeline is backed up, events reach Elasticsearch hours late; a “last 20 minutes by @timestamp” window would never see them. With arrival time they are checked by the first run after they arrive.

Time ranges

Dashboard time ranges other than a review-job window are collected by the host broker (host_broker.py, POST /range: collect.py --start --end --out dashboard/state/ranges/<id>.json + analyze.py --readonly; the results are stored as ranges/<id>… documents in the Syn database, not as files), because the container has no Elasticsearch key. They need the broker service running (step 7); nothing else to set up.

The optional Elasticsearch look-ups of the event reviewer and of event research (AI pipeline configuration → Models; see CORRELATION.md) also run through the broker (POST /esquery, es_context.py) for the same reason, and so does Send to research (POST /research-event).

The dashboard links related events and vulnerabilities, then asks models to confirm or reject each link and label each event (details in CORRELATION.md). Both roles can run on this host, so nothing leaves the machine:

curl -s http://127.0.0.1:1234/v1/models      # the event reviewer endpoint answers with its model list
curl -s http://127.0.0.1:8091/health          # the decision model answers {"status":"ok"} (or an empty 200)

Optional settings in dashboard/.env (then ./deploy.sh): NETMON_LLM=off, NETMON_LLM_URL, NETMON_LLM_MODEL, NETMON_LLM_REASONING (default none), NETMON_LLM_WORKERS (default 2), NETMON_CLEF_URL. A model server on another machine or in Kubernetes can instead be added as an AI provider (OpenAI-compatible type, LAN base URL) on AI pipeline configuration → AI providers. Without any LLM, links show the script’s evidence only.

7. Scheduled jobs and the host broker

Two systemd user services run on the host. setup.sh installed them; start them once the first collection works:

sudo loginctl enable-linger $USER          # keep user services running when you're logged out
systemctl --user enable --now netmon-broker netmon-scheduler
systemctl --user status netmon-scheduler   # or: /usr/bin/python3 scheduler.py status (next run of each job)

netmon-scheduler (scheduler.py) runs every recurring job. All results go to the dashboard (and Web Push), never to a chat platform. Each job’s output is in logs/<job>.log.

Job When What
watcher every event window (default 5 min; More > Settings > Site > event_window_minutes, followed live) watch.py (the Elasticsearch pull, arrival bookmark: pulls touch end to end): urgent alerts (new devices, IDS, threat intel, exposed ports, DNS tunnels, host anomalies, failed admin logins). Deterministic, no AI.
review job every N minutes, set on Configuration → Review job runs every (5 min to 24 h), on a grid anchored at 05:00 UTC; plus Run now on the AI pipeline pages review.py: collect + analyze, then the event reviewer copies matching earlier notes; everything else waits in the queue.
event research only when a person clicks Send to research research.py --event ID, started by the host broker; a click that has to wait (another research running) is started by the scheduler as soon as the running one ends. Never scheduled.
weekly rebuild Sundays 03:00 UTC weekly_rebuild.sh: dashboard image rebuild with updated libraries + security scan.

Jobs never overlap with themselves. A slot missed while the host was down is not made up, except the review job, which starts late within its own slot. The review job runs unless it is paused; without a usable event reviewer model it still collects and analyzes, and leaves every event in the queue.

netmon-broker (host_broker.py) listens on 127.0.0.1:8650 only and needs the bearer key NETMON_BROKER_KEY from dashboard/.env (with NETMON_BROKER_URL=http://127.0.0.1:8650). The dashboard container has no Elasticsearch key, so it asks the broker for exactly three things: POST /range (time-range collection for the dashboard’s picker), POST /research-event (start research.py for one event when someone clicks Send to research) and POST /esquery (bounded read-only Elasticsearch look-ups for the event reviewer, at most 600 an hour). It handles no models, keys or schedules.

The review job (review.py)

Each run:

  1. Collects and analyzes (collect.py + analyze.py). The daily run, the first run at or after 05:00 UTC each day, always covers 24 hours of logs. Other runs cover everything that arrived since the previous run plus one event window (More > Settings > Site > event_window_minutes, 2-120 min, default 5, lookback.py; the job runs at least once per window). Shorter snapshots are compared with the baseline scaled to their length, are never folded into it and never mark a Fix-list item fixed. analyze.py folds a snapshot into the baseline only when the last baseline record is at least 23 hours old (FOLD_MIN_HOURS), so the baseline stays one record per day.
  2. Builds the work list (enrich.sh events): every event without a note, by category (review_cfg.py modes: review, queue, test, skip). Every endpoint host finding (own quota, --hosts N, default 60), every Suricata severity 1-2 signature (--ids N, default 40) and every UniFi gateway event family (--gw N, default 30) is included on top of --max N other events.
  3. Event reviewer. Events in a review category that have earlier notes for the same family, correlated events or similar labels go to the event reviewer, which uses the event reviewer’s model (AI pipeline configuration → Models, e.g. a local open-weights model; prompts/reviewer.md). It either copies one earlier note (enrich.sh copy, marked as copied) or leaves the event queued. It has no web access and writes no notes of its own.
  4. Everything else waits in the Queue on the AI pipeline pages for a person.

The review job never researches events and never uses the research model. Run state and tokens are in <state>/review_job.json, shown on the AI pipeline pages; conversations are saved in logs/review/ (the newest 60). Manual runs:

/usr/bin/python3 review.py                 # like a scheduled run
/usr/bin/python3 review.py --daily         # force the 24 h daily run; --no-daily to skip it
/usr/bin/python3 review.py --skip-collect  # reuse the newest snapshot

Event research (research.py)

Research is what happens when a person clicks 🔬 Send to research on an event, and only then. The dashboard asks the host broker, which starts research.py --event ID; it uses the newest snapshot, the research model (AI pipeline configuration → Models) and the event research limits. The model works through read-only tools (Elasticsearch search, Syn data, notes and, if web access is on, web search / page fetch; prompts/analyst.md + prompts/enrich.md) and stores its results with enrich.sh put as {"model", "notes": [{"id", "verdict", "priority", "summary", "research", "links"}], "links": [{"a", "b", "related", "confidence", "reason"}]} in the dashboard’s state/enrich.db. Notes show as a “✨ verdict” button next to an event’s Related count. Link verdicts go in the same table as the event reviewer’s and replace them; manual verdicts are kept. Tokens and cost per researched event are in <state>/research_job.json; conversations in logs/research/ (the newest 60).

/usr/bin/python3 research.py --event 'hf|...'   # research one event by hand (same as Send to research)

7b. AI providers, models and limits

Everything is set by an admin on the dashboard’s AI pipeline configuration page; nothing on the host needs editing.

AI providers. Local server (the OpenAI-compatible server at NETMON_LLM_URL) is always the first row - no key or URL to set (those come from NETMON_LLM_URL), just an enabled switch and a calls per hour cap; disable it or lower its cap here instead of editing .env. Add as many other providers as you like. Each has a type, OpenAI / OpenAI-compatible (OpenAI, OpenRouter, Groq, Mistral, Together, DeepSeek, Gemini’s OpenAI endpoint, a self-hosted vLLM / SGLang / llama.cpp server, …) or Anthropic, an optional base URL (plain http:// only for LAN or loopback addresses), an API key, and its models, one per line. After a model id you can add prices in $ per million tokens, model input output [cached-input]; they are used for cost estimates and the $ caps. Fetch from provider fills in the model list, Test lists the models without spending tokens. Each provider also has a calls-per-hour cap (for the single calls of the event reviewer) and an optional number of extra reasoning tokens. Keys are stored in the Syn database (netmon.db, mode 600), only the last 4 characters are ever shown, and they are scrubbed from error messages. Changing a provider’s type or base URL requires entering the key again. Model choices are stored as api:<provider id> or lmstudio plus the model name.

Models. Three choices: the event reviewer (also used by the review job), event research (used only on Send to research) and the chat (Ask AI). Event research and the chat are off until you choose a model; if no event reviewer was ever chosen it defaults to Local server, so nothing is sent to a cloud provider until a person picks one. Under the model menus an admin can also switch the event reviewer’s and event research’s read-only Elasticsearch searches on or off (Elasticsearch queries · correlation review with a per-event maximum, Elasticsearch queries · event research) and set Notes per event, the most host and account notes the event reviewer is given with each event. A provider that is in use can’t be deleted (Local server can only be disabled, never deleted).

Event research needs a reasoning-capable model - it works through several tool calls per event (web search, reading pages, checking Syn data) and decides what to do next between them, which a plain chat model does noticeably worse at and sometimes gets stuck looping on. Pick a reasoning model (OpenAI’s o-series / GPT-5 family, Anthropic’s extended-thinking Claude models, or a local reasoning model served by an OpenAI-compatible server) and give it some extra reasoning tokens on its provider row - 0 there effectively turns reasoning off and will hurt research quality even on a model that supports it. The event reviewer and the chat don’t need this: the event reviewer only ever answers one fixed-format question per call, and the chat still works, just more superficially, on a non-reasoning model.

Event research limits (also on AI pipeline configuration): $ per research run (default 5), $ per day (default 20), tokens per research run (input + output, works without prices; default 25,000,000), research batches per run (default 10), web searches per event (default 3) and the Web access switch (off on a new install: no web search until an admin turns it on). A research run stops when it passes its caps, and Send to research is refused once today’s research (UTC) cost the daily cap. 0 turns a cap off. The $ caps need prices on the provider’s model. The Review job card shows the review job’s status, schedule and next run, Run now / Pause and recent runs; the Time and tokens chart below it covers review runs, event research and Ask AI, with a cost preview for another research model.

Only dashboard Admins can change providers, models or limits. Roles are set on the Dashboard users page (ACCESS_CONTROL.md). The settings live in the store’s meta table (review_cfg.py for the review job, research_cfg.py for event research) and the Syn database (settings document llm_config). The event reviewer’s model is remembered once chosen; if none has ever been chosen, it is Local server.

7c. Web search (event research and chat)

Event research and the chat search and read the web through webtools.py. The backend is set under Configuration → Integrations → Web search (stored in the Syn database, section web): DuckDuckGo (no key, the default), Firecrawl, Brave or Tavily (with a key). The key can also go in the host secrets file as FIRECRAWL_API_KEY, BRAVE_API_KEY or TAVILY_API_KEY. When Firecrawl is configured, pages are fetched through it too. Firecrawl can be the cloud (key required) or a self-hosted instance: enter its base URL in Firecrawl URL (key optional, and the host-file FIRECRAWL_API_KEY is never sent to it) and, for a private CA, paste the CA in Firecrawl CA certificate; TLS is always verified. A page Firecrawl reached through a redirect to a non-public address is discarded, but a self-hosted instance should also be blocked from the LAN by its own network policy. Without a working key or URL, search falls back to DuckDuckGo.

7d. OpenCTI threat intelligence (optional)

Syn can use an OpenCTI platform as a threat-intel source and report back to it. It is off until an admin fills in More > Configuration > Integrations > OpenCTI (settings are stored in the integrations document; the API token is write-only).

  1. In OpenCTI create a dedicated user for Syn (Settings > Security > Users, group Connectors) and an API token for it.
  2. On the card: enable it, enter the base URL (e.g. https://opencti.example.com) and the token. The certificate is always verified: if OpenCTI uses a private CA, paste the CA certificate (PEM). Test shows the version, user and indicator count.
  3. Thresholds: Minimum score (default 50) drops weaker indicators; at or above the High-confidence score (default 80) a match counts as serious and raises a Threat-intel alert like Feodo or URLhaus.

What it does (opencti.py, scheduler job opencti, every 15 minutes):

Switching the integration off removes the local lists at the next run.

7e. Kubernetes API, read-only (optional)

Container logs, Kubernetes events and API server metrics reach Syn through Security Onion (the Elastic Agent Kubernetes integration). That is enough for Devices → Kubernetes. Two further features need to read the cluster configuration itself: the CIS Kubernetes benchmark and the Kubernetes map. Both use one read-only account.

  1. Create the account: kubectl apply -f docs/kubernetes-readonly.yaml. This creates a ServiceAccount, a long-lived token Secret and a ClusterRole with get/list/watch only. It cannot read secrets, configmaps or pod logs, cannot exec, attach or port-forward, and has no nodes/proxy, which can be abused to run commands through the kubelet.
  2. Read the token: kubectl -n netmon-readonly get secret netmon-readonly-token -o jsonpath='{.data.token}' | base64 -d. Read the cluster CA from your kubeconfig (certificate-authority-data, base64-decoded).
  3. In Settings → Configuration → Integrations → Kubernetes API, enter:
    • the API server URL(s), comma-separated, one per control-plane node;
    • the token;
    • the CA.

    Click Test connection. It shows the version and node count, and asks the API server what the token may do. If the token can list secrets, create pods, exec, use nodes/proxy, delete or update, Test reports that it is not read-only. Then turn Enabled on (and Run CIS benchmark checks) and click Save.

The token is write-only (never shown again). The API server certificate is always verified.

For more than one cluster, repeat the steps in each cluster and fill in the Kubernetes API: add a cluster card (pick a short name). Image update and CVE checks run Trivy in a container (aquasec/trivy) on the host with Docker. Its vulnerability database is cached in ~/netmon-trivy-cache (about 3 GB), and it scans images straight from their registries (--image-src remote), so images are never pulled into Docker.

Threat-intel feeds

More > Configuration > Integrations > Threat-intel feeds lists the block lists Syn downloads (every 12 h) and matches against DNS look-ups, TLS server names, connections and file hashes. Per feed: on/off, URL (blank = the built-in default; a changed URL is downloaded on the next run), Serious (an outbound hit is malware / C2 and alerts) and Covered by OpenCTI (skipped while the OpenCTI pull is on, so the same indicator is not matched twice). Every built-in except the SSLBL JA3 list is marked by default: URLhaus and ThreatFox come from the OpenCTI abuse.ch connectors, Feodo, ET compromised, CINS and Spamhaus DROP from OpenCTI CSV feeds (~/talos/upgrade/opencti/csv-feeds.py, Data > Ingestion in OpenCTI). The pull lists the host of each malicious URL (never shared platforms such as GitHub or Discord; on tenant hosting such as vercel.app, workers.dev or blogspot.com it lists the tenant’s own subdomain, never the platform), and scored IP / CIDR observables that feeds bring in without an indicator (IPsum, CINS, ET, Spamhaus, DShield…) while a feed has re-sent them in the last 7 days. Built-in feeds can be turned off but not deleted. Add a feed takes a name, an http(s) URL and what the list holds: domains (hosts file or one per line), IPs, CIDR ranges, JA3 (SSLBL CSV) or file hashes. Test downloads the URL and counts the entries.

The watcher also checks file hashes and file names on the lists: files Zeek saw on the wire (md5/sha1) and processes / files Elastic Defend saw (sha256, image and file names). Event artifacts carry full hashes, bare file names and external IPs, and any artifact a list names says listed in <feeds>.

8. Ask AI chat (optional)

The chat runs inside the dashboard (dashboard/app/chat.py) with the chat model chosen on AI pipeline configuration → Models. It has no terminal, file, memory or settings tools. It can only search and read the web and query Syn through the read-only netmon_* tools (from netmon_mcp.py, which opens SQLite read-only). Admins can also pick a model per message in the chat header.

Once a chat model is chosen, the Ask AI menu item and the 💬 button on every finding work. Limits are 40 messages per user per hour, 4,000 characters per message and 600,000 tokens per answer. Conversations are kept in dashboard/state/chat.db (mode 600).

netmon_mcp.py can also be run as a stdio MCP server, so any MCP client can query the same read-only Syn data.

9. Making changes (and publishing your fork)

Troubleshooting

Symptom Check
collect.py errors on an index esq.py <index> '{"size":0}'. Your Security Onion version may name data streams differently: adjust the index names in collect.py/extras.py.
Empty Endpoints page Fleet agents healthy? logs-endpoint.events.* and logs-osquery_manager.result-* present?
UniFi section says “skipped” No UNIFI_API_KEY in ~/.config/netmon/secrets.env and none on Configuration → Integrations.
Locked out of the dashboard 8 failed logins → 5-minute lockout. docker restart netmon-dashboard clears it. To reset a password: docker exec -it netmon-dashboard python /app/server.py set-password <user>
Chat says “not configured” or “unavailable” Choose a chat model on AI pipeline configuration → Models; Test the provider on AI pipeline configuration → AI providers. Errors are in docker logs netmon-dashboard.
Review job never runs systemctl --user status netmon-scheduler, logs/review.log, /usr/bin/python3 scheduler.py status. The job must not be paused; without an event reviewer model it still runs but copies nothing. Send to research problems: logs/research-event.log, logs/research.log, the event research $ caps on AI pipeline. Lingering on? (loginctl show-user $USER -p Linger)
Time ranges or event reviewer searches fail systemctl --user status netmon-broker; NETMON_BROKER_URL / NETMON_BROKER_KEY in dashboard/.env.
Push notifications never arrive The site must be reached over a trusted HTTPS name (tunnel), not the self-signed IP.
Related links all say “AI review pending” Local model server running with a model loaded? curl $NETMON_LLM_URL/models (default http://127.0.0.1:1234/v1/models); decision model up? curl http://127.0.0.1:8091/health. The popover footer shows the last error. A first full review takes 1–2 h.
LLM returns empty answers Reasoning models use the whole token budget on hidden thinking. Keep NETMON_LLM_REASONING=none.
No admin-access data The section starts with the first snapshot after the feature was added. Login results need Elastic Agent on the target (Linux auth logs / Windows security log). Without it you still see connection attempts.
Watcher testing Never run the live watch.py by hand to test, because it mutes alerts for 12 h. Use NETMON_DB=/tmp/copy.db /usr/bin/python3 watch.py.

File map

Path Role
collect.py, extras.py, unifi.py, hosts.py, hostdetail.py, osq.py data collection (Elasticsearch, UniFi, endpoints)
discover.py Auto-discover zones, zone roles and device classes from UniFi (Settings → Network policy)
settings_docs.py the (i) definitions shown for every Settings section (stored as _doc_<setting> in each settings document; run it to refresh them)
analyze.py, mitre.py baselines, findings, ATT&CK mapping
adminproto.py admin / lateral-movement protocol + tool catalog, session merger
dashboard/app/lateral.py, risk.py lateral graph, admin-session scoring, host risk (RISK_SCORING.md)
dashboard/app/correlate.py, corr_llm.py event correlation, local-LLM review (CORRELATION.md)
watch.py urgent watcher (Elasticsearch pull once per event window, default 5 min)
review.py, review_cfg.py the review job and its settings (schedule, modes)
research.py, research_cfg.py event research (Send to research) and its settings (model, caps)
aijob.py, prompts/ tools, budget and logs shared by both, and their prompts
agent.py, llm_providers.py, webtools.py tool-using conversation loop, AI provider calls, web search / fetch
scheduler.py, host_broker.py, systemd/ job scheduler and loopback host broker, their systemd user units
store.py SQLite state store (WAL): state tables, JSON documents (snapshots, time ranges, job state) and the settings tables
netmon_mcp.py read-only Syn tools for the chat (also a stdio MCP server)
dashboard/ HTTPS dashboard (stdlib server, plain JS, Web Push)
site_cfg.py site settings loader (reads the site settings from the database)
setup.sh installer (config, folders, secrets file, TLS, dashboard login, systemd units)
sec_scan.sh, secfindings.py, repo_guard.py, ship.sh, weekly_rebuild.sh security scanning and the push gate