KQL 查询在高级搜索中有效,但在设为检测规则时失败

问题描述 投票:0回答:1

我正在尝试进行 KQL 查询,以检测在 5 分钟的时间内对端口 80 上的地址发送超过 5 次的 get 请求。当我在“高级狩猎”中运行该查询时,该查询工作正常,但在分配给检测规则时失败。

我收到的错误是“没有事件与给定的事件标识符(ReportId、AlertId、BehaviourId 或 DeviceId 和时间戳的组合)匹配。编辑这些列的查询聚合表达式,然后重试。”

DeviceNetworkEvents
| extend parsed = parse_json(AdditionalFields)
| where parsed.method has "get"
| where RemotePort == 80
| where not (parsed.host endswith ".goog" or parsed.host startswith "10.32.")
| where not (parsed.uri endswith "windowsupdate.com")
| where not (parsed.host has_any ("intranet", "gvt1.com", "usertrust.com", "entrust.net", "wpad", "169.254.169.254", "adobe.com", "msftconnecttest.com", "narrabay", "windowsupdate.com", "microsoft.com", "digicert.com", "lencr.org", "amazontrust.com"))
| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId, bin(Timestamp, 5m)
| where count_ > 5

据我所知,我需要 ReportId、DeviceId 和 Timestamp 才能使其正常工作,而我已经拥有了。我还尝试了 AlertId 和 BehaviourId。我该怎么做才能使这个检测规则发挥作用?

azure kql microsoft365-defender
1个回答
0
投票

看来我已经明白了。由于我使用了 Timestamp 两次(一次用于 arg_max,一次在 bin 中),它发送了两个时间戳,这似乎使其不起作用。我刚刚添加了

extend timestamp2 = Timestamp

并在 bin 中使用它而不是时间戳本身。

© www.soinside.com 2019 - 2024. All rights reserved.