diff --git a/src/detections/detection.rs b/src/detections/detection.rs index 021ac5d0..1dec8b51 100644 --- a/src/detections/detection.rs +++ b/src/detections/detection.rs @@ -30,21 +30,19 @@ impl Detection { return; } - // parse rule files let rules = self.parse_rule_files(); if rules.is_empty() { return; } - // transform from evtx files into json let records = self.evtx_to_jsons(evtx_files); - runtime::Runtime::new() .unwrap() .block_on(self.execute_rule(rules, records)); } + // ルールファイルをパースします。 fn parse_rule_files(&self) -> Vec { // load rule files let mut rulefile_loader = ParseYaml::new(); @@ -85,7 +83,7 @@ impl Detection { .collect(); } - // evtxファイルをjsonに変換する。 + // evtxファイルをjsonに変換します。 fn evtx_to_jsons(&mut self, evtx_files: Vec) -> Vec { // EvtxParserを生成する。 let evtx_parsers: Vec> = evtx_files @@ -157,6 +155,7 @@ impl Detection { .collect(); } + // xmlからjsonに変換します。 async fn xml_to_json(&mut self, xml_records: Vec>) -> Vec { // xmlからjsonに変換するJobを作成 let handles: Vec>> = xml_records @@ -194,6 +193,7 @@ impl Detection { .collect(); } + // 検知ロジックを実行します。 async fn execute_rule(&mut self, rules: Vec, records: Vec) { // 複数スレッドで所有権を共有するため、recordsをArcでwwap let mut records_arcs = vec![];