Forum Discussion
gsk256
Jan 09, 2023Copper Contributor
Duplicate incidents created by NRT rule
I'm hoping this is the right place to post this (if not please let me know / delete) I have an NRT rule that started creating multiple incidents for a single Azure AD PIM event. The rule has bee...
- Jan 13, 2023
Disabling and enabling the rule worked for me.
-jmn-
Jan 10, 2023Copper Contributor
Can you post the KQL used in the NRT rule?
gsk256
Jan 10, 2023Copper Contributor
-jmn-Here's the Kusto
// PIM info
let pimInfo =
AuditLogs
| where Category =~ "RoleManagement"
| where AADOperationType in ("CreateRequestRoleActivation")//,"ActivateRole")
| where ActivityDisplayName has_any ("Add eligible member to role", "Add member to role")
| extend InitiatingApp = tostring(parse_json(tostring(InitiatedBy.app)).displayName)
| extend Initiator = iif(isnotempty(InitiatingApp), InitiatingApp, tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName))
| extend Target = tostring(TargetResources.userPrincipalName)
| extend strTime = tostring(TimeGenerated);
let pimDetails =
AuditLogs
| where Category =~ "RoleManagement"
| where AADOperationType in ("CreateRequestRoleActivation")//,"ActivateRole")
| where ActivityDisplayName has_any ("Add eligible member to role", "Add member to role")
| mv-expand AdditionalDetails
| extend Key = tostring(AdditionalDetails.key), Value = tostring(AdditionalDetails.value)
| extend p = pack(Key,Value)
| summarize bag = make_bag(p) by TimeGenerated
| evaluate bag_unpack(bag) : (TimeGenerated:datetime, ExpirationTime:datetime, ipaddr:string, Justification:string, oid:string, RoleDefinitionOriginId:string, RoleDefinitionOriginType
:string, StartTime:datetime, TemplateId:string, tid:string, wids:string);
//| extend strTime = tostring();
//union isfuzzy=true roleAssign, pimDetails
let pimAll =
pimInfo
| join kind = leftouter pimDetails on TimeGenerated;
pimAll