SC-200 · Question #373
You have a Microsoft 365 subscription. You have the following KQL query. You need to ensure that you can create a Microsoft Defender XDR custom detection rule by using the query. What should you add…
The correct answer is A. | summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId. To make a KQL query valid for a Microsoft Defender XDR custom detection rule, it must include an entity identifier, an action time, and a link to the primary entity, often achieved by summarizing the latest event (arg_max) by DeviceId.
Question
You have a Microsoft 365 subscription. You have the following KQL query. You need to ensure that you can create a Microsoft Defender XDR custom detection rule by using the query. What should you add to the query?
Options
- A| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId
- B| summarize (ReportId)=make_set(ReportId), count() by DeviceId
- C| summarize (Timestamp, DeviceName)=arg_min(Timestamp, DeviceName), count() by DeviceId
- D| summarize (Timestamp)=range(Timestamp), count() by DeviceId
How the community answered
(14 responses)- A71% (10)
- C7% (1)
- D21% (3)
Why each option
To make a KQL query valid for a Microsoft Defender XDR custom detection rule, it must include an entity identifier, an action time, and a link to the primary entity, often achieved by summarizing the latest event (arg_max) by DeviceId.
Custom detection rules in Microsoft Defender XDR require specific columns for the detection to function correctly, including a timestamp (Timestamp), an entity identifier (DeviceId), and a primary entity linking field (often ReportId or a unique event ID). The `arg_max(Timestamp, ReportId)` ensures that the most recent relevant event's ReportId is selected along with its Timestamp for each DeviceId, which satisfies the requirements for a custom detection rule output.
`make_set(ReportId)` creates a set of all ReportIds for a DeviceId, which does not provide a single definitive ReportId linked to the latest event, nor does it explicitly provide the associated Timestamp for rule creation.
`arg_min(Timestamp, DeviceName)` would select the oldest event, but custom detection rules typically focus on the latest or most relevant activity. Also, the primary entity linking field usually relates to the event ID rather than the device name directly in this context.
`range(Timestamp)` returns a dynamic array of timestamps, which is not a single, scalar value suitable for the required 'Timestamp' column in a custom detection rule output.
Concept tested: Microsoft Defender XDR custom detection rule KQL requirements
Source: https://learn.microsoft.com/en-us/microsoft-365/security/defender/custom-detection-rules?view=o365-worldwide#query-structure-for-custom-detection-rules
Community Discussion
No community discussion yet for this question.