Commit Graph

17 Commits

Author SHA1 Message Date
Cobra d4354074c8 Make net_alerter alerts readable — fix hostname dedup and inline OUI lookup
- Replace broken OUI file lookup with inline dict of 200+ common vendors (works on Armbian)
- Fix hostname/IP duplication when reverse DNS fails (show IP once, not twice)
- Add format_arrival() and format_departure() helpers for consistent alert formatting
- Update on_arrival/on_departure to use new formatting functions
- Add comprehensive tests for hostname dedup and OUI lookup
2026-04-08 22:40:35 -04:00
Cobra b34aab7986 Add net_alerter README with quick start guide 2026-04-08 21:56:28 -04:00
Cobra 424b4f4552 Add Orange Pi Zero 3 specific deployment guide 2026-04-08 21:56:03 -04:00
Cobra a54acf32b8 Add net_alerter daemon deployment documentation 2026-04-08 21:55:39 -04:00
Cobra 52872794ee Add deployment script for net_alerter daemon 2026-04-08 21:55:18 -04:00
Cobra 431571dd82 Rebuild net_alerter as persistent daemon — DHCP sniffer + Netlink RTM_NEWNEIGH/DELNEIGH; removes 5-min cron, zero active probing 2026-04-08 21:55:02 -04:00
Cobra 402c4e849b Replace nmap ARP scan with passive /proc/net/arp read — no active probing (#449)
- Removed get_local_subnets() and scan_subnet() — no longer needed
- Added read_arp_cache() to read kernel ARP table from /proc/net/arp
- Added fallback to 'ip neigh show' if /proc/net/arp unavailable
- Added lookup_oui() to query system /usr/share/hwdata/oui.txt for vendor names
- Removed subprocess nmap call and re import (no longer needed)
- run() now directly reads ARP cache instead of scanning subnets
- Zero active network traffic — purely passive monitoring
- Removed sudo requirement
2026-04-08 21:01:12 -04:00
Cobra 967fac5ce5 Enrich net_alerter alerts with OUI vendor and reverse DNS hostname
Parse nmap vendor name from MAC Address line (filtering out 'Unknown').
Fall back to socket.gethostbyaddr for IPs nmap didn't resolve a hostname
for. Alert label is now: 'hostname (vendor)' | 'hostname' | 'vendor' |
'unknown', in that priority order.
2026-04-08 20:31:49 -04:00
Cobra d9c27eaf66 Fix Cloudflare bot detection blocking net_alerter Matrix sends
urllib's default Python-urllib user agent is flagged by Cloudflare Bot
Fight Mode (error 1010) when m.example.org homeserver sits behind
Cloudflare. Add a browser-like User-Agent to Matrix PUT/POST requests so
Cloudflare passes the traffic through.
2026-04-08 20:19:24 -04:00
n0mad1k 516b7908a6 Add absent_count column and commented-out grace period threshold for tripwire resets 2026-04-06 08:52:30 -04:00
n0mad1k 0156101f11 Rewrite net_alerter with presence tracking: baseline on first run, alert on join and rejoin 2026-04-06 08:47:48 -04:00
n0mad1k 532f5f4a33 Fix net_alerter: don't treat 403 as token expiry — room permission errors were silently dropping all alerts 2026-04-06 08:27:42 -04:00
n0mad1k 75703d7ef6 Auto-refresh Matrix token on 401 instead of silently dropping alerts 2026-03-25 09:33:15 -04:00
n0mad1k 59cfb6b07a Use sudo nmap to allow ARP scan with restricted sudoers 2026-03-25 06:28:48 -04:00
n0mad1k 12f8a37dc4 Use dedicated net-alerter Matrix service account, keep credentials out of repo 2026-03-25 06:20:37 -04:00
n0mad1k 94abb6f2ce Fix deploy.sh to use SSH config alias instead of raw key/host 2026-03-25 06:05:32 -04:00
n0mad1k d7cdd489ce Add net_alerter: new device join alerts via Matrix to condo Pi 2026-03-24 20:29:24 -04:00