Azure-Sentinel icon indicating copy to clipboard operation
Azure-Sentinel copied to clipboard

Checking wrong list in query

Open bittib010 opened this issue 1 year ago • 13 comments

Describe the bug The Scheduled rule with GUID 957cb240-f45d-4491-9ba5-93430a3c08be stores the IP as ClientIPOnly, but looks at a nested list [0][0]. At our place, this is constantly wrong, and should only be:

image

Hopefully this will help others as well - I could not find any entries in our logs where this value actually works. We use this column in a title override, but keep getting blank on the IP.

bittib010 avatar Dec 18 '23 12:12 bittib010

Thank you for submitting an Issue to the Azure Sentinel GitHub repo! You should expect an initial response to your Issue from the team within 5 business days. Note that this response may be delayed during holiday periods. For urgent, production-affecting issues please raise a support ticket via the Azure Portal.

github-actions[bot] avatar Dec 18 '23 12:12 github-actions[bot]

Hi @bittib010 , Thanks for flagging this issue, we will investigate this issue and get back to you with some updates by 25Dec2023. Thanks!

v-muuppugund avatar Dec 19 '23 08:12 v-muuppugund

Hi @bittib010, team is still checking on this issue and get back you by - 29-12-2023. Thanks!

v-sudkharat avatar Dec 26 '23 10:12 v-sudkharat

Hi @bittib010 ,Could you please share more details on this issue,Which query?,which solution and what wrong list in query?

v-muuppugund avatar Dec 27 '23 12:12 v-muuppugund

Here is the query: https://github.com/Azure/Azure-Sentinel/blob/e99fa2b06eacbbe3e5865f77b8626ba20919e269/Solutions/Microsoft%20365/Analytic%20Rules/RareOfficeOperations.yaml#L4

And looking at the query, like my original post here, showing the query and where it is looking into nested lists, in our dataset we never get a nested list, and therefore by looking at something that does not exist, we get an empty value: image

Therefore we would like to see if changing it to (end of line 4):

  OfficeActivity
  | where Operation in~ ( "Add-MailboxPermission", "Add-MailboxFolderPermission", "Set-Mailbox", "New-ManagementRoleAssignment", "New-InboxRule", "Set-InboxRule", "Set-TransportRule")
  and not(UserId has_any ('NT AUTHORITY\\SYSTEM (Microsoft.Exchange.ServiceHost)', 'NT AUTHORITY\\SYSTEM (w3wp)', 'devilfish-applicationaccount') and Operation in~ ( "Add-MailboxPermission", "Set-Mailbox"))
  | extend ClientIPOnly = tostring(extract_all(@'\[?(::ffff:)?(?P<IPAddress>(\d+\.\d+\.\d+\.\d+)|[^\]]+)\]?', dynamic(["IPAddress"]), ClientIP)[0])
  | extend AccountName = tostring(split(UserId, "@")[0]), AccountUPNSuffix = tostring(split(UserId, "@")[1])

bittib010 avatar Dec 28 '23 18:12 bittib010

Hi @bittib010 ,I am able to replicate the issue and have only 3 records in our work space,Please find below screen shot for reference image

Could you please share sample data in CSV format to ([email protected]),so will be modify the analytic rule and update you

v-muuppugund avatar Dec 29 '23 08:12 v-muuppugund

Hi @bittib010 ,Gentle Reminder,,I am able to replicate the issue and have only 3 records in our work space,Please find below screen shot for reference image

Could you please share sample data in CSV format to ([email protected]),so will be modify the analytic rule and update you

v-muuppugund avatar Jan 03 '24 10:01 v-muuppugund

I'm sorry, im not able to do so in a while. I hoped you would get the same output as we did, but that shows only that there are differences in the data outputting. I'm currently unavailable to produce any dummy data for the next two weeks as I'm logged off main computer.

bittib010 avatar Jan 03 '24 13:01 bittib010

Hi @bittib010 , Working on the changes ,will be raising PR for the same.

v-muuppugund avatar Jan 08 '24 02:01 v-muuppugund

Hi @bittib010, Team is still working on changes, and will raise a PR once it gets completed. Thanks!

v-sudkharat avatar Jan 10 '24 09:01 v-sudkharat

Hi @bittib010 , Apologies for the delayed response, its a 1p connector, made the changes , need to push it as don't have permissions , Will update you.

v-muuppugund avatar Jan 12 '24 16:01 v-muuppugund

Hi @bittib010 ,just want update,as its 1p connector,we are discussing internally process to push it and will update you once had an update

v-muuppugund avatar Jan 21 '24 11:01 v-muuppugund

Hi @bittib010 ,we have defined the process internally for 1p connector and will be working on the PR,will update you once PR is pushed

v-muuppugund avatar Feb 05 '24 17:02 v-muuppugund

Hi @bittib010 ,PR has merged,so we are closing the issue.

v-muuppugund avatar Mar 18 '24 11:03 v-muuppugund