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 use rustkernel_core::traits::GpuKernel;
52
53 tracing::info!("Registering behavioral analytics kernels");
54
55 registry.register_metadata(profiling::BehavioralProfiling::new().metadata().clone())?;
57 registry.register_metadata(profiling::AnomalyProfiling::new().metadata().clone())?;
58
59 registry.register_metadata(
61 signatures::FraudSignatureDetection::new()
62 .metadata()
63 .clone(),
64 )?;
65
66 registry.register_metadata(causal::CausalGraphConstruction::new().metadata().clone())?;
68
69 registry.register_metadata(forensics::ForensicQueryExecution::new().metadata().clone())?;
71
72 registry.register_metadata(
74 correlation::EventCorrelationKernel::new()
75 .metadata()
76 .clone(),
77 )?;
78
79 tracing::info!("Registered 6 behavioral analytics kernels");
80 Ok(())
81}
82
83#[cfg(test)]
84mod tests {
85 use super::*;
86 use rustkernel_core::registry::KernelRegistry;
87
88 #[test]
89 fn test_register_all() {
90 let registry = KernelRegistry::new();
91 register_all(®istry).expect("Failed to register behavioral kernels");
92 assert_eq!(registry.total_count(), 6);
93 }
94}