(output)
| 1809 | """Last verdict from the passive network-integrity monitor (for the |
| 1810 | dashboard chip). Reflects config even when the monitor hasn't run yet.""" |
| 1811 | with _net_integrity_lock: |
| 1812 | state = dict(_net_integrity_state) |
| 1813 | state['monitor_enabled'] = bool(shared_data.config.get('net_integrity_monitor_enabled', False)) |
| 1814 | state['interval_min'] = shared_data.config.get('net_integrity_interval_min', 5) |
| 1815 | state['extended_enabled'] = bool(shared_data.config.get('net_integrity_extended_enabled', True)) |
| 1816 | state['batch_size'] = shared_data.config.get('net_integrity_batch_size', 3) |
| 1817 | state['interface'] = shared_data.config.get('net_integrity_interface', '') or '' |
| 1818 | return jsonify({'success': True, **state}) |
| 1819 | |
| 1820 | |
| 1821 | # ========================================================================== |
| 1822 | # Watchtower — unified alert pane for the standalone passive watchers. |
| 1823 | # The deep daemons (arp_guard, ndpwatch, wifiwatch, certwatch, snmpwatch, |
| 1824 | # isiswatch, igmpwatch) each write their own JSON-lines log; Watchtower tails |
| 1825 | # them all, normalizes into one shape, shows them in one pane, and pages the |
| 1826 | # high/critical ones through a single deduped Pushover path. Read-only over the |
| 1827 | # logs — it captures nothing. Opt-in via watchtower_enabled. |
| 1828 | # ========================================================================== |
| 1829 | |
| 1830 | _watchtower_lock = threading.Lock() |
| 1831 | _watchtower = None # lazy watchtower.Watchtower instance |
| 1832 | _wt_seen = {} # pushover dedup: key -> {'rank', 'ts'} |
| 1833 | _wt_seen_loaded = False |
| 1834 | _wt_summary = {'enabled': False, 'ts': None, 'total': 0} |
| 1835 | |
| 1836 | # Cross-signal correlation: fold the same normalized alert stream into |
| 1837 | # attack-chain *incidents* (see incident_engine.py). Paged once per incident when |
| 1838 | # it first becomes a named campaign or escalates. |
no test coverage detected