> Snapshot of projects/netsentry-iot/README.md — 28 Nov 2026

# NetSentry-IoT — Active network cybersecurity probe

Autonomous software probe for **anomaly detection** and **IoT protocol auditing**.
Positioning: regulatory compliance (**NIS2 / GDPR**) and cyber hardening of distributed
industrial sensor fleets.

## Project card

- **Developed by**: Helveticore OÜ Estonia.
- **Maturity**: CMMI Level 3 (Defined) — framework [`process/cmmi-charter.md`](../../process/cmmi-charter.md).

## Impact KPIs

- Malicious packet detection and isolation in **< 5 ms** at the edge.
- **No dependency** on a Cloud-hosted signature database (local detection).

## Sub-projects (src/)

- `src/packet-engine/` — packet analysis engine based on **Scapy** (capture + isolation).
- `src/protocol-inspection/` — deep inspection of lightweight layers **MQTT, HTTP** (Zigbee: Phase 2).
- `src/anomaly-detection/` — local behavioral analysis: identity spoofing and
  denial-of-service (DoS).
- `src/attack-simulator/` — traffic generator and attack-source simulator (evaluating the
  robustness of local industrial firewalls).
- `src/reporting/` — NIS2/GDPR incident journal (append-only JSONL, metadata-only).
- `src/probe/` — top-level pipeline: capture → decode → detect → isolate → log.

## Key risks (RSK)

- False positives (mitigated by local learning/calibration and traceable thresholds).
- Detection evasion on encrypted protocols (to be documented as a limitation).
- Probe network/CPU footprint (< 5 ms detection requires a fast path).

## Specification status (CMMI L3, frozen Rev 1.0)

The MVP specification set is complete and frozen (de-escalated: MVP + Phase 2 backlog):

- **Requirements** — `requirements/REQ.md` (16 tiered, measurable; Mandatory MVP + Desirable Phase 2).
- **Traceability** — `requirements/RTM.md` (bidirectional requirement → component → test → KPI).
- **Design** — `design/SDD.md` (IEEE 1016).
- **Decisions** — `design/decision-log.md` (D-1 … D-6).
- **Test bench plan** — `testbench/README.md` (TDD, test-first).

### MVP implementation (TDD — complete)

The MVP pipeline is fully wired, test-first, and green:

- `src/protocol-inspection/` — MQTT + HTTP decoders (fail-fast) + normalized `Observation` model.
- `src/anomaly-detection/` — DoS (rate) + spoofing (identity) detectors + `Alert` model.
- `src/attack-simulator/` — deterministic traffic + attack generators (replayable scenarios).
- `src/packet-engine/` — `capture` (Scapy live + replay) and `isolation` (nftables live + mock).
- `src/reporting/` — append-only JSONL incident journal (`Incident` model: metadata-only, no payload).
- `src/probe/` — `Probe.run(capture)` wires decode → detect → drop + log.

Run the tests (reuses the EdgeStream-GW protocol-adapters venv):

```bash
cd projects/netsentry-iot
../edgestream-gw/src/protocol-adapters/.venv/bin/python -m pytest   # 28 tests
```

### MVP limitations (documented, Phase 2)

- `ScapyCapture` / `NftIsolation` are live backends, not exercised by the offline test suite
  (they need a real interface / firewall); the deterministic replay + mock path is what is tested.
- TCP reassembly of multi-segment messages is out of scope for the MVP (per-packet payloads).
- Zigbee decode is Phase 2.

## Milestones

1. ✅ Virtual test bench: simulated IoT traffic + replayable attack scenarios.
2. ✅ MQTT/HTTP protocol inspection on replayed captures.
3. ✅ Spoofing/DoS behavioral detection with latency measurement.
4. ✅ (MVP) isolation (nftables backend) + NIS2/GDPR incident journal.
5. ⏳ Phase 2: Zigbee decode, TCP reassembly, live capture/firewall hardening, < 5 ms
   latency benchmark on real hardware.
