Skip to content

Commit

Permalink
Merge pull request #1452 from Yamato-Security/1450-output-agg-reslut-…
Browse files Browse the repository at this point in the history
…when-profile-allfieldinfo

fix: output agg result string when `all-field-info` profile
  • Loading branch information
YamatoSecurity authored Oct 14, 2024
2 parents 066f575 + 0b73701 commit 363de4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-Japanese.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- `search`コマンドの`-o`オプションを使用した際に不要な改行が出力されていた。(#1425) (@fukusuket)
- Sigma相関ルールの`group-by`フィールドは、必須だったが任意に変えた。(#1442) (@fukusuket)
- Hayabusaは、相関ルールで参照されているルールが見つからない場合、エラーメッセージを表示するようにした。 (#1444) (@fukusuket)
- `all-field-info`プロファイルを使用した場合、フィールド情報が出力されなかった。 (#1450) (@fukusuket)

**その他:**

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Unneeded line breaks when using `-o` in the `search` command. (#1425) (@fukusuket)
- Sigma correlation rules required the `group-by` field but now it is optional. (#1442) (@fukusuket)
- Hayabusa will give an error message if the rules referenced by a correlation rule are not found. (#1444) (@fukusuket)
- Field information was not being outputted when the `all-field-info` profiles were used. (#1450) (@fukusuket)

**Other:**

Expand Down
14 changes: 12 additions & 2 deletions src/detections/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ pub fn create_message(
//Detailsの中身が何も入っていない場合はそのままの値を入れる
replaced_profiles.push((key.to_owned(), profile.to_owned()));
} else {
replaced_profiles.push((key.to_owned(), Details(detect_info.detail.into())));
replaced_profiles
.push((key.to_owned(), Details(detect_info.detail.clone().into())));

// メモリの節約のためにDetailsの中身を空にする
detect_info.detail = CompactString::default();
Expand All @@ -180,7 +181,16 @@ pub fn create_message(
AllFieldInfo(_) => {
exist_all_field_info_in_ext_field = true;
if is_agg {
replaced_profiles.push((key.to_owned(), AllFieldInfo("-".into())));
replaced_profiles.push((
key.to_owned(),
AllFieldInfo(detect_info.detail.clone().into()),
));
if is_json_timeline {
record_details_info_map.insert(
"#AllFieldInfo".into(),
vec![CompactString::new(detect_info.detail.clone())],
);
}
} else {
let recinfos = if let Some(c) = record_details_info_map.get("#AllFieldInfo") {
c.to_owned()
Expand Down

0 comments on commit 363de4b

Please sign in to comment.