1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use std::borrow::Cow;
use crossbeam_channel::{Sender, Receiver};
use super::events::SiemLog;
pub mod common;
pub mod dataset;
use common::{SiemMessage, SiemComponentStateStorage, SiemComponentCapabilities};
use std::boxed::Box;
pub mod mitre;
pub mod alert;
pub mod actuator;
pub mod metrics;
pub mod task;
pub trait SiemComponent {
fn id(&self) -> u64 {
return 0
}
fn set_id(&mut self, id: u64);
fn name(&self) -> Cow<'static, str>{
return Cow::Borrowed("SiemComponent")
}
fn local_channel(&self) -> Sender<SiemMessage>;
fn set_log_channel(&mut self, sender : Sender<SiemLog>, receiver : Receiver<SiemLog>);
fn set_kernel_sender(&mut self, sender : Sender<SiemMessage>);
fn run(&mut self);
fn set_storage(&mut self, conn : Box<dyn SiemComponentStateStorage>);
fn capabilities(&self) -> SiemComponentCapabilities;
fn duplicate(&self) -> Box<dyn SiemComponent>;
}