Skip to content

Conversation

@yummyblabla
Copy link
Collaborator

@yummyblabla yummyblabla commented Jan 9, 2026

Fixes:

  • Removal of unnormalized columns
  • Change use of TimeGenerated to Timestamp
  • Convert columns that were dynamic to string
  • Remove replace deprecated function with replace_regex

Copy link
Contributor

@oshezaf oshezaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments. However the major issue here is that AlertEvidence does not map well because it has multiple rows for the same alert (it lists the evidence or entities). Think about someone counring alerts using the Alerts schema.... Not something we will change at this point in time.

| where not(disabled)
// Mapping Inspection Fields
| extend AdditionalFields = todynamic(AdditionalFields)
| extend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project-rename for those applicable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

AlertVerdictDate_s = todatetime(AdditionalFields.ThreatAnalysisSummary[0].AnalysisDate),
AttackTactics = iff(Categories has_any (AttackTacticSet), replace_regex(Categories, @"[\[\]\""]", ""), ""),
AlertOriginalStatus = tostring(AdditionalFields.LastRemediationState),
AlertStatus = iif(isnotempty(AdditionalFields.LastRemediationState), iif(AdditionalFields.LastRemediationState == "Active", "Active", "Closed"), ""),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case statement, and can use AlertOriginalStatus (splitting to to extend of course)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

// Mapping Device Entity
| extend
DvcId = coalesce(DeviceId, tostring(AdditionalFields.Host.MachineId)),
DvcIpAddr = coalesce(LocalIP, tostring(AdditionalFields.Host.IpInterfaces[0].Address), RemoteIP),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how RemoteIP can be a DevIpAddr

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the fault of the AlertEvent schema. It does not contain DstIpAddr, where we could potentially map RemoteIP to

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect RemoteIP is SrcIpAddr

DvcOsVersion = tostring(coalesce(AdditionalFields.OSVersion, AdditionalFields.Host.OSVersion)),
DeviceName = coalesce(DeviceName, tostring(AdditionalFields.Host.NetBiosName)),
DvcScopeId = coalesce(tostring(split(AdditionalFields.AzureID, "/")[2]), (tostring(split(AdditionalFields.ResourceId, "/")[2])))
| extend DvcIdType = iif(isnotempty(DvcId), "MDEid", "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this would depend on the DvcId selected by the coalesce operator above

Copy link
Collaborator Author

@yummyblabla yummyblabla Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking with sample data, both are the same. However, it should be FQDN, and not MDEid

According to doc,
DeviceName | string | Fully qualified domain name (FQDN) of the machine.

https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/alertevidence

AlertEvidence
| where not(disabled)
// Mapping Inspection Fields
| extend AdditionalFields = todynamic(AdditionalFields)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't parse JSON (which is what todynamic does) prior to pre-filtering. You prefilter on the string and post verify after the parsing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifact of the RDA table treating this column as string and not dynamic. Will remove.
https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/alertevidence

Copy link
Contributor

@oshezaf oshezaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can discuss the pre-fitlering topic Monday.

| extend AdditionalFields = todynamic(AdditionalFields)
| where (isnull(starttime) or Timestamp >= starttime)
and (isnull(endtime) or Timestamp <= endtime)
and ((array_length(ipaddr_has_any_prefix) == 0) or (has_any_ipv4_prefix(LocalIP, ipaddr_has_any_prefix)) or (has_any_ipv4_prefix(tostring(AdditionalFields.Host.IpInterfaces[0].Address), ipaddr_has_any_prefix)) or (has_any_ipv4_prefix(RemoteIP, ipaddr_has_any_prefix)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the field always dynamic? So you could just remove the todynamic? Anyways, the efficient way to do the prefiltering is not just to not convert to dynamic, but to actually use test over the entire string. Otherwise, you are back to calculated fields conditions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field was always dynamic. It is string in RDA

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing to WindowsEvent where EventData is dynamic, the filtering performance here should be similar.'

https://github.com/Azure/Azure-Sentinel/blob/master/Parsers/ASimFileEvent/Parsers/vimFileEventMicrosoftSysmonWindowsEvent.yaml

Copy link
Contributor

@oshezaf oshezaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments:

  1. Requiring change - we again have here the issue of searching in a value that may not get into the normalized event (i.e. RemoteIP being matched by not selected as DcvIpAddr. Let's use again the AdditionalFields solution.
  2. No change required, but please look into string vs. dynamic "has" performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants