How flagmansec/flagmanids works
Flagman is a local, rule-based network IDS. Live packets or a capture replay enter the sensor pipeline, become flows and detector alerts, are grouped into incidents, and are stored for the dashboard. The dashboard supports overview, incident and flow views, health and configuration. The README documents Suricata signature support and replay; source excerpts show pipeline ownership but do not expose all runtime wiring, so uncertain subsystem links are omitted or marked unverified. The separate research code is represented as a benchmark branch, not part of the sensor runtime.
Main entry points: engine.rs Analysis engine · pipeline.rs Capture pipeline · data.py Dataset loading · App.svelte Dashboard application
Components 25
Sensor runtime
- Live and file capture
product/core/crates/flagman-capture/src - Suricata reader
product/core/crates/flagman-suricata/src - flagmand service
product/core/crates/flagmand/src/main.rs - Capture pipeline
product/core/crates/flagmand/src/pipeline.rs - Capture replay
product/core/crates/flagmand/src/replay.rs
Detection and incidents
- Packet decoding
product/core/crates/flagman-core/src/packet/decode.rs - Flow tracking
product/core/crates/flagman-core/src/flow/table.rs - Analysis engine
product/core/crates/flagman-core/src/engine.rs - Rule detectors
product/core/crates/flagman-core/src/detect - Alert records
product/core/crates/flagman-core/src/alert.rs - Incident grouping
product/core/crates/flagman-core/src/incident/engine.rs
Storage and API
- Batch writer
product/core/crates/flagmand/src/writer.rs - Local database
product/core/crates/flagman-store/src/schema.rs - Dashboard queries
product/core/crates/flagman-store/src/query_dashboard.rs - HTTP API
product/core/crates/flagman-api/src/routes_dashboard.rs
Dashboard
- Dashboard application
product/ui/src/App.svelte - Dashboard views
product/ui/src/pages - Flow browser
product/ui/src/pages/Flows.svelte
Research benchmark
- Dataset loading
src/data.py - Feature preprocessing
src/preprocessing.py - IDS models
src/models.py - Model evaluation
src/evaluation.py - Results analysis
src/plotting.py
Other components
- Local operator
- Observed network
Connections 23
- Local operator → Dashboard application: opens dashboard
README.md - Observed network → Live and file capture: supplies packets
README.md - flagmand service → Capture pipeline: starts
product/core/crates/flagmand/src/main.rs - Capture pipeline → Live and file capture: reads frames
product/core/crates/flagmand/src/pipeline.rs - Capture pipeline → Analysis engine: processes frames
product/core/crates/flagmand/src/pipeline.rs - Capture pipeline → Batch writer: sends batches
product/core/crates/flagmand/src/pipeline.rs - Capture pipeline → Suricata reader: receives rule hits
- Capture replay → Capture pipeline: reuses loop
product/core/crates/flagmand/src/pipeline.rs - Analysis engine → Packet decoding: decodes frames
product/core/crates/flagman-core/src/engine.rs - Analysis engine → Flow tracking: tracks flows
product/core/crates/flagman-core/src/engine.rs - Analysis engine → Rule detectors: dispatches events
product/core/crates/flagman-core/src/engine.rs - Rule detectors → Alert records: produces alerts
product/core/crates/flagman-core/src/detect/mod.rs - Analysis engine → Incident grouping: groups alerts
product/core/crates/flagman-core/src/engine.rs - Analysis engine → Alert records: publishes findings
product/core/crates/flagman-core/src/engine.rs - Batch writer → Local database: writes batches
- HTTP API → Dashboard queries: loads dashboard data
- Dashboard queries → Local database: reads aggregates
- Dashboard application → HTTP API: requests data
- Dashboard application → Dashboard views: renders views
product/ui/src/App.svelte - Dashboard views → Flow browser: includes flow view
- Dataset loading → Feature preprocessing: provides features
- Dataset loading → Model evaluation: loads benchmark data
src/evaluation.py - Dataset loading → Results analysis: provides dataset context
src/plotting.py