Conversation
Add comprehensive energy monitoring system to Qsecbit that provides early warning of attacks by detecting anomalous power consumption patterns. Key Features: - RAPL (Running Average Power Limit) energy counter integration for Intel CPUs - Per-PID CPU time tracking and power estimation from /proc/[pid]/stat - EWMA (Exponentially Weighted Moving Average) smoothing for baseline tracking - Z-score based spike detection (configurable threshold, default: 2.5 sigma) - Automatic detection of NIC interrupt-handling processes (irq/, ksoftirqd, napi/) - Automatic detection of XDP/eBPF related processes - Correlation of power spikes with network attacks and kernel exploits Algorithm (7-step process): 1. Read initial CPU time (/proc/stat) and RAPL energy counters 2. Sleep for Δt (1-5 seconds) 3. Read new CPU time and RAPL energy 4. Compute per-PID CPU share and wattage estimation 5. Build time-series of PID power consumption 6. Apply EWMA smoothing and Z-score anomaly detection 7. Alert on spikes in NIC/XDP processes, integrate with qsecbit RAG Integration: - New 5th component in qsecbit score: energy_anomaly (15% weight) - Automatic weight redistribution when enabled (α=25%, β=25%, γ=20%, δ=15%, ε=15%) - Energy metadata stored in ClickHouse/Doris with additional columns: - energy_anomaly, package_watts, nic_processes_watts, xdp_processes_watts - has_energy_anomaly, nic_spike, xdp_spike flags Use Cases: - DDoS attack detection: NIC interrupt handlers show power spikes during floods - Cryptomining malware: Abnormal process power consumption patterns - 0-day exploits: Unusual kernel/process behavior visible in power signatures - XDP/eBPF exploitation: Correlated power spikes in XDP driver processes Configuration: - energy_monitoring_enabled: Enable/disable feature (default: False) - energy_spike_threshold: Z-score threshold (default: 2.5) - energy_ewma_alpha: EWMA smoothing factor (default: 0.3) - energy_baseline_window: Baseline sample window (default: 100) Hardware Requirements: - Intel CPU with RAPL support (Core 6th gen+, Xeon Skylake+, Atom Goldmont+) - Fallback to CPU-time estimation if RAPL unavailable (AMD/ARM CPUs) Documentation: - Comprehensive README section with examples, queries, and best practices - Database schema updates for ClickHouse and Doris - API reference for new EnergyMonitor class This makes qsecbit even more competitive as a resilience metric by adding physical layer (energy consumption) visibility to complement existing statistical drift, ML predictions, classifier decay, and quantum drift components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive energy monitoring system to Qsecbit that provides early warning of attacks by detecting anomalous power consumption patterns.
Key Features:
Algorithm (7-step process):
Integration:
Use Cases:
Configuration:
Hardware Requirements:
Documentation:
This makes qsecbit even more competitive as a resilience metric by adding physical layer (energy consumption) visibility to complement existing statistical drift, ML predictions, classifier decay, and quantum drift components.
Pull Request
📋 Description
Brief summary of changes:
Related Issue:
Fixes #
🎯 Type of Change
🔧 Component(s) Affected
setup.sh,uninstall.sh,network-config.sh)🧪 Testing Done
How was this tested?
./setup.shin clean environment)./uninstall.shverifies complete cleanup)Test environment:
Test results:
# Paste relevant test output✅ Checklist
Before submitting this PR:
Security considerations:
📸 Screenshots/Logs
Before:
After:
🔄 Breaking Changes
Does this PR introduce breaking changes?
📚 Documentation Updates
Documentation changes made:
💬 Additional Notes
📝 Reviewer Notes
Specific areas to review:
By submitting this PR, I confirm: