Inspiration

Unlike mobile phones and computers, which have far more advanced network security and get replaced every 2–2.5 years, smart-home IoT devices like Amazon Echoes and smart TVs stay in your home for up to 10 years. Without active security maintenance and active checks, security vulnerabilities like weak passwords, unusual data transfer activity, and legacy security protocols often go unnoticed. Most consumer tools only offer passive warnings long after a compromise occurs, so we built CasaWarden to detect such risks, isolate severe threats from the network, and suggest protocol changes to improve device security.

What it does

CasaWarden is an IoT Network Security System built to detect vulnerabilities in smart-home devices and catch and contain house network-level malicious threats. It continuously baselines live network behavior, detects active scanning, and enforces real kernel-level network containment, while using Gemini as a strictly bounded, fail-safe security advisor.

  • Live Inventory & Presence Tracking: A Linux hotspot agent monitors routed Wi-Fi AP interfaces, discovering up to 20 concurrent clients using captured source addresses, DHCP/neighbor tables, and AP station data. It manages presence state transitions with a strict 3-second grace period for announced departures and a 15-second threshold for silent absences.
  • Hybrid Threat Detection: The system evaluates traffic using deterministic rules (e.g., ARP sweeps, decoy-target interactions) paired with a trained 6-feature binary scan classifier (securiot_ml). The model evaluates outgoing frames once per observed second and requires two over-threshold adjacent seconds to trigger.
  • Tiered Network Containment: Operators can trigger Warn (audit-only), Block Internet (drops outbound WAN IPv4/IPv6 traffic via MAC while preserving local access), or Quarantine (full LAN/WAN isolation dropping Ethernet ingress/egress, paired with hostapd denies or nl80211 station removal).
  • Bounded Gemini AI Advisor: Gemini translates packet telemetry into plain-English explanations and provides grounded public CVE research. By design, Gemini never authorizes firewall actions—enforcement remains strictly governed by deterministic local policy and human controls.

Threat, Identity, and Vulnerability Coverage

We designed CasaWarden to have honest evidence boundaries, distinguishing between high-confidence triggers and advisory alerts:

Evidence Current Integrated Response
Fast ARP sweep Rule threshold plus at least 8 distinct ARP targets can authorize containment.
Repeated gateway resolution Quantity without multi-host evidence remains a warning.
TCP SYN host/port scan Distinct outgoing IP/port targets; advisory.
Trained binary scan score Minimum signal, adjacent seconds and cooldown gates; advisory scan_targets.
Explicit decoy SYN Strong finding; eligible under automatic safeguards.
Volume deviation Explicit calibrated 10-second window baseline; advisory volume.
New discovery & AP departure Inventory/presence hints only; no threat verdict.

How we built it

We engineered CasaWarden as a modular, multi-service architecture orchestrated via Docker Compose and Caddy: architecture diagram

  1. Linux Edge Agent: Monitors traffic, evaluates sliding-window rules, runs the ML model, and executes containment against nftables (replacing only owned securiot_guard tables) and nl80211/hostapd. The BL gradient-boosting model was trained on UNSW IoT traces augmented with synthetic scans, achieved 80% held-out episode recall. We also used Tiger Data to store device snapshots, security events, and audit history.
  2. Backend API & Queue: Built with Python and FastAPI, managing telemetry ingestion, persistent state journals (enforcement.json, cloud.json), and an authenticated command queue that holds actions for up to 10 seconds waiting for sync/ack execution.
  3. Interactive React Dashboard: Features dedicated Home (device map, bandwidth, Safe/Caution/Danger counts), Activity (historical events), and Prevention views.
  4. Resilient AI Integration: Integrated the Gemini API with strict JSON schema validation. Gemini was used to provide user-friendly guidance on ensuring home security through their devices.

ML Model Evaluation

During our dataset integration testing against synthetic sweeps injected into UNSW traces, our ML implementation yielded the following baseline performance:

Evaluator Held-out episodes found Episode recall False alerts/device-hour Median detection time
Trained model (latest bundle) 1218 / 1525 0.80 0.01 5 s
Threshold baseline 537 / 1525 0.35 0.00 (rounded) 14 s

Challenges we ran into

  • NetworkManager vs. hostapd Enforcement: Standard Linux hotspots managed by NetworkManager don't expose a traditional hostapd admission deny list. We engineered a workaround using nl80211 repeated station removal/re-kick upkeep paired with nftables rules.
  • Safe Attack Testing: Demonstrating live attacks without bricking laptops was difficult. We built a deterministic replay simulator that injects scripted ARP sweeps and decoy interactions into the ingest pipeline, distinguishing simulated history from real physical verification.

Accomplishments that we're proud of

The strengths of our product include local detection, reversible containment, and clear explanations.

  • Separation of AI Advisory and Firewall Authority: We built an architecture where Gemini provides grounded security triage without ever having permission to trigger lockouts on its own.
  • Fail-Safe Automatic Controls: We built robust safeguards including local/cloud learning modes, explicitly protected targets, 30-second warmups, 10-second cooldowns, and 60-second restore grace periods.
  • End-to-End Hardware-to-UI Loop: Moving seamlessly from an anomalous frame on a Raspberry Pi Linux AP to an nftables quarantine and a human-readable React UI card in seconds.

What's next for CasaWarden

  • Direct Low-Latency Pi Listener: Wiring our direct loopback listener class into the API for immediate sub-second hardware containment.
  • Expanded Protocol Coverage: Extending passive discovery to Zigbee/Matter and deepening Home Assistant integration.

Built With

Share this project:

Updates

Submission history