diff --git a/src/detections/detection.rs b/src/detections/detection.rs index 0d67e7cd..5062aef1 100644 --- a/src/detections/detection.rs +++ b/src/detections/detection.rs @@ -22,12 +22,12 @@ use crate::detections::rule::AggResult; use crate::detections::rule::RuleNode; use crate::detections::utils::{get_serde_number_to_string, make_ascii_titlecase}; use crate::filter; +use crate::options::htmlreport::{self, HTML_REPORTER}; use crate::yaml::ParseYaml; use hashbrown::HashMap; use serde_json::Value; use std::fmt::Write; use std::path::Path; -use crate::options::htmlreport::{self, HTML_REPORTER}; use std::sync::Arc; use tokio::{runtime::Runtime, spawn, task::JoinHandle}; @@ -616,13 +616,13 @@ impl Detection { "" }; //タイトルに利用するものはascii文字であることを前提として1文字目を大文字にするように変更する - let output_str = format!( "{} rules: {}{}", - make_ascii_titlecase(key.clone().as_mut()), - value, - disable_flag); - println!( - "{}", output_str + let output_str = format!( + "{} rules: {}{}", + make_ascii_titlecase(key.clone().as_mut()), + value, + disable_flag ); + println!("{}", output_str); if configs::CONFIG.read().unwrap().args.html_report.is_some() { html_report_stock.push(output_str); } @@ -688,7 +688,8 @@ impl Detection { } }); - let tmp_total_detect_output = format!("Total enabled detection rules: {}", total_loaded_rule_cnt); + let tmp_total_detect_output = + format!("Total enabled detection rules: {}", total_loaded_rule_cnt); println!("{}", tmp_total_detect_output); println!(); if configs::CONFIG.read().unwrap().args.html_report.is_some() { @@ -697,10 +698,14 @@ impl Detection { if !html_report_stock.is_empty() { for report_row in html_report_stock { let html_report_data = HTML_REPORTER.write().unwrap().md_datas.clone(); - htmlreport::add_md_data(html_report_data, "General Overview".to_string(),format!("- Analyzed event files: {}", report_row)); + htmlreport::add_md_data( + html_report_data, + "General Overview".to_string(), + format!("- Analyzed event files: {}", report_row), + ); + } } } - } } #[cfg(test)] diff --git a/src/main.rs b/src/main.rs index c5a35813..ec37edf5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ use hayabusa::detections::pivot::PivotKeyword; use hayabusa::detections::pivot::PIVOT_KEYWORD; use hayabusa::detections::rule::{get_detection_keys, RuleNode}; use hayabusa::omikuji::Omikuji; -use hayabusa::options::htmlreport::{HTML_REPORTER, self}; +use hayabusa::options::htmlreport::{self, HTML_REPORTER}; use hayabusa::options::profile::PROFILES; use hayabusa::options::{level_tuning::LevelTuning, update_rules::UpdateRules}; use hayabusa::{afterfact::after_fact, detections::utils}; @@ -539,7 +539,7 @@ impl App { ]; for output in output_data { let html_report_data = HTML_REPORTER.write().unwrap().md_datas.clone(); - htmlreport::add_md_data(html_report_data, "General Overview".to_string(),output); + htmlreport::add_md_data(html_report_data, "General Overview".to_string(), output); } }