Skip to main content

Module security_monitor

Module security_monitor 

Source
Expand description

NetworkSecurityMonitor — Real-time network security monitoring with anomaly detection, threat scoring, and incident management.

§Overview

This module provides production-grade security monitoring for a peer-to-peer network. It tracks SecurityEvents per peer, computes time-decaying ThreatScores, and automatically opens SecurityIncidents when a peer’s score crosses a configurable threshold.

§Scoring Model

Each ThreatLevel contributes a fixed number of points to a peer’s score:

LevelPoints
None0
Low5
Medium15
High30
Critical50

Scores decay by 10 % per elapsed hour (integer hours): score *= 0.9 ^ hours_since_last_update.

§Event ID

Event IDs are computed with FNV-1a over the concatenation of peer_id + threat_type_name + timestamp_string.

Structs§

NetworkSecurityMonitor
Real-time network security monitor.
SecurityEvent
A single security-relevant observation about a peer.
SecurityIncident
A group of related security events that warrants coordinated response.
SecurityMonitorStats
Aggregate statistics snapshot from NetworkSecurityMonitor.
ThreatScore
Aggregated threat score for a peer, with time-based decay.

Enums§

IncidentStatus
Lifecycle status of a SecurityIncident.
ThreatLevel
Ordered severity of a detected threat. Critical > High > Medium > Low > None.
ThreatType
The category of a detected threat.