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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use crossbeam_channel::{Sender, Receiver};
use self::dataset::holder::DatasetHolder;
use super::events::SiemLog;
use common::{SiemMessage, SiemComponentStateStorage, SiemComponentCapabilities};
use std::boxed::Box;
use dataset::{SiemDatasetType};
use std::sync::{Arc, Mutex};
pub mod common;
pub mod dataset;
pub mod mitre;
pub mod alert;
pub mod metrics;
pub mod task;
pub mod use_case;
pub mod query;
pub mod command;
pub mod command_types;
pub mod parsing;
pub mod enrichment;
pub trait SiemComponent : Send {
fn id(&self) -> u64 {
return 0
}
fn set_id(&mut self, id: u64);
fn name(&self) -> &str {
return &"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>;
fn set_datasets(&mut self, datasets : DatasetHolder);
}
pub trait SiemDatasetManager : Send {
fn name(&self) -> &str {
return &"SiemDatasetManager"
}
fn local_channel(&self) -> Sender<SiemMessage>;
fn set_kernel_sender(&mut self, sender : Sender<SiemMessage>);
fn run(&mut self);
fn register_dataset(&mut self, dataset : SiemDatasetType);
fn register_datasets(&mut self, datasets : Vec<SiemDatasetType>);
fn get_datasets(&self) -> Arc<Mutex<DatasetHolder>>;
}