Traditional network security tools are either expensive enterprise products or basic open-source utilities that lack modern ML capabilities. I wanted something in between - a production-quality IDS that's free to run, demonstrates real ML engineering skills, and actually works.
I built this to learn:
The AI chat feature came from frustration with parsing security logs manually. Instead of reading through hundreds of alerts, you can just ask "what's happening?" in plain English and get actionable answers.
I chose Rust for the backend because network security tools need to be fast and memory-safe - can't have a security tool that crashes or has buffer overflows. The simulation mode exists because developing with real packet capture is a pain (needs root, different setup per OS, can't reliably test attack scenarios).
This is the kind of tool I'd actually use, not just a resume project.
# Network IDS
ML-powered network intrusion detection with web dashboard, terminal UI, and AI chat.
## What it does
- Captures network packets (real via libpcap or simulated for testing)
- Extracts statistical features from packet flows
- Runs neural network to score anomaly likelihood
- Detects known attack patterns (port scans, SYN floods, DDoS)
- Real-time alerts via WebSocket
- Natural language queries with AI (GPT-4o, Claude, Gemini)
## Interfaces
**Web Dashboard** - Real-time charts, alert feed, IP geolocation
**Terminal UI** - Interactive CLI with live stats and threat visualization
**AI Chat** - Ask security questions in plain English
## Stack
**Backend:**
- Rust (Tokio async, Axum REST API)
- Candle ML for neural network inference
- pcap for packet capture
- reqwest for AI API calls
**Frontend:**
- SvelteKit + TypeScript
- Chart.js for visualizations
- WebSocket for live updates
**AI Integration:**
- OpenAI GPT-4o
- Anthropic Claude Sonnet 4
- Google Gemini 2.5 Flash
## Setup
**Prerequisites:**
- Rust 1.75+
- Node.js 18+ with pnpm
- Npcap (Windows) or libpcap (Linux/Mac) for real capture
**Install:**
```bash
# Backend
cd network-ids-api
cargo build --release
# Frontend
cd web
pnpm install
pnpm dev
# CLI
cargo build --release --bin network-ids
Run web interface:
# Terminal 1: API server
cargo run --bin network-ids-api
# Terminal 2: Web UI
cd web && pnpm dev
API at http://localhost:3000
Dashboard at http://localhost:5173
Run CLI:
cargo run --bin network-ids start --interface eth0
Create .env in project root:
ABUSEIPDB_API_KEY=your_key_here
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=...
Set network interface in config:
interface: "Wi-Fi".to_string(), // Windows
// interface: "eth0".to_string(), // Linux
// interface: "en0".to_string(), // macOS
Real mode (requires admin/sudo):
# Windows
Right-click terminal → Run as Administrator
# Linux/Mac
sudo cargo run --bin network-ids-api
Simulated mode (default on Windows): Generates synthetic traffic for testing. No special privileges needed.
Packet Capture
↓
Feature Extraction (flow statistics)
↓
ML Model (anomaly scoring)
↓
Detection Engine (rule matching)
↓
Alert System
↓
├─→ WebSocket → Web Dashboard
├─→ Terminal UI
└─→ AI Chat Context
Neural network trained on flow-level features:
Outputs anomaly score 0-1. Threshold 0.7 triggers alert.
ML-based: Anomaly detection via neural network Rule-based: Pattern matching for known attacks Hybrid: Combines both for high accuracy with low false positives
Each alert includes:
Ask security questions in natural language:
Supports switching between OpenAI, Anthropic, and Google models.
# Start monitoring
network-ids start --interface eth0 --sensitivity 0.7
# Use simulation mode
network-ids start --simulate
# Show config
network-ids config
# Check status
network-ids status
# Run tests
cargo test
# Check formatting
cargo fmt --check
# Run clippy
cargo clippy -- -D warnings
# Build for release
cargo build --release
MIT
PRs welcome. Focus areas: