mv: full-data option check #606

This commit is contained in:
DastInDark
2022-06-29 22:15:35 +09:00
parent 59f79161be
commit 8bf5752cc7
2 changed files with 9 additions and 6 deletions

View File

@@ -248,6 +248,12 @@ impl Detection {
Some(str) => str.to_owned(), Some(str) => str.to_owned(),
None => recinfo.as_ref().unwrap_or(&"-".to_string()).to_string(), None => recinfo.as_ref().unwrap_or(&"-".to_string()).to_string(),
}; };
let opt_record_info = if configs::CONFIG.read().unwrap().args.full_data {
recinfo
} else {
None
};
let detect_info = DetectInfo { let detect_info = DetectInfo {
filepath: record_info.evtx_filepath.to_string(), filepath: record_info.evtx_filepath.to_string(),
rulepath: rule.rulepath.to_string(), rulepath: rule.rulepath.to_string(),
@@ -260,7 +266,7 @@ impl Detection {
alert: rule.yaml["title"].as_str().unwrap_or("").to_string(), alert: rule.yaml["title"].as_str().unwrap_or("").to_string(),
detail: String::default(), detail: String::default(),
tag_info: tag_info.join(" | "), tag_info: tag_info.join(" | "),
record_information: recinfo, record_information: opt_record_info,
record_id: rec_id, record_id: rec_id,
}; };
MESSAGES.lock().unwrap().insert( MESSAGES.lock().unwrap().insert(

View File

@@ -235,11 +235,8 @@ pub fn create_rec_info(data: Value, path: String, keys: &[String]) -> EvtxRecord
// EvtxRecordInfoを作る // EvtxRecordInfoを作る
let data_str = data.to_string(); let data_str = data.to_string();
let rec_info = if configs::CONFIG.read().unwrap().args.full_data { let rec_info = Option::Some(create_recordinfos(&data));
Option::Some(create_recordinfos(&data))
} else {
Option::None
};
EvtxRecordInfo { EvtxRecordInfo {
evtx_filepath: path, evtx_filepath: path,
record: data, record: data,