RoamSwitch Sensor Operations Manual
An installation and operations guide for a network sensor that, simply by being placed on the LAN, detects new devices appearing on the same segment and spoofing. For endpoints with RoamSwitch installed (Mac / Linux Client / Server Edition), it also performs active vulnerability audits. Distributed as apt / dnf packages.
1. Overview & Positioning
RoamSwitch (Mac / Linux Client / Server Edition) is, in every case, a host-resident agent. That form factor has two structural blind spots.
- A single host's self-diagnosis has a fundamental blind spot: lateral-movement risk — "closed to the outside, but wide open to another device on the same LAN" — can never be detected by a host that only ever looks at itself.
- Some devices can never run RoamSwitch: IoT devices (network cameras, smart plugs, multifunction printers), guest/BYOD devices, network equipment itself, embedded devices, and more.
RoamSwitch Sensor is a dedicated node placed on the LAN that fills these two gaps. Implemented: active vulnerability audits of endpoints with RoamSwitch installed, ARP-based device inventory and spoofing detection, and reference information on suspicious behavior from opt-in passive capture (§6). It only detects and reports; it does not block traffic.
updates.fetch_cve_map, default true; false for offline). They contain no device or audit data. (2) Notification and aggregation to destinations set by the operator: sent only when configured.Self-defense is intentionally not implemented (a deliberate design decision). If you need to protect the Sensor host itself from attack, we recommend separately installing RoamSwitch for Linux Server Edition on the same machine. The two run as fully independent processes and coexist without conflict.
2. Current Verification Environment
- Supported OS: Debian 12 (bookworm)+ / Ubuntu 22.04+ (apt), Fedora / RHEL family (dnf).
x86_64(amd64) andarm64(aarch64, such as Raspberry Pi) are supported. - Target hardware (future plan): for real-world operation we envision a low-power, always-on-friendly device such as a fanless N100/N150-class mini PC, but no dedicated build or delivery targeting this is provided today.
- Network placement: Connect it to the LAN segment you want to monitor (it runs on the host network, because it sees ARP directly). A fixed IP address is required, because it receives requests. It listens on TCP port
50543and accepts TLS 1.3 on the same port (§4.4). - Resource usage: resident memory is around several tens of MB, and CPU load when idle is minimal.
- Recommended:
nmap(used for the ARP sweep, the NSE supplementary checks and the MAC check of scheduled audits). Without it the other features still work, but no ARP sweep is performed and the Sensor falls back to passive operation that only sees devices it has itself communicated with.
nmap is a recommended package. Sensor can be installed without it, but scheduled audits, scheduled audits of devices not yet onboarded, and active scans of the device ledger (detecting quiet devices) will not run. roamswitch-sensor status shows “nmap: not installed”.
3. Installation & Startup
Install the roamswitch-sensor package from the official, signed package repository. After installation, roamswitch-sensor.service (systemd) is automatically enabled and started.
3.1 APT (Ubuntu / Debian)
# 1. Register the repository signing key
curl -fsSL https://lafine.net/apt/roamswitch-archive-keyring.asc \
| sudo gpg --dearmor -o /usr/share/keyrings/roamswitch-archive-keyring.gpg
# 2. Add the repository
echo "deb [signed-by=/usr/share/keyrings/roamswitch-archive-keyring.gpg] https://lafine.net/apt stable main" \
| sudo tee /etc/apt/sources.list.d/roamswitch.list
# 3. Install
sudo apt update && sudo apt install roamswitch-sensor
3.2 DNF / RPM (Fedora / RHEL)
# 1. Import the GPG key
sudo rpm --import https://lafine.net/rpm/RPM-GPG-KEY-roamswitch
# 2. Add the repository config file
sudo curl -fsSL -o /etc/yum.repos.d/roamswitch.repo https://lafine.net/rpm/fedora/roamswitch.repo
# 3. Install
sudo dnf install roamswitch-sensor
3.3 Verifying It Started
systemctl status roamswitch-sensor.service
sudo roamswitch-sensor status
3.4 Running the CLI / TUI
The CLI (roamswitch-sensor) and the interactive TUI (roamswitch-sensor-tui) can be run directly after installation.
sudo roamswitch-sensor status
sudo roamswitch-sensor-tui
ROAMSWITCH_SENSOR_PASSIVE_CAPTURE_IFACE environment variable (set via systemctl edit roamswitch-sensor.service) to observe Ethernet/IPv4/IPv6 headers on that interface and detect new devices or contact with known-malicious IPs (see §6.1). Off by default.4. Pairing (Pairing-Code Method)
Out of the box, Sensor trusts nothing. Pairing is done with a single-use pairing code the Sensor operator issues. The trust relationship — “Sensor may run active vulnerability audits against this endpoint” — is established in both directions at once, in a single pairing step (there is no such thing as one-directional trust).
Prerequisite: run Sensor at a fixed IP address (a static assignment, or a DHCP reservation). After pairing, the endpoint always connects directly to the IP address it saw at pairing time (there is no automatic discovery via mDNS or anything else), so if Sensor’s IP later changes you’ll need to re-pair. The endpoint side can keep a dynamic IP.
4.1 Issuing a pairing code (Sensor side)
# Run on the Sensor side (or press c in the TUI)
sudo roamswitch-sensor issue-code
An 8-character one-time code appears (0/O/1/I/L are excluded). It expires 10 minutes after it is issued. Tell the operator on the endpoint side right away, together with the TLS certificate fingerprint (SHA-256) to pin on the endpoint.
4.2 Pairing with the code (endpoint side)
# Endpoint side (roamswitch-linux)
sudo roamswitch sensor pair --addr <SENSOR_IP> --code <CODE> --fingerprint <SHA256_FINGERPRINT>
On the Mac edition you can do the same in the GUI from the menu bar item “🔍 RoamSwitch Sensor Pairing…” by entering the Sensor’s IP address, the pairing code and the certificate fingerprint.
Once paired, every later active audit and result retrieval is authenticated with Ed25519 signatures. A Linux endpoint talks over TLS 1.3 only to a Sensor whose certificate matches the fingerprint you entered, and never falls back to plaintext automatically (§4.4). At this point the endpoint that knew the code and the Sensor that issued it treat each other as trusted.
issue-code.4.3 Manual pairing (registering a known public key directly)
If the Sensor operator already knows an endpoint’s public key and address out-of-band, it can be registered directly on the Sensor side without exchanging a pairing code (normally, use the code-based method in §4.2 and let the endpoint pair itself instead). You can look up your own public key and address with the following commands.
# Check your own public key/address on the endpoint side
sudo roamswitch sensor key
# Check the Sensor's own public key/address/MAC address
sudo roamswitch-sensor status
# Sensor side
sudo roamswitch-sensor pair <full public key> --addr <IP address> --confirm
4.4 Security of the control API (TCP 50543) (TLS, fingerprint, lockout)
Pairing, audit requests and result retrieval go through the Sensor’s control API (TCP 50543). The following protections are built in.
- TLS 1.3 and certificate pinning:
control.tlsisoff/optional(default; also accepts plaintext and warns) /required(TLS 1.3 only). The certificate is self-signed (ECDSA P-256), and trust is determined by pinning its SHA-256 fingerprint. - Fingerprint binding of the pairing request: the endpoint signs the fingerprint it pinned with its own private key and includes it in the pairing request. A request that passed through a man-in-the-middle with a different certificate fails with
fingerprint_mismatch, and the pairing code is not consumed. - Replay-safe signatures (v2): audit-request and result-retrieval signatures use the v2 format, which includes a timestamp (±300 s) and a nonce, so replays are refused. Legacy v1 signatures carry neither and can be replayed;
control.allow_legacy_signatures(defaulttrue, meant for the migration period; every use logs a deprecation warning) decides whether they are accepted. Set it tofalseonce every endpoint sends v2. - Lockout: for brute-forcing of the pairing code, 5 failures within 10 minutes from the same source IP cause a 60-second lockout (extended exponentially up to 1 hour if repeated), and 20 failures across all sources cause a global lockout. Signature failures are handled slightly more leniently (10 per source IP, 100 in total). Lockouts are reported with the notification
control_api_lockout. - Listen address: narrowing
control.bind_addr(default0.0.0.0, applied on restart) to the Sensor’s LAN address reduces exposure. The daemon warns while it is a wildcard address. - Certificate rotation:
roamswitch-sensor tls rotate(on the TUITscreen, pressR) regenerates the certificate. Every pin of the old fingerprint becomes invalid, so each endpoint must enter the new value (sudo roamswitch sensor repin <public key> --fingerprint <value>). The pairing itself is kept.
sudo roamswitch-sensor pairing show # mode, fingerprint, warnings
sudo roamswitch-sensor tls rotate # regenerate the certificate
sudo roamswitch sensor repin <PUBLIC_KEY> --fingerprint <NEW_FINGERPRINT> # on each endpoint
control.tls to requiredroamswitch-sensor status no longer shows a plaintext-connection warning → (3) run sudo roamswitch-sensor config set control.tls required → restart the daemon. off is normally not used, because Linux endpoints require TLS and could no longer connect.5. Active Vulnerability Audit
Sensor runs non-destructive, proof-based vulnerability diagnostics against paired endpoints. It never performs destructive operations (writing or deleting data, stopping services).
sudo roamswitch-sensor scan <public key or its prefix>
The audit consists of four phases.
- Full port scan: exhaustively detects every open TCP port on the target host.
- Known-signature diagnostics: non-destructive, proof-based checks against known vulnerability patterns — unauthenticated exposure of Redis / dockerd / Memcached / MongoDB / Elasticsearch / CouchDB / Jenkins / VNC, SMTP open-relay diagnostics (a safe method that sends only
MAIL FROM/RCPT TO, neverDATA), and dev-server CORS misconfiguration, path traversal, and open-redirect diagnostics, among others. - Generic banner grab: for open ports not covered by the signatures above, retrieves the banner string by connecting only — no data is sent. To an open port that shows no banner it sends a single
GET / HTTP/1.0to tell the service apart (at most 32 ports per audit). - Supplementary nmap NSE diagnostics: broad, wide-protocol supplementary diagnostics via
nmap --script safe. Runs automatically whenevernmapis installed on the host (a no-op otherwise).
Services on non-standard ports are also checked. The same read-only checks are applied to, for example, Redis on port 6380 or SSH on port 2222. Services are identified from the initial banner and the response to a single GET / HTTP/1.0. An endpoint's self-reported list (up to 64 entries at a time) is outside the signature, so it never widens the scope and is used only to choose the checks.
Every audit run is recorded to /var/lib/roamswitch-sensor/scan_history.json — regardless of whether anything was found, since a clean result at that point in time also has record value — and can be viewed from the CLI or TUI.
roamswitch-sensor history
sudo roamswitch-sensor report <public key or its prefix> --out /tmp/report.md
When it shows “Open ports: none” and there is no ARP response either, it displays “It may not be reaching the device.” This does not mean “no problem.” “nmap NSE: not run (nmap is not installed)” and “not applicable” mean different things.
5.1 Requesting an audit from the client side (pull model)
From a paired endpoint, you can also request an active vulnerability audit from the Sensor. On the Mac version, use “Request Audit from Sensor” in the menu bar; on the Linux version, use the following command.
sudo roamswitch sensor request-audit
After Sensor runs the audit, the endpoint polls for the result starting 5 minutes after the request, then every 5 minutes for up to 5 attempts (so up to 25 minutes total). Whatever result is retrieved is also saved locally on the endpoint.
roamswitch sensor results
On the Mac edition, results also appear in the settings window’s “Audit Results” list, or can be read through the MCP tool get_sensor_audit_results as input for an AI agent planning a remediation. Result retrieval can also be explicitly rejected — for example, if the pairing was revoked on the Sensor’s side (see §10 Q6).
5.2 Specification gaps, boundary values and AI leads (optional)
Spec diff and boundary-value check (design_flaw.enabled; off by default, opt-in) Applies only to paired, consenting endpoints. It looks for OpenAPI / Swagger documents and reports mismatches between what is declared and the actual responses. It supplies fixed safe values for query parameters and reports anomalies such as 5xx. It sends only GET, at most 20 requests per device. The order is fixed; the AI does not choose it (the summary masks secrets, up to 240 characters per item).
Have an AI write hypotheses (optional) roamswitch-sensor design-hypotheses passes only the summary of the records to the AI tool you choose and has it write unconfirmed hypotheses. It runs with the privileges of the user who runs it, and the summary may be sent to the provider. Nothing is sent to devices.
6. Passive ARP Monitoring & LAN Visibility
Sensor keeps track of LAN devices in two ways. (1) Monitoring the ARP table: it reads the table about every 10 seconds and detects new IP/MAC pairs and MAC changes for known IPs (a sign of spoofing). (2) Active ARP sweep: every hour it checks the directly connected subnet (up to /22) with nmap -sn -PR and saves the result to the inventory. Without nmap, only (1) applies.
roamswitch-sensor arp-events
Detected events are shown by roamswitch-sensor arp-events and on the TUI “ARP Events” tab (Enter for details). Each event carries its time, a severity (critical to info; a MAC change of the gateway IP is “critical”), the reasoning, the identity of the devices involved and concrete next steps.
6.1 Passive LAN Visibility Extension (Opt-in)
While the ARP monitoring above only covers devices Sensor has itself communicated with, setting the ROAMSWITCH_SENSOR_PASSIVE_CAPTURE_IFACE environment variable to a target interface observes only the Ethernet/IPv4/IPv6 headers on it and what devices announce about themselves (no data content is read except for DNS, DHCP, mDNS, SSDP, WS-Discovery and LLDP), and does the following.
- Passive observation of new devices: devices Sensor has never directly communicated with, not covered by ARP monitoring alone. Learned from broadcast/multicast traffic.
- Detecting contact with known-malicious IPs: flags traffic whose destination IP matches the local threat feed (same format as RoamSwitch proper's Egress Guard) — detection only, never blocked.
- VLAN tags (802.1Q / 802.1ad): when the mirror port is a trunk, tagged frames are read too (up to a double tag). The VLAN IDs seen are kept in the device ledger, up to 8 per device. They are attached only to devices already in the ledger; a VLAN ID alone never creates a device.
- IPv6 traffic: source, destination and ports are read as for IPv4. The new-device and known-malicious-IP checks cover IPv4 only (IPv6 privacy addresses keep changing). IPv6 traffic is used for per-device behavior learning and for detecting bulk sending and contact with IoT management ports.
- What devices announce about themselves: LLDP (the name and description of switches, access points and IP phones), mDNS TXT records (
model=md=ty=) and WS-Discovery (UDP 3702; the name and model of ONVIF cameras) are read and become the “model hint” in the device ledger. Announced strings are stored without control characters and cut to 96 characters.
sudo systemctl edit roamswitch-sensor.service
# [Service]
# Environment=ROAMSWITCH_SENSOR_PASSIVE_CAPTURE_IFACE=eth0
sudo systemctl restart roamswitch-sensor.service
roamswitch-sensor passive-events
After adding an environment variable, restart with sudo systemctl restart roamswitch-sensor. systemctl edit alone does not apply to the running daemon. To check that it was applied, look at “Passive capture: receiving on eth0” in roamswitch-sensor status. If it still says “Passive capture is disabled”, it has not been restarted.
The receive buffer is changed with capture.rcvbuf_mb (MiB; default 4, 0 for the system default). Because the only privilege is CAP_NET_RAW, anything above net.core.rmem_max is cut off. If kernel_drops appears, raise rmem_max (for example: sudo sysctl -w net.core.rmem_max=8388608; to make it persistent, use /etc/sysctl.d/) and raise capture.rcvbuf_mb as well.
6.2 Device Ledger and Device Notes
View the inventory with roamswitch-sensor device-inventory. Devices for which you registered a note with device-note are "known"; unregistered ones are "needs review". Observed VLAN IDs also appear in the vlans column of exports and elsewhere.
sudo roamswitch-sensor refresh
roamswitch-sensor device-inventory
sudo roamswitch-sensor device-note aa:bb:cc:dd:ee:ff "3F copier"
6.3 Reference Information on Suspicious Behaviour (Detection Only)
With passive capture (§6.1, opt-in) enabled, the following reference information is presented. All of it is detection and display only; the Sensor never blocks traffic.
- IoT device behaviour (
iot-events): connections from classified devices to known malicious IPs or to management ports (SSH/RDP/SMB and so on). Model identification from the devices’ own mDNS/SSDP/DHCP/LLDP/WS-Discovery announcements is used as well. - Suspicious traffic (
network-threats): connections to many destinations within a 30-second window (a sign of scanning or a stepping stone), a flood of connections to one destination (a sign of DDoS participation) and signs of DNS tunnelling/C2 (only the structural features of query names are used; domain names are not stored). - Advisories (
iot-advisories): reference information about public CVEs for known IoT vendors’ products (bundled statically; there is no network update).
6.4 Showing what the Sensor cannot see (coverage)
Passive monitoring cannot, by itself, tell hearing nothing from a quiet network. The Sensor counts only what it could observe itself and does not mistake what it cannot see for "no events". It opens no new connection and no new socket. It is on by default.
roamswitch-sensor statusand the TUI status screen (i) show a "what is visible" block: the passive capture state (receiving, interface name, frames so far, seconds since the last frame, or disabled) and one line per cause for anything not seen.- Notifications (Webhook, syslog) go only to destinations the operator has already configured: one
coverage_gap(severity medium) when a blind spot appears and onecoverage_restored(info) when it ends. Things that may just be quiet (info) are shown on screen only and not notified. - When sending to the collector is enabled,
summary.captureandsummary.coverage_notesare added to the existing report, and the dashboard's Sensor list shows a badge and a count card for blind spots.
Examples of causes that are counted: the passive capture cannot be opened, a stall of 30 seconds or more, 5 consecutive receive failures, no frames for 5 minutes with the link also down, kernel drops (last 10 minutes), frames over 2048 bytes, and frames whose header cannot be read. A run in which the ARP table cannot be read is counted without clearing the baseline.
What it cannot do It counts only what the Sensor itself can observe. It cannot tell apart a case where reception is fine but the frames that arrive are skewed, such as a mirror port set up wrongly. When there have been no frames for 5 minutes but the link is up (capture_silent, info), it says plainly that "quiet" and "not hearing" cannot be told apart.
7. CLI Command Reference
| Command | Description |
|---|---|
roamswitch-sensor status |
Show the Sensor’s own public key, IP and MAC address, the number of paired endpoints, ARP events and pending audit requests, and the control-API TLS state |
roamswitch-sensor issue-code |
Issue a single-use pairing code (valid for 10 minutes); also shows the Sensor’s certificate fingerprint |
roamswitch-sensor list |
Lists all paired endpoints |
roamswitch-sensor pair <public-key> [--addr <IP>] [--name <name>] --confirm |
Manually pairs an endpoint by specifying its public key and address directly (normally, use issue-code and let the endpoint pair itself instead — it’s simpler) |
roamswitch-sensor unpair <public-key> |
Removes a pairing |
roamswitch-sensor scan <public-key> |
Runs an active vulnerability audit against a paired endpoint |
roamswitch-sensor history [public-key] |
Shows audit history (omit the public key to see all endpoints) |
roamswitch-sensor report <public-key> [--out <file>] |
Outputs the most recent audit result as a Markdown report |
roamswitch-sensor arp-events |
Shows detected ARP events (new devices, suspected spoofing) |
roamswitch-sensor pairing show / tls show |
Show the control-API TLS state (mode, fingerprint, plaintext-connection warning, listen IP, whether legacy v1 signatures are accepted); pairing show and tls show are equivalent |
roamswitch-sensor tls rotate |
Regenerate the TLS certificate (every pin of the old fingerprint becomes invalid; endpoints must re-pin) |
roamswitch-sensor refresh |
Rescan the LAN now (ARP sweep) and update the device ledger |
roamswitch-sensor device-inventory |
Show the device ledger (every device observed on the LAN, its online state and note) |
roamswitch-sensor device-note <MAC> [note] |
Register a note for a device (omit the note to delete it) |
roamswitch-sensor passive-events / iot-events / network-threats / iot-advisories |
Show the events from passive capture (new devices and connections to malicious IPs / IoT behaviour / suspicious traffic / IoT advisories) |
roamswitch-sensor lan-overview [--json]roamswitch-sensor network-threats --json [--limit N] [--min-severity …] |
Shows the overall state of the LAN (device count, VLANs, number of threats, etc.) and a list of threats. --json outputs JSON (--limit is at most 500). Both are read-only and can be run by non-root users. PersonalSOC and the Linux version of MCP read it. |
roamswitch-sensor config [show | set <key> <value>] |
Show or change settings (scheduled audits, notifications, retention, collector, control API, detection-data fetching, language). control.bind_addr and control.tls take effect on daemon restart; the others need no restart (§11.8) |
roamswitch-sensor diff [public key] |
Show what changed since the previous audit (new findings, resolved ones, newly open ports, suspected unreachable) |
roamswitch-sensor export <scans|inventory|audit-log|unmanaged|all> … |
Write audit evidence as CSV / JSON / printable HTML |
roamswitch-sensor audit-log [verify] |
Show the operation and approval log; verify detects tampering with the hash chain |
roamswitch-sensor notify-test |
Send a test notification to the configured destinations (webhook / syslog) to verify connectivity |
roamswitch-sensor audit-unmanaged <IP|MAC> --confirmroamswitch-sensor unmanaged-audits |
Light audit of devices without RoamSwitch (connect checks only). audit-unmanaged <IP or MAC> --confirm runs one by hand, unmanaged-audits [--detail] lists the results (§13) |
roamswitch-sensor design-hypotheses [鍵] --llm 名前 |
Have the chosen AI tool write unverified leads from the latest design_flaw result (§5.2). --llm, --model, --timeout, --show-prompt |
roamswitch-sensor lockdown [status | on | off] |
Show whether the Sensor is locked down (status), lock it down (on --reason TEXT) or release it (off). Locked down, it stops pairing, audits, uploads and notifications (§14) |
roamswitch-sensor decommission --confirm |
Erase this Sensor's keys and stored data and lock it down (cannot be undone). The audit log is kept, and the endpoints that were paired with it are listed with how to unpair them (§14) |
The CLI supports only Japanese and English (it follows the LANG environment variable).
8. TUI Operation Guide
The interactive TUI (roamswitch-sensor-tui) is available in 10 languages and can operate everything the CLI and settings can (m shows the feature list). The 6 main tabs (Paired, Network configuration, ARP events, Audit history, Diff, Operation log) are switched with Tab. The diff shows new items in red, resolved ones in green, and suspected unreachable ones in yellow.
| Key | Action |
|---|---|
Tab | Switches tabs |
↑↓ / j k | Selects an item |
c | Issue a pairing code (valid for 10 minutes). The screen shows the command to run on the endpoint, sudo roamswitch sensor pair --addr <this Sensor’s IP> --code <code> --fingerprint <fingerprint>, with the real values filled in |
u | Removes a pairing |
s | Runs an active vulnerability audit against the selected endpoint |
a | (Network devices tab) Light-audit the selected device, after a confirmation screen (§13). Results are in the "Unmanaged audits" tab of the menu |
K | Lock down or release this Sensor, after a confirmation screen; a red notice stays at the bottom of every screen while locked down. Decommissioning is in the menu (§14) |
n | (Network tab) Add a note — name, purpose, location — to the selected device; a device with a note counts as accounted for |
r | Re-scan the LAN now (ARP sweep; it otherwise runs automatically every hour) |
e | Export audit evidence (CSV of scan results, the device ledger and the audit log; an HTML report; JSON). A form lets you choose the content, format, endpoint, start date and destination; files are produced in the display language (10 languages). The default destination is ~/.local/state/roamswitch-sensor/; files are created new and readable only by the owner (an existing file is never overwritten), and the export itself is recorded in the audit log |
p | Manual pairing (enter the public key and address, then a confirmation screen, then run). The form shows the Sensor’s TLS fingerprint that the endpoint pins |
T | TLS and pairing state (mode, fingerprint, plaintext-connection warning, listen IP, whether legacy v1 signatures are accepted). R regenerates the certificate (with a confirmation screen that explains the impact) |
C | Config editor (shows and changes every configuration key; webhook URLs are always masked; keys that need a restart are marked) |
N | Notification test (shows success or failure per destination; URLs are masked) |
m | Feature menu (passive monitoring, IoT behaviour, suspicious traffic, IoT advisories, status i, collector management and more) |
O | Collector management (only on a host that has the collector’s data directory): enroll, revoke and list Sensors, the read token, and clearing an audit-log anomaly. n sets where the collector’s own alerts go |
f / l / v | (Scan History tab) filter by endpoint. (Audit Log tab) l changes how many rows are shown and v re-verifies the hash chain |
Enter | Show details for the selected row (audit history, changes, ARP events, devices, audit log) |
w | (In a detail view) write the report to a file at a destination you choose (produced in the display language) |
L | Choose the display language (saved to the language setting, so it also applies to notifications and logs produced by the daemon) |
q | Quits |
9. Trust Model & Security Design
- Out-of-band confirmation (not TOFU): the operator passes the certificate fingerprint shown on the Sensor’s screen and the pairing code to the endpoint by voice, chat or similar. The endpoint never fetches the pin over the network (it is not TOFU, which trusts the first connection unconditionally) and talks to, and pairs with, only a Sensor whose certificate matches the value entered. The public keys exchanged at pairing verify every later probe and request.
- Designed to find holes that would allow destructive actions, without ever performing a destructive action itself: every active vulnerability audit is non-destructive (it never writes or deletes data, or stops a service). What it does detect are the misconfigurations themselves — things like “writable without authentication” or “functions as an open relay” — that, if exploited, would allow a destructive action.
- False-positive prevention (excluding self-audits): so that the inbound port scan detection guard does not misjudge the Sensor's full-port audit, the Sensor is excluded by source IP (the IP is not used to decide trust). From when an endpoint requests an audit until the report (up to about 25 minutes), a calm notification is shown. At all other times, the warning remains strong as before.
- Outbound traffic is limited, and device data is not sent by default: discovered device information, audit results and ARP events are stored only in the Sensor’s own local storage by default and are never sent to Lafine or any third party. The only outbound traffic is fetching detection data (the CVE map and the nmap NSE database; it can be stopped with
updates.fetch_cve_mapand contains no device or audit data) and the notifications (webhook, syslog) and central-collector uploads of §11, which go only to your own destinations and only when you configure them.
10. Troubleshooting & FAQ
Q1. Entering a pairing code gets rejected.
There are four possible causes. (1) More than 10 minutes have passed since issue (reissue with issue-code). (2) A typo. (3) The IP in --addr differs from the Sensor's fixed IP. (4) --fingerprint differs from the certificate (check with roamswitch-sensor pairing show). Repeated errors lead to a rate_limited lockout.
Q2. The NSE supplementary diagnostic result is empty.
There are two possible causes. (1) nmap is not installed in the container. (2) It ran, but there was actually no output from a safe script matching the target ports. The nmap NSE supplementary diagnostic runs automatically if nmap is installed on the host.
Q3. How long does an audit take to complete?
A full port scan alone takes about tens of seconds. If nmap is installed on the host, the NSE supplementary diagnostic is added automatically and can take up to about 2 minutes, depending on the number of open ports on the target. The TUI keeps showing the elapsed seconds while it runs, so you can follow progress.
Q4. I paired, but I still can't run an audit.
There are four possible causes. (1) sensor_pairing_enabled: true is not set on the endpoint (off by default). (2) The Sensor's fixed IP has changed (re-pairing is needed). (3) The Sensor was unpaired on its side. (4) The certificate was regenerated, so the endpoint's pin is stale (roamswitch sensor repin). Check each side's list for the other's registration.
Q5. Can Sensor itself be used alongside RoamSwitch proper (Client/Server Edition)?
Yes. Because Sensor is designed without self-defense features, we recommend running RoamSwitch for Linux Server Edition alongside it on the same machine. The two operate as completely independent processes and data stores, with no conflicts.
Q6. roamswitch sensor results says the pairing was revoked.
This endpoint’s pairing was removed on the Sensor side with unpair. Ask the Sensor’s operator to issue a new pairing code, then pair again with roamswitch sensor pair --addr <ip> --code <code> --fingerprint <SHA-256>.
11. Organization-Scale Audit Features (Opt-In)
A set of features for security teams in large organizations who need audit evidence and a clear picture of what changed. Every one of them is off by default, and nothing is ever sent to Lafine or any third party — every notification or aggregation destination is one your organization configures. Settings are changed with sudo roamswitch-sensor config set <key> <value> (no daemon restart needed; each change is recorded in the operation log); config show prints the current values.
11.1 Scheduled Audits and Change Detection
Setting schedule.enabled to true audits all paired endpoints periodically (every 24 hours by default). The difference from the previous run can be checked with roamswitch-sensor diff. When all previously open ports become invisible, this cannot be told apart from the endpoint being down, so it is treated as suspected unreachable.
Even unattended audits do not break the guarantee to audit only endpoints that have agreed. The MAC at the time the endpoint last authenticated is saved, and before and after the audit, nmap ARP checks whether the same MAC answers at that IP. If it differs, the audit is not performed (or its result is discarded) and a notification is sent.
Endpoints on another VLAN are excluded by default. With schedule.allow_routed_endpoints (off by default), this is verified, for example, by a signed request having arrived from the same address within schedule.routed_proof_minutes (default 30 minutes, 5 to 1440).
The reasons it does not run (no nmap, a device with no address, a device with no identity binding) appear as a warning under “Visible range” in status. If a notification destination is set, one coverage_gap is delivered, and coverage_restored is delivered once it is fixed. During lockdown and outside the time window, it does not raise a warning and shows one line in status.
11.2 Notifications (Webhook and syslog)
Sends regressions, new devices, ARP spoofing and so on to notify.webhook_urls and notify.syslog.host (RFC 5424, UDP or TCP). They can be narrowed with notify.min_severity and the resend interval, and connectivity can be checked with roamswitch-sensor notify-test.
status shows the notification channels and the result of the last delivery. While delivery is failing, a warning appears, so check with roamswitch-sensor notify-test. When it succeeds, the warning goes away.
11.3 Exporting Audit Evidence
roamswitch-sensor export <scans|inventory|audit-log|all> --format csv|json|html [--out file] [--endpoint start-of-public-key] [--since date]. html can be saved as PDF in a browser. CSV is protected against formula injection. Output is 0600, and the export itself is also recorded in the operation log. In the TUI, the e key gives the same options.
11.4 Operation and Approval Log (Tamper-Evident)
Pairing, audits, configuration changes and denied access are recorded together with who performed them. Each line is a hash chain that includes the SHA-256 of the previous line, and tampering can be detected with roamswitch-sensor audit-log verify (exit code 2 if abnormal). Webhook URL values are not kept. To guard against deletion of the tail, the head is also sent to the collector (§11.6).
11.5 Retention
Set retention.scan_history_days, retention.audit_log_days and retention.inventory_stale_days to have old audit history, operation-log entries and long-unseen devices deleted automatically (0 = never delete by age, the default). Devices that have a note are never removed from the inventory.
11.6 Aggregating Several Sensors (Central Collector, Optional)
When several Sensors run at several sites, run roamswitch-sensor-collector (shipped in the package, disabled by default) on a separate host to collect signed summaries from each of them.
# On the collector host (a separate host from the Sensor is recommended)
sudo systemctl enable --now roamswitch-sensor-collector # listens on 127.0.0.1:8443 by default
sudo roamswitch-sensor-collector token # read token for the dashboard
sudo roamswitch-sensor-collector enroll <Sensor public key> --name Tokyo --site Tokyo
# On each Sensor
sudo roamswitch-sensor config set collector.url https://collector.example.org:8443
sudo roamswitch-sensor config set collector.enabled true
- Only signed requests from Sensors you have enrolled (
enroll) are accepted, using their Ed25519 identity; the timestamp also rejects replays. - TLS is required whenever it is reachable from outside the LAN. Put
--bind 0.0.0.0:8443 --tls-cert … --tls-key …inCOLLECTOR_ARGSin/etc/default/roamswitch-sensor-collector, or use--allow-plain-httpbehind a TLS-terminating reverse proxy. Listening on anything other than 127.0.0.1 without TLS is refused at startup. - The dashboard is protected by a token and offers per-site filtering, events by severity and CSV export. It highlights Sensors that have gone silent and Sensors whose audit log looks truncated, rewound or forked (clear it with
clear-anomaly <public-key>once investigated). - With
collector.send_unmanaged_devices(defaulttrue), unpaired devices are also included in the summary, classified as “unpaired RoamSwitch host” or “unknown device”. Only the MAC, vendor, device class and first detection are sent; the contents of communication are not included. - When
collector.send_unmanaged_audits(defaultfalse) is enabled, from the latest light audit of devices without RoamSwitch it sends products listed in KEV, services that answered without authentication, and the number of findings (up to 200 devices). Banners, requests and responses, and approver records are not sent. “Unconfirmed” does not necessarily mean vulnerable. - The Sensor sends
summary.behavior_learned_devices(the number of devices whose learning period is over) andsummary.behavior_anomalies_active(the number of devices that behaved unusually in the last 24 hours). These are numbers only; no device names are sent. If behavior learning is off they are 0. They appear as a card on the dashboard and in the Sensor detail. - When the same device (MAC) or paired endpoint is reported by a Sensor at another site, it is recorded as “inter-site roaming” (
/api/roaming, dashboard). Sites are compared by the name given inenroll --site. Records are kept for 90 days, up to 500 entries, and only the MAC, public key, site name and time are stored. - A stopped or stolen Sensor cannot notify on its own, so the collector reports through Webhook / syslog. It covers a Sensor that has sent nothing for longer than
--stale-minutes(default 60 minutes), audit log anomalies (critical), and inter-site roaming (info). Resends are limited to every 30 minutes by default, and for 20 minutes after a restart no Sensor is judged to have stopped. Nothing is sent, and nothing is blocked, until a destination is set. The Webhook URL is passed on standard input, and redirects are not followed.
# On the collector host: where the collector's own alerts go
echo 'https://hooks.example.org/…' | sudo roamswitch-sensor-collector notify set --add-webhook - --min-severity high
sudo roamswitch-sensor-collector notify set --syslog-host 192.0.2.10 --syslog-protocol tcp
sudo roamswitch-sensor-collector notify show # a Webhook URL is shown up to its host only
sudo roamswitch-sensor-collector notify test
When the collector could not read its history (scans.jsonl, events.jsonl), it counts what could not be read so that this is not mistaken for “no data”. A corrupted line is skipped on its own, and lines whose date cannot be read are not deleted by cleanup. The result appears in storage_health of /api/overview, in the dashboard, and in the startup log. No new communication is made.
11.7 Fetching Detection Data (updates.fetch_cve_map)
The Sensor fetches the signed CVE map (the known-vulnerability data used by active checks) and the nmap NSE database from the update service every day. This traffic carries no device or audit data. To run fully offline, run sudo roamswitch-sensor config set updates.fetch_cve_map false (the change takes effect from the next cycle without a restart, and only the bundled data is used from then on).
11.8 Configuration Key Reference
Check current values with roamswitch-sensor config show and change them with config set <key> <value> [<key> <value> …] (several keys are saved atomically; the TUI C config editor also changes them). Only keys marked “Yes” in the Restart column need a daemon restart (sudo systemctl restart roamswitch-sensor).
| Key | Type / values | Default | Restart |
|---|---|---|---|
site | string | (empty) | No |
language | ja | en | ko | zh-Hans | zh-Hant | de | fr | es | it | pt-PT | (empty = system locale) | No |
schedule.enabled | bool | false | No |
schedule.interval_hours | int | 24 | No |
schedule.window_start_hour | int 0–23 | (unset = always) | No |
schedule.window_end_hour | int 0–23 | (unset = always) | No |
schedule.max_parallel | int 1–8 | 1 | No |
schedule.allow_routed_endpoints | bool | false | No |
schedule.routed_proof_minutes | int 5–1440 | 30 | No |
notify.webhook_urls | URL list | (empty) | No |
notify.min_severity | info | medium | high | critical | medium | No |
notify.cooldown_minutes | int | 30 | No |
notify.syslog.host | string | (empty = off) | No |
notify.syslog.port | int | 514 | No |
notify.syslog.protocol | udp | tcp | udp | No |
retention.scan_history_days | int (0 = never prune) | 0 | No |
retention.audit_log_days | int (0 = never prune) | 0 | No |
retention.inventory_stale_days | int (0 = never prune) | 0 | No |
collector.enabled | bool | false | No |
collector.url | URL | (empty) | No |
collector.push_interval_minutes | int | 15 | No |
collector.send_unmanaged_devices | bool | true | No |
collector.send_unmanaged_audits | bool | false | No |
collector.probe_control_port | bool | false | No |
control.bind_addr | IP address | 0.0.0.0 | Yes |
control.tls | off | optional | required | optional | Yes |
control.allow_legacy_signatures | bool | true | No |
updates.fetch_cve_map | bool | true | No |
control.listen_ipv6 | bool | false | Yes |
capture.rcvbuf_mb | int 0–256 (MiB, 0 = system default) | 4 | Yes |
dhcp.active_probe | bool | true | No |
dhcp.allowed_servers | MAC / IP list | (empty = learn the first) | No |
ipv6.enabled | bool | true | No |
ipv6.active_probe | bool | true | No |
ipv6.allowed_routers | MAC / IP list | (empty = trust the IPv4 gateway) | No |
unmanaged_audit.enabled | bool (needs authorization + allowed_cidrs first) | false | No |
unmanaged_audit.authorization | string | (empty) | No |
unmanaged_audit.allowed_cidrs | CIDR list (IPv4 ≤ /16 and IPv6 ≤ /48 refused) | (empty) | No |
unmanaged_audit.exclude | IP / CIDR / MAC list | (empty) | No |
unmanaged_audit.interval_hours | int | 168 | No |
unmanaged_audit.max_parallel | int 1–4 | 2 | No |
unmanaged_audit.product_check | bool (needs unmanaged_audit.enabled) | false | No |
unmanaged_audit.noauth_check | bool (needs unmanaged_audit.enabled) | false | No |
design_flaw.enabled | bool | false | No |
design_flaw.llm.tool | claude | opencode | codex | agy | (empty) | (empty) | No |
design_flaw.llm.model | string | (empty) | No |
design_flaw.llm.timeout_secs | int (0 or 5–600) | 0 | No |
security.on_revoked | lockdown | wipe | none | lockdown | No |
security.lockdown_after_offline_days | int (0 = off) | 0 | No |
12. Rogue DHCP and IPv6 Detection
Detects attacks in which a rogue router or similar device poses as legitimate and hijacks the communication path of endpoints. It only detects and notifies; it does not block traffic. Enabled by default, and passive capture is not required. Results appear in roamswitch-sensor network-threats, the TUI, notifications, logs and exports.
12.1 Rogue DHCP Servers (IPv4 and DHCPv6)
Every hour, it sends just one DHCP discover from a random MAC and counts all servers that respond. It does not send a REQUEST and does not lease an address. It learns the first server as legitimate and reports servers that appear later. Anything handing out a different gateway or DNS is critical.
12.2 IPv6 (Rogue Router Advertisements, NDP Spoofing, IPv6-Only Devices)
Rogue router advertisements: if a device other than the IPv4 gateway acts as an IPv6 router, it notifies you (register it in ipv6.allowed_routers if the setup is legitimate). Advertisements whose hop limit is not 255 are ignored. NDP spoofing: it reports when the MAC of an IPv6 address is swapped (high if it is a router). Devices visible only over IPv6: it reports devices that appear only in the neighbor table.
12.3 Who Counts as Legitimate, and the Settings
When dhcp.allowed_servers and ipv6.allowed_routers are set, every response from anything else is reported (if empty, the first one is learned). ipv6.enabled can turn off IPv6 monitoring. IPv6 listening of the control API (50543) is added with control.listen_ipv6 (default false). Global IPv6 can be reachable from the internet, so it is disabled by default.
13. Light Audit of Devices Without RoamSwitch (Opt-In)
The active vulnerability audit in §5 targets only endpoints that have been paired and agreed. If you want to check “what is open to the outside” on unpaired printers, cameras, NAS and similar devices, you can use a much more limited, separate check. Deep diagnostics like OpenVAS, login attempts, exploiting vulnerabilities, nmap NSE and full-port scans are performed only on endpoints that have agreed.
13.1 What It Does
It consists only of TCP connection checks to a fixed set of 55 ports, reading the banner that an open port sends by itself (one HEAD / for web services), and notes on already published vulnerabilities. The result means “reachable from the LAN”, not “vulnerable”. Product identification and authentication checks are separate opt-ins (off by default).
13.2 Turning It On
Before enabling, set unmanaged_audit.authorization (the approver) and unmanaged_audit.allowed_cidrs (the range; anything wider than /16 for IPv4 or /48 for IPv6 is rejected). Scheduled runs default to every 168 hours; manual runs require --confirm.
sudo roamswitch-sensor config set unmanaged_audit.authorization "IT policy 2026-07, approved by A. Suzuki"
sudo roamswitch-sensor config set unmanaged_audit.allowed_cidrs 192.168.10.0/24
sudo roamswitch-sensor config set unmanaged_audit.exclude 192.168.10.1
sudo roamswitch-sensor config set unmanaged_audit.enabled true
sudo roamswitch-sensor audit-unmanaged 192.168.10.40 --confirm
roamswitch-sensor unmanaged-audits --detail
13.3 Safeguards
Hosts outside allowed_cidrs, devices in unmanaged_audit.exclude, paired endpoints, and the Sensor itself are never examined, under any circumstances. The MAC is checked before and after; if it belongs to a different device, the check is aborted or the result discarded. The text of authorization is written to the log on every run.
13.4 Product check (is it a product with CISA KEV vulnerabilities? Opt-in)
unmanaged_audit.product_check (off by default) reads the product name from a device's web interface and reports whether it has a CISA KEV vulnerability. It sends only GET / and redirects (at most 2) to web ports (80, 8080, 8181, 443, 8443, 10443). By design it sends no logins, no password attempts, no guessed paths, and no exploit input. At most 12 requests per device, 150 ms apart.
A product is named only when its markers all appear in the same response. If the version the device reports has a CVE in an NVD affected range, it is reported as "affected" (high); if the version cannot be read, as an "unconfirmed" notice (medium), and the device is not called vulnerable. Only MikroTik RouterOS exposes a readable version. Supported products include Fortinet FortiGate, Ivanti Connect Secure, and Citrix NetScaler. The markers are based on public detection signatures and have not been verified on real devices.
The KEV copy is bundled. Only when both product_check and updates.fetch_cve_map are enabled, one public CISA feed file is fetched every 24 hours (no LAN information is sent).
Check whether a service answers without authentication (unmanaged_audit.noauth_check; off by default, opt-in) Sends one read-only request each, and only to the following ports found open: Redis (6379, PING), Memcached (11211), Docker API (2375), Elasticsearch (9200), etcd (2379), CouchDB (5984), kubelet (10250), ZooKeeper (2181), Ollama (11434). It does no writes, no configuration changes, no AUTH, no sending or guessing of passwords, and no logins.
MongoDB, MySQL, and similar are not checked, because an attempt could amount to a login. The result is one of "answered without authentication", "authentication required", "refused", or "could not determine". It runs only under the same consent as the light audit. Use it only on devices you manage.
14. When a Sensor Is Lost, Stolen or Retired
A Sensor holds the list of vulnerabilities found on each endpoint, the addresses of the paired endpoints and its signing key. The endpoints that paired with it also treat it as an approved scanner, so a stolen Sensor plugged into the same LAN could act as one. The following stops that.
14.1 Revoking at the Collector, and Lockdown
When a Sensor is revoked with roamswitch-sensor-collector revoke <public key> --reason reason, its submissions are rejected with 403 sensor_revoked. A Sensor that learns of the revocation stops itself (lockdown), halting auditing, sending, notifications, and probing. The lockdown persists across restarts, and the data remains. Only when you are certain the Sensor is in its owner's hands can you lift it with roamswitch-sensor lockdown off.
14.2 Erasing, Decommissioning, and Offline Detection
With security.on_revoked set to wipe, revocation overwrites the keys, TLS key, configuration (including the Webhook URL), device list, audit results, and device inventory with zeros and deletes them. Only the operation and approval logs are kept, as evidence. The default, lockdown, only stops the Sensor. With security.lockdown_after_offline_days (default 0 = disabled), a Sensor that cannot send for a long time also stops itself.
14.3 What This Cannot Do
Endpoints keep trusting this Sensor until each one removes it, and the Sensor cannot notify them. On each endpoint listed, run roamswitch sensor unpair <this Sensor's public key> on Linux, or Settings > Sensor > Unpair on Mac. A Sensor carried off while powered down never receives the stop instruction, so disk encryption (LUKS, etc.) is the real defense. Overwrite-erasure does not guarantee complete erasure on flash or CoW storage.