The query behind the Sentinel Open | New | Active incident widget

Laszlo Pal 20 Reputation points
2024-04-22T11:45:44.6766667+00:00

Hi,

We are trying to figure out what query produces the following numbers in Sentinel

User's image

We've been trying to produce the same numbers using the SecurityIncident and SecurityAlert table, but the number of incidents are much less than showed here.

I'm thinking how this widget interprets an incident which can have multiple alerts, so maybe it counts -incorrectly- each alert as a separated incident.

Did everyone figured this out already?

Thx

L:

Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
986 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Clive Watson 5,716 Reputation points MVP
    2024-04-22T19:02:52.1766667+00:00

    This is the closest I've been able to achieve. I do get some only drift in my Sentinel which shows a few incidents closed in the UI but showing as Active in the query.

    Note, the UI does look back longer for SecurityAlerts (hence the 180days)

    SecurityIncident
    | where TimeGenerated > ago(1d)
    | where Status in('New','Active')
    | extend Alerts = extract("\\[(.*?)\\]", 1, tostring(AlertIds))
    | mv-expand AlertIds to typeof(string), Labels to typeof(string), Comments to typeof(string), AdditionalData to typeof(string)
    | join kind=inner
    (
        SecurityAlert
        | where TimeGenerated > ago(180d)   
        ) on $right.SystemAlertId == $left.AlertIds
        | summarize AlertCount=dcount(AlertIds),
                    arg_max
                    (
                     TimeGenerated, *)
                    by IncidentNumber