Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: output agg result string when all-field-info profile #1452

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
//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 @@
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())],
);
}

Check warning on line 193 in src/detections/message.rs

View check run for this annotation

Codecov / codecov/patch

src/detections/message.rs#L184-L193

Added lines #L184 - L193 were not covered by tests
} else {
let recinfos = if let Some(c) = record_details_info_map.get("#AllFieldInfo") {
c.to_owned()
Expand Down
Loading