How justinwkwan/netsentinel works
NetSentinel ingests PCAP or live-captured packets, assembles bidirectional flows, flags anomalous flows, then investigates each flag with a ReAct agent and threat-intelligence retrieval to produce structured reports. CLI and web/API interfaces expose the workflow; the dashboard also supports capture, browsing, and run history. Evaluation and detector metrics are separate product capabilities. Some relationships below rely on README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: lstm.py LSTM detector · App.tsx Dashboard shell · sources.py Packet sources · api.ts Web API client
Components 33
Ingestion and detection
- Packet sources
netsentinel/ingestion/sources.py - Flow assembly
netsentinel/ingestion/flows.py - Detector interface
netsentinel/detection/base.py - LSTM detector
netsentinel/detection/lstm.py - Model training
scripts/train_lstm.py
Agent and intelligence
- Investigation scheduler
netsentinel/agent/scheduler.py - ReAct investigation
netsentinel/agent/graph.py - Investigation timing
netsentinel/agent/timing.py - Threat report parsing
netsentinel/agent/report.py - Threat lookup tools
netsentinel/agent/tools.py - Threat intelligence store
netsentinel/rag/store.py - Threat data indexing
netsentinel/rag/build_store.py
CLI and dashboard
- Command-line runner
netsentinel/cli.py - Dashboard shell
web/src/App.tsx - PCAP and run controls
web/src/components/PcapSelector.tsx - Local PCAP browser
web/src/components/LocalBrowser.tsx - Live capture panel
web/src/components/LiveCapturePanel.tsx - Run status and reports
web/src/components/RunStatusPanel.tsx - Run history
web/src/components/RunHistory.tsx - Web API client
web/src/api.ts
API and capture
- HTTP API
api/main.py - Run jobs and history
api/jobs.py - API data models
api/models.py - Live capture manager
api/capture.py
Evaluation
- Report evaluation
eval/harness.py - LLM report judge
eval/judge.py - Labeled evaluation data
eval/dataset.py - Synthetic attack traffic
eval/attack_traffic.py - Detector metrics
eval/detector_metrics.py
Other components
- Security analyst
- PCAP or live traffic
- LLM provider
netsentinel/llm.py - Runtime configuration
config.py
Connections 44
- Security analyst → Command-line runner: runs analysis
- Security analyst → Dashboard shell: uses dashboard
- PCAP or live traffic → Packet sources: provides packets
- Packet sources → Flow assembly: assembles flows
netsentinel/ingestion/sources.py - Flow assembly → LSTM detector: scores flows
netsentinel/detection/lstm.py - LSTM detector → Detector interface: implements
netsentinel/detection/lstm.py - Model training → Packet sources: reads captures
scripts/train_lstm.py - Model training → Flow assembly: trains on flows
scripts/train_lstm.py - Model training → LSTM detector: saves model
scripts/train_lstm.py - Command-line runner → Packet sources: reads input
netsentinel/cli.py - Command-line runner → LSTM detector: detects anomalies
netsentinel/cli.py - Command-line runner → Investigation scheduler: investigates flags
netsentinel/cli.py - Investigation scheduler → ReAct investigation: dispatches investigations
netsentinel/agent/scheduler.py - ReAct investigation → Threat lookup tools: invokes tools
netsentinel/agent/graph.py - ReAct investigation → LLM provider: queries model
netsentinel/agent/graph.py - Threat lookup tools → Threat intelligence store: retrieves intelligence
netsentinel/agent/tools.py - Threat data indexing → Threat intelligence store: builds index
netsentinel/rag/build_store.py - Investigation scheduler → Investigation timing: records timings
netsentinel/agent/scheduler.py - ReAct investigation → Threat report parsing: parses reports
netsentinel/agent/graph.py - HTTP API → Run jobs and history: submits and polls
api/main.py - HTTP API → Live capture manager: controls capture
api/main.py - HTTP API → API data models: uses response models
api/main.py - Run jobs and history → Packet sources: reads captures
api/jobs.py - Run jobs and history → Flow assembly: assembles flows
api/jobs.py - Run jobs and history → LSTM detector: detects anomalies
api/jobs.py - Run jobs and history → Investigation scheduler: investigates flags
api/jobs.py - Dashboard shell → PCAP and run controls: renders controls
web/src/App.tsx - Dashboard shell → Local PCAP browser: renders browser
web/src/App.tsx - Dashboard shell → Live capture panel: renders capture
web/src/App.tsx - Dashboard shell → Run status and reports: renders status
web/src/App.tsx - Dashboard shell → Run history: renders history
web/src/App.tsx - PCAP and run controls → Web API client: requests runs
web/src/components/PcapSelector.tsx - Local PCAP browser → Web API client: browses folders
web/src/components/LocalBrowser.tsx - Live capture panel → Web API client: controls capture
web/src/components/LiveCapturePanel.tsx - Run status and reports → Web API client: polls run details
web/src/components/RunStatusPanel.tsx - Run history → Web API client: loads history
web/src/components/RunHistory.tsx - Web API client → HTTP API: calls endpoints
- Report evaluation → Labeled evaluation data: loads cases
- Report evaluation → LLM report judge: scores reports
- Detector metrics → Synthetic attack traffic: measures attacks
eval/detector_metrics.py - Detector metrics → LSTM detector: scores detector
eval/detector_metrics.py - Detector metrics → Packet sources: ingests test captures
eval/detector_metrics.py - Runtime configuration → LSTM detector: configures detector
netsentinel/detection/lstm.py - Runtime configuration → ReAct investigation: sets iteration cap
netsentinel/agent/graph.py