cargo fmt

This commit is contained in:
DastInDark
2022-09-24 17:17:39 +09:00
parent 50ec9105f6
commit 1dd4928bd5
2 changed files with 17 additions and 12 deletions

View File

@@ -22,12 +22,12 @@ use crate::detections::rule::AggResult;
use crate::detections::rule::RuleNode; use crate::detections::rule::RuleNode;
use crate::detections::utils::{get_serde_number_to_string, make_ascii_titlecase}; use crate::detections::utils::{get_serde_number_to_string, make_ascii_titlecase};
use crate::filter; use crate::filter;
use crate::options::htmlreport::{self, HTML_REPORTER};
use crate::yaml::ParseYaml; use crate::yaml::ParseYaml;
use hashbrown::HashMap; use hashbrown::HashMap;
use serde_json::Value; use serde_json::Value;
use std::fmt::Write; use std::fmt::Write;
use std::path::Path; use std::path::Path;
use crate::options::htmlreport::{self, HTML_REPORTER};
use std::sync::Arc; use std::sync::Arc;
use tokio::{runtime::Runtime, spawn, task::JoinHandle}; use tokio::{runtime::Runtime, spawn, task::JoinHandle};
@@ -616,13 +616,13 @@ impl Detection {
"" ""
}; };
//タイトルに利用するものはascii文字であることを前提として1文字目を大文字にするように変更する //タイトルに利用するものはascii文字であることを前提として1文字目を大文字にするように変更する
let output_str = format!( "{} rules: {}{}", let output_str = format!(
"{} rules: {}{}",
make_ascii_titlecase(key.clone().as_mut()), make_ascii_titlecase(key.clone().as_mut()),
value, value,
disable_flag); disable_flag
println!(
"{}", output_str
); );
println!("{}", output_str);
if configs::CONFIG.read().unwrap().args.html_report.is_some() { if configs::CONFIG.read().unwrap().args.html_report.is_some() {
html_report_stock.push(output_str); 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!("{}", tmp_total_detect_output);
println!(); println!();
if configs::CONFIG.read().unwrap().args.html_report.is_some() { if configs::CONFIG.read().unwrap().args.html_report.is_some() {
@@ -697,7 +698,11 @@ impl Detection {
if !html_report_stock.is_empty() { if !html_report_stock.is_empty() {
for report_row in html_report_stock { for report_row in html_report_stock {
let html_report_data = HTML_REPORTER.write().unwrap().md_datas.clone(); 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),
);
} }
} }
} }

View File

@@ -18,7 +18,7 @@ use hayabusa::detections::pivot::PivotKeyword;
use hayabusa::detections::pivot::PIVOT_KEYWORD; use hayabusa::detections::pivot::PIVOT_KEYWORD;
use hayabusa::detections::rule::{get_detection_keys, RuleNode}; use hayabusa::detections::rule::{get_detection_keys, RuleNode};
use hayabusa::omikuji::Omikuji; 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::profile::PROFILES;
use hayabusa::options::{level_tuning::LevelTuning, update_rules::UpdateRules}; use hayabusa::options::{level_tuning::LevelTuning, update_rules::UpdateRules};
use hayabusa::{afterfact::after_fact, detections::utils}; use hayabusa::{afterfact::after_fact, detections::utils};