rustkernel_behavioral/
lib.rs1#![warn(missing_docs)]
14
15pub mod causal;
16pub mod correlation;
17pub mod forensics;
18pub mod profiling;
19pub mod signatures;
20pub mod types;
21
22pub mod prelude {
24 pub use crate::causal::*;
25 pub use crate::correlation::*;
26 pub use crate::forensics::*;
27 pub use crate::profiling::*;
28 pub use crate::signatures::*;
29 pub use crate::types::*;
30}
31
32pub use causal::CausalGraphConstruction;
34pub use correlation::EventCorrelationKernel;
35pub use forensics::ForensicQueryExecution;
36pub use profiling::{AnomalyProfiling, BehavioralProfiling};
37pub use signatures::FraudSignatureDetection;
38
39pub use types::{
41 AnomalyResult, AnomalyType, BehaviorProfile, CausalEdge, CausalGraphResult, CausalNode,
42 CorrelationCluster, CorrelationResult, CorrelationType, EventCorrelation, EventValue,
43 FeatureDeviation, ForensicQuery, ForensicResult, FraudSignature, ProfilingResult, QueryType,
44 SignatureMatch, SignaturePattern, UserEvent,
45};
46
47pub fn register_all(
49 registry: &rustkernel_core::registry::KernelRegistry,
50) -> rustkernel_core::error::Result<()> {
51 tracing::info!("Registering behavioral analytics kernels");
52
53 registry.register_ring_metadata_from(profiling::BehavioralProfiling::new)?;
55 registry.register_ring_metadata_from(profiling::AnomalyProfiling::new)?;
56
57 registry.register_ring_metadata_from(signatures::FraudSignatureDetection::new)?;
59
60 registry.register_ring_metadata_from(causal::CausalGraphConstruction::new)?;
63
64 registry.register_ring_metadata_from(forensics::ForensicQueryExecution::new)?;
66
67 registry.register_ring_metadata_from(correlation::EventCorrelationKernel::new)?;
69
70 tracing::info!("Registered 6 behavioral analytics kernels");
71 Ok(())
72}
73
74#[cfg(test)]
75mod tests {
76 use super::*;
77 use rustkernel_core::registry::KernelRegistry;
78
79 #[test]
80 fn test_register_all() {
81 let registry = KernelRegistry::new();
82 register_all(®istry).expect("Failed to register behavioral kernels");
83 assert_eq!(registry.total_count(), 6);
84 }
85}