How abhiraj-hub/light_ids works
Lightweight IDS captures live or replayed IPv4 traffic, parses packets, evaluates signatures and sliding-window anomalies, then logs findings and dispatches configured alerts. The main control path is visible in main and packet_processor excerpts; alert-channel details are partially sampled, with README documentation supporting the broader capabilities. State and output are process-local except for JSON-lines logs and network alert delivery.
Main entry points: alert_sender.c Alert Dispatch and Limits · main.c IDS Entrypoint · packet_processor.c Packet Analysis and Alerting · event_logger.c Event Logger
Components 21
Capture and Parsing
- IDS Entrypoint
src/main.c - Live Capture
src/packet_processor.c - PCAP Replay
src/packet_processor.c - IPv4 Packet Parsing
src/packet_processor.c - Parsed Packet
include/packet_types.h - Packet Analysis and Alerting
src/packet_processor.c
Detection
- Signature Matching
src/signature_detector.c - Anomaly Detection
src/anomaly_detector.c
Logging and Alerts
- Alert Dispatch and Limits
src/alert_sender.c - SMTP Relay
- Slack Webhook
- Webhook Endpoint
- Event Logger
src/event_logger.c - JSON-lines Log
Configuration and Data
- Signature Rules
config/rules.json - Alert Configuration
config/alerting.json - JSON Parser
src/json.c - JSON and Base64 Encoding
src/util.c
Other components
- Operator
- Monitored Network
- PCAP File
Connections 24
- Operator → IDS Entrypoint: starts
src/main.c - IDS Entrypoint → Live Capture: starts capture
src/main.c - IDS Entrypoint → PCAP Replay: starts replay
src/main.c - Monitored Network → Live Capture: provides packets
README.md - PCAP File → PCAP Replay: provides packets
README.md - Live Capture → IPv4 Packet Parsing: dispatches packets
src/packet_processor.c - PCAP Replay → IPv4 Packet Parsing: dispatches packets
src/packet_processor.c - IPv4 Packet Parsing → Parsed Packet: populates
src/packet_processor.c - IPv4 Packet Parsing → Packet Analysis and Alerting: passes packet
src/packet_processor.c - Packet Analysis and Alerting → Signature Matching: inspects packet
src/packet_processor.c - Packet Analysis and Alerting → Anomaly Detection: analyzes packet
src/packet_processor.c - IDS Entrypoint → Signature Rules: loads rules
src/main.c - IDS Entrypoint → Alert Configuration: loads config
src/main.c - Signature Matching → Signature Rules: parses rules
- Packet Analysis and Alerting → Event Logger: logs findings
src/packet_processor.c - Packet Analysis and Alerting → Alert Dispatch and Limits: dispatches alerts
src/packet_processor.c - IDS Entrypoint → Event Logger: initializes logger
src/main.c - Alert Dispatch and Limits → JSON Parser: parses config
src/alert_sender.c - Alert Dispatch and Limits → Alert Configuration: reads config
- Alert Dispatch and Limits → SMTP Relay: sends email
README.md - Alert Dispatch and Limits → Slack Webhook: posts alert
src/alert_sender.c - Alert Dispatch and Limits → Webhook Endpoint: posts alert
src/alert_sender.c - Alert Dispatch and Limits → JSON and Base64 Encoding: encodes payloads
src/alert_sender.c - Event Logger → JSON-lines Log: writes JSON-lines
README.md