output not found field to n/a (#531)
* changed no found placeholder output to n/a #528 * added n/a output to details when not found placeholder * added v1.3.0 changelog describe and #528 enhance * fixed typo and fixed markdown format * fixed test * readme, changelog, version update Co-authored-by: Tanaka Zakku <71482215+YamatoSecurity@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
# 変更点
|
||||
|
||||
## v1.3.0 [2022/xx/xx]
|
||||
|
||||
**新機能:**
|
||||
|
||||
- xxx
|
||||
|
||||
**改善:**
|
||||
|
||||
- ルールの`details`でeventkey_alias.txtやEvent.EventData内に存在しない情報を`n/a` (not available)と表記するようにした。(#528) (@hitenkoku)
|
||||
|
||||
**バグ修正:**
|
||||
|
||||
- xxx
|
||||
|
||||
## v1.2.2 [2022/05/20]
|
||||
|
||||
**新機能:**
|
||||
@@ -19,10 +33,12 @@
|
||||
## v1.2.1 [2022/04/20] Black Hat Asia Arsenal 2022 RC2
|
||||
|
||||
**新機能:**
|
||||
|
||||
- `./config/channel_abbreviations`の設定ファイルにより、`Channel`列も出力されるようになった。 (@hitenkoku)
|
||||
- ルールとルールの設定ファイルは強制的に上書きされる。 (@hitenkoku)
|
||||
|
||||
**バグ修正:**
|
||||
|
||||
- ルールがnoisyもしくはexcludedと設定された場合は、`--level-tuning`オプションで`level`が更新されなかったが、修正した。 (@hitenkoku)
|
||||
|
||||
## v1.2.0 [2022/04/15] Black Hat Asia Arsenal 2022 RC1
|
||||
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,5 +1,19 @@
|
||||
# Changes
|
||||
|
||||
## v1.3.0 [2022/xx/xx]
|
||||
|
||||
**New Features:**
|
||||
|
||||
- xxx
|
||||
|
||||
**Enhancements:**
|
||||
|
||||
- In the `details` line in a rule, when a placeholder points to a field that does not exist or there is an incorrect alias mapping, it will be outputted as `n/a` (not available). (#528) (@hitenkoku)
|
||||
|
||||
**Bug Fixes:**
|
||||
|
||||
- xxx
|
||||
|
||||
## v1.2.2 [2022/05/20]
|
||||
|
||||
**New Features:**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "hayabusa"
|
||||
version = "1.2.2"
|
||||
version = "1.3.0-dev"
|
||||
authors = ["Yamato Security @SecurityYamato"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -485,7 +485,7 @@ Hayabusaの結果を標準出力に表示しているとき(デフォルト)
|
||||
* `Event ID`: イベントログの`<Event><System><EventID>`フィールドから来ています。
|
||||
* `Level`: YML検知ルールの`level`フィールドから来ています。(例:`informational`, `low`, `medium`, `high`, `critical`) デフォルトでは、すべてのレベルのアラートとイベントが出力されますが、`-m`オプションで最低のレベルを指定することができます。例えば`-m high`オプションを付けると、`high`と`critical`アラートしか出力されません。
|
||||
* `Title`: YML検知ルールの`title`フィールドから来ています。
|
||||
* `Details`: YML検知ルールの`details`フィールドから来ていますが、このフィールドはHayabusaルールにしかありません。このフィールドはアラートとイベントに関する追加情報を提供し、ログの`<Event><System><EventData>`部分から有用なデータを抽出することができます。
|
||||
* `Details`: YML検知ルールの`details`フィールドから来ていますが、このフィールドはHayabusaルールにしかありません。このフィールドはアラートとイベントに関する追加情報を提供し、ログの`<Event><System><EventData>`部分から有用なデータを抽出することができます。イベントキーのマッピングが間違っている場合、もしくはフィールドが存在しない場合で抽出ができなかった箇所は`n/a` (not available)と記載されます。
|
||||
|
||||
CSVファイルとして保存する場合、以下の列が追加されます:
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ When hayabusa output is being displayed to the screen (the default), it will dis
|
||||
* `Event ID`: This comes from the `<Event><System><EventID>` field in the event log.
|
||||
* `Level`: This comes from the `level` field in the YML detection rule. (`informational`, `low`, `medium`, `high`, `critical`) By default, all level alerts will be displayed but you can set the minimum level with `-m`. For example, you can set `-m high`) in order to only scan for and display high and critical alerts.
|
||||
* `Title`: This comes from the `title` field in the YML detection rule.
|
||||
* `Details`: This comes from the `details` field in the YML detection rule, however, only hayabusa rules have this field. This field gives extra information about the alert or event and can extract useful data from the `<Event><System><EventData>` portion of the log. For example, usernames, command line information, process information, etc...
|
||||
* `Details`: This comes from the `details` field in the YML detection rule, however, only hayabusa rules have this field. This field gives extra information about the alert or event and can extract useful data from the `<Event><System><EventData>` portion of the log. For example, usernames, command line information, process information, etc... When a placeholder points to a field that does not exist or there is an incorrect alias mapping, it will be outputted as `n/a` (not available).
|
||||
|
||||
The following additional columns will be added to the output when saving to a CSV file:
|
||||
|
||||
|
||||
@@ -161,22 +161,22 @@ impl Message {
|
||||
};
|
||||
|
||||
let split: Vec<&str> = array_str.split('.').collect();
|
||||
let mut is_exist_event_key = false;
|
||||
let mut tmp_event_record: &Value = event_record;
|
||||
for s in &split {
|
||||
if let Some(record) = tmp_event_record.get(s) {
|
||||
is_exist_event_key = true;
|
||||
tmp_event_record = record;
|
||||
}
|
||||
}
|
||||
if is_exist_event_key {
|
||||
let hash_value = get_serde_number_to_string(tmp_event_record);
|
||||
let hash_value = get_serde_number_to_string(tmp_event_record);
|
||||
if hash_value.is_some() {
|
||||
if let Some(hash_value) = hash_value {
|
||||
// UnicodeのWhitespace characterをそのままCSVに出力すると見難いので、スペースに変換する。なお、先頭と最後のWhitespace characterは単に削除される。
|
||||
let hash_value: Vec<&str> = hash_value.split_whitespace().collect();
|
||||
let hash_value = hash_value.join(" ");
|
||||
hash_map.insert(full_target_str.to_string(), hash_value);
|
||||
}
|
||||
} else {
|
||||
hash_map.insert(full_target_str.to_string(), "n/a".to_string());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ mod tests {
|
||||
}
|
||||
"##;
|
||||
let event_record: Value = serde_json::from_str(json_str).unwrap();
|
||||
let expected = "NoExistAlias:%NoAliasNoHit%";
|
||||
let expected = "NoExistAlias:n/a";
|
||||
assert_eq!(
|
||||
message.parse_message(&event_record, "NoExistAlias:%NoAliasNoHit%".to_owned()),
|
||||
expected,
|
||||
@@ -517,7 +517,7 @@ mod tests {
|
||||
}
|
||||
"##;
|
||||
let event_record: Value = serde_json::from_str(json_str).unwrap();
|
||||
let expected = "commandline:parsetest3 computername:%ComputerName%";
|
||||
let expected = "commandline:parsetest3 computername:n/a";
|
||||
assert_eq!(
|
||||
message.parse_message(
|
||||
&event_record,
|
||||
|
||||
Reference in New Issue
Block a user