OAuth Apps accessing user mail via GraphAPI [Nobelium]
Description
This query helps you review all OAuth applications accessing user mail via Graph. It could return a significant number of results depending on how many applications are deployed in the environment.
Query · kql
CloudAppEvents | where Timestamp >= ago(1h) | where ActionType == "MailItemsAccessed" | where RawEventData has "00000003-0000-0000-c000-000000000000" // performance | where RawEventData has "ClientAppId" | extend rawData = parse_json(RawEventData) | extend AppId = tostring(parse_json(rawData.AppId)) | where AppId == "00000003-0000-0000-c000-000000000000" // graph API | extend OAuthAppId = tostring(parse_json(rawData.ClientAppId)) // extract OAuthAppId | summarize by OAuthAppId