Entra Connect Health Leak: Admin Emails Are a Phishing Kit


What this means for your clients: Microsoft told some companies that outsiders were able to see the email addresses of their IT administrators and some basic facts about their Microsoft account setup. No passwords were taken, but expect convincing fake emails and phone calls aimed at those administrators, and confirm any "Microsoft security notice" inside the Microsoft portal instead of clicking a link.
On Friday, November 20, Microsoft sent a notice through Azure Service Health to organizations affected by a security issue in Entra Connect Health, the Microsoft Entra ID cloud service that monitors on-premises identity infrastructure from the Entra admin center. BleepingComputer quoted the notice on November 21. In it, Microsoft says it "determined that unauthorized read-only access to tenant-level metadata associated with your organization had occurred" and that it "did not identify any unauthorized configuration changes."
What the Entra Connect Health issue exposed
Per the notice as reported, the flaw was introduced July 23, Microsoft discovered it November 9, deployed a server-side fix November 19 and finished its investigation November 20. BleepingComputer reports the investigation found the flaw was exploited. The exposed fields were email addresses of tenant technical contacts and administrator accounts; tenant IDs, display names, initial domain names, country codes and regional information; Entra license tiers; directory synchronization status and last sync time; Connect Health onboarding status; and an expired certificate once used to register Connect Health agents with a Microsoft internal service decommissioned in late 2024.
Microsoft says passwords, password hashes, authentication tokens, valid cryptographic keys, on-premises server and Active Directory topology, and Azure subscription information were not exposed. The notice says no software updates or other customer remediation are required. It has not said how many tenants were affected, who was behind it, when access began or how the flaw worked, and we will not guess.
Why this admin email leak is a targeting kit
In our judgment, the danger of this admin email leak is what the tenant metadata and address list make easy. Anyone holding the data can see your administrator and technical contact addresses, which domain to imitate, and which license tier you hold, which hints at whether Conditional Access is in place. If sync is enabled, that status says the tenant runs hybrid identity, so an on-premises account may be another way in. Microsoft itself tells customers to alert security teams to targeted phishing and social engineering against the exposed addresses.
MSPs feel this first. BleepingComputer reports some MSPs received notices for several customer tenants, in one case hours apart, and in our experience the MSP is often the technical contact itself. In our judgment, a fake "Microsoft security notice" to that shared inbox is an obvious lure because it could resemble a real notice.
What to do this week
Check Azure Service Health in the portal for the notice rather than trusting an email that claims to be it. Microsoft published read-only PowerShell scripts at aka.ms/ConnectHealth/scripts; GetTenant.ps1 shows your current values, not what was accessed. Read any script before you run it.
Then verify your tenant's technical contact and notification addresses, remove former staff and unwatched boxes, and ask which mailboxes truly need Global Administrator. Warn admins and the help desk by name. Set a callback rule: knowing a tenant ID, domain or license tier proves nothing, and admin password or MFA resets only happen after a callback to a number on file. Put every privileged role on phishing-resistant MFA, as Microsoft recommends, with FIDO2 keys or passkeys, and review Entra audit and sign-in logs, which is what the hunts below do.
How to hunt
We have not run these in a live tenant; tune field names and test before trusting a clean result. Splunk assumes the Microsoft Cloud Services and Office 365 add-ons plus a mail source, Elastic the Azure and Microsoft 365 integrations plus a mail index. The Microsoft KQL examples run in Microsoft Sentinel and require the listed watchlists and connected Entra, Office and Defender email data. The CrowdStrike Falcon LogScale identity hunts need you to ingest Entra ID and M365 logs into LogScale or Next-Gen SIEM. Every YOUR_ name, REPLACE_WITH_ value, #repo and LogScale field is a placeholder. You supply two lists, in lowercase: privileged role members, and admin plus technical contact addresses.
Test 1: what normal admin sign-ins look like
In Splunk, Elastic and KQL this lists each privileged admin with 30 days of sign-ins, failures, IPs, countries and apps. LogScale counts distinct admins seen and returns a limited collection of distinct formatted sign-in values, so compare against the underlying events and your admin list to find missing admins. A summary row flags an empty admin list, no observed sign-in events or the earliest observed sign-in falling within the last 29 days. These checks do not prove that ingestion covered the full 30 days. An admin with no sign-ins is flagged, never shown clean.
Field mapping: Splunk uses a CSV lookup, Elastic a lookup index joined by FROM, LogScale a CSV plus an expected admin count that flags until filled, and KQL a watchlist with SigninLogs.
False positives: none as such; this is the baseline.
Splunk
| inputlookup YOUR_ADMIN_LIST.csv
| eval user=lower(user)
| fields user
| join type=left user
[search index=YOUR_ENTRA_INDEX sourcetype="azure:monitor:aad" (category=SignInLogs OR category=NonInteractiveUserSignInLogs) earliest=-30d latest=now
| eval user=lower('properties.userPrincipalName')
| stats count AS signins count(eval('properties.status.errorCode'!=0)) AS failures values('properties.ipAddress') AS ips values('properties.location.countryOrRegion') AS countries values('properties.appDisplayName') AS apps values('properties.authenticationRequirement') AS auth_required max(_time) AS last_seen BY user]
| eval signins=coalesce(signins, 0), failures=coalesce(failures, 0)
| eval status=if(signins=0, "2 NO SIGN-INS SEEN: check the source or a dormant admin", "3 baseline: review IPs, countries and apps")
| append
[search index=YOUR_ENTRA_INDEX sourcetype="azure:monitor:aad" (category=SignInLogs OR category=NonInteractiveUserSignInLogs) earliest=-30d latest=now
| stats count AS events min(_time) AS earliest
| appendcols [| inputlookup YOUR_ADMIN_LIST.csv | stats count AS admins]
| eval user="SUMMARY", status=case(admins=0, "1 ADMIN LIST EMPTY: load your privileged role members", events=0, "1 NO SIGN-IN EVENTS OBSERVED IN 30 DAYS: verify ingestion", earliest>relative_time(now(), "-29d"), "2 EARLIEST OBSERVED SIGN-IN IS WITHIN 29 DAYS: verify coverage", true(), "4 source present: review every admin row")]
| sort status
| convert ctime(last_seen)Elastic
FROM logs-azure.signinlogs-*, YOUR_ADMIN_LOOKUP
| WHERE @timestamp >= NOW() - 30 days OR is_admin == 1
| EVAL u = TO_LOWER(COALESCE(admin_upn, azure.signinlogs.properties.user_principal_name)), adm = CASE(is_admin == 1, 1, 0), si = CASE(azure.signinlogs.properties.user_principal_name IS NOT NULL, 1, 0)
| EVAL si_time = CASE(si == 1, @timestamp, NULL), fail = CASE(si == 1 AND azure.signinlogs.properties.status.error_code != 0, 1, 0)
| EVAL ip_text = TO_STRING(source.ip)
| STATS admin = MAX(adm), signins = SUM(si), failures = SUM(fail), ips = VALUES(ip_text), countries = VALUES(source.geo.country_iso_code), apps = VALUES(azure.signinlogs.properties.app_display_name), first_si = MIN(si_time) BY u
| EVAL row = CASE(admin == 1, CONCAT(u, " | sign-ins ", TO_STRING(signins), " | failures ", TO_STRING(failures), " | ips ", COALESCE(MV_CONCAT(ips, ", "), "none"), " | countries ", COALESCE(MV_CONCAT(countries, ", "), "none"), " | apps ", COALESCE(MV_CONCAT(apps, ", "), "none"), CASE(signins == 0, " | NO SIGN-INS SEEN: check the source or a dormant admin", "")), NULL)
| STATS admins = SUM(admin), signin_events = SUM(signins), earliest = MIN(first_si), rows = VALUES(row)
| EVAL status = CASE(admins IS NULL OR admins == 0, "1 ADMIN LIST EMPTY: load your privileged role members", signin_events IS NULL OR signin_events == 0, "1 NO SIGN-IN EVENTS OBSERVED IN 30 DAYS: verify ingestion", earliest > NOW() - 29 days, "2 EARLIEST OBSERVED SIGN-IN IS WITHIN 29 DAYS: verify coverage", "4 source present: review every admin row")CrowdStrike
// needs Entra ID sign-in logs ingested into LogScale or Next-Gen SIEM; #repo and every field name here are placeholders for your parser
// upload YOUR_ADMIN_LIST.csv (column upn) and put your admin count in admin_expected; set the time picker to the last 30 days
// no output at all can mean the sign-in source returned no events; verify ingestion separately
#repo=YOUR_ENTRA_REPO category=/SignInLogs$/
| now()
| user_principal_name := lower(user_principal_name)
| case {
match(file="YOUR_ADMIN_LIST.csv", field=user_principal_name, column=upn, strict=true) | admin_user := user_principal_name | row := format("%s | %s | %s | %s | %s", field=[user_principal_name, source_ip, country, app_name, error_code]) ;
* | is_admin := 0 }
| stats([count(as=signin_events), min(@timestamp, as=earliest), max(_now, as=now_ms), count(admin_user, distinct=true, as=admins_seen), collect([row])])
| admin_expected := "REPLACE_WITH_ADMIN_COUNT"
| case {
test(signin_events == 0) | status := "1 NO SIGN-IN EVENTS OBSERVED IN 30 DAYS: verify ingestion" ;
test(earliest > now_ms - 2505600000) | status := "2 EARLIEST OBSERVED SIGN-IN IS WITHIN 29 DAYS: verify coverage" ;
admin_expected!=/^[0-9]+$/ | status := "1 ADMIN COUNT NOT SET: fill REPLACE_WITH_ADMIN_COUNT" ;
test(admin_expected == 0) | status := "1 ADMIN LIST EMPTY: load your privileged role members and set the count" ;
test(admins_seen < admin_expected) | status := "2 SOME ADMINS HAVE NO SIGN-INS: compare underlying events with your list" ;
* | status := "4 source present: review every admin row" }Microsoft KQL
let admins = _GetWatchlist("YOUR_ADMIN_LIST") | project User = tolower(tostring(UserPrincipalName));
let si = union (SigninLogs | where TimeGenerated > ago(30d) | extend Loc = tostring(LocationDetails)), (AADNonInteractiveUserSignInLogs | where TimeGenerated > ago(30d) | extend Loc = tostring(LocationDetails));
let health = si
| summarize Events = count(), Earliest = min(TimeGenerated)
| extend Admins = toscalar(admins | count)
| extend Status = case(Admins == 0, "1 ADMIN LIST EMPTY: load your privileged role members", Events == 0, "1 NO SIGN-IN EVENTS OBSERVED IN 30 DAYS: verify ingestion", Earliest > ago(29d), "2 EARLIEST OBSERVED SIGN-IN IS WITHIN 29 DAYS: verify coverage", "4 source present: review every admin row")
| project User = "SUMMARY", Status, SignIns = Events;
let per = admins
| join kind=leftouter (si
| extend User = tolower(UserPrincipalName), Country = tostring(parse_json(Loc).countryOrRegion)
| summarize SignIns = count(), Failures = countif(ResultType != "0"), IPs = make_set(IPAddress, 20), Countries = make_set(Country, 10), Apps = make_set(AppDisplayName, 10), AuthRequired = make_set(AuthenticationRequirement, 5), LastSeen = max(TimeGenerated) by User) on User
| extend SignIns = coalesce(SignIns, 0)
| extend Status = iff(SignIns == 0, "2 NO SIGN-INS SEEN: check the source or a dormant admin", "3 baseline: review IPs, countries and apps")
| project User, Status, SignIns, Failures, IPs, Countries, Apps, AuthRequired, LastSeen;
union health, per
| order by Status ascHunt 1: lures aimed at admin addresses
This flags inbound mail in the last 14 days to listed addresses where the sender name or subject mentions Microsoft, Entra, Azure, Service Health, security notice or tenant from a non-Microsoft domain, or where a sender domain new in 30 days sent a link or attachment.
Field mapping: KQL reads EmailEvents and checks the subject, plus the sender display name where your schema has it; Splunk, Elastic and LogScale mail fields are placeholders. Our Microsoft allowlist is short on purpose.
False positives: vendors and newsletters mention Microsoft constantly, and some real Microsoft mail uses other domains.
Splunk
index=YOUR_EMAIL_INDEX sourcetype=YOUR_EMAIL_SOURCETYPE direction="inbound" earliest=-44d latest=now
| eval rcpt=lower(recipient), sdom=lower(src_user_domain)
| lookup YOUR_ADMIN_CONTACTS.csv email AS rcpt OUTPUT email AS listed
| where isnotnull(listed)
| eval recent=if(_time>=relative_time(now(), "-14d"), 1, 0)
| eval lure=if(match(coalesce(sender_display_name, "")." ".coalesce(subject, ""), "(?i)microsoft|entra|azure|service health|security notice|tenant") AND NOT match(sdom, "(^|[.])(microsoft[.]com|microsoftonline[.]com|azure[.]com)$"), 1, 0)
| eval linkfile=if(tonumber(coalesce(url_count, "0"))>0 OR tonumber(coalesce(attachment_count, "0"))>0, 1, 0)
| stats min(_time) AS first_seen sum(eval(recent*lure)) AS lure_msgs sum(eval(recent*linkfile)) AS link_msgs values(eval(if(recent=1, subject, null()))) AS subjects values(eval(if(recent=1, src_user, null()))) AS senders BY rcpt sdom
| eval flag=case(lure_msgs>0, "1 Microsoft-themed lure from a non-Microsoft domain", first_seen>=relative_time(now(), "-14d") AND link_msgs>0, "2 new sender domain with a link or attachment", true(), null())
| where isnotnull(flag)
| sort flag - lure_msgs
| convert ctime(first_seen)Elastic
FROM YOUR_EMAIL_INDEX
| WHERE @timestamp >= NOW() - 44 days AND email.direction == "inbound"
| MV_EXPAND email.to.address
| EVAL contact_email = TO_LOWER(email.to.address), sdom = TO_LOWER(MV_LAST(SPLIT(email.from.address, "@")))
| LOOKUP JOIN YOUR_CONTACTS_LOOKUP ON contact_email
| WHERE is_contact == 1
| EVAL recent = CASE(@timestamp >= NOW() - 14 days, 1, 0), txt = TO_LOWER(CONCAT(COALESCE(sender_display_name, ""), " ", COALESCE(email.subject, "")))
| EVAL lure = CASE(txt RLIKE """.*(microsoft|entra|azure|service health|security notice|tenant).*""" AND NOT sdom RLIKE """(.*\.)?(microsoft\.com|microsoftonline\.com|azure\.com)""", 1, 0), linkfile = CASE(url_count > 0 OR attachment_count > 0, 1, 0)
| EVAL lure_recent = recent * lure, link_recent = recent * linkfile, subj = CASE(recent == 1, email.subject, NULL)
| STATS first_seen = MIN(@timestamp), lure_msgs = SUM(lure_recent), link_msgs = SUM(link_recent), subjects = VALUES(subj) BY contact_email, sdom
| EVAL flag = CASE(lure_msgs > 0, "1 Microsoft-themed lure from a non-Microsoft domain", first_seen >= NOW() - 14 days AND link_msgs > 0, "2 new sender domain with a link or attachment", NULL)
| WHERE flag IS NOT NULL
| SORT flag, lure_msgs DESCCrowdStrike
// needs Defender for Office 365 or M365 message data ingested into LogScale or Next-Gen SIEM; #repo and every field name here are placeholders for your parser
// upload YOUR_ADMIN_CONTACTS.csv (column email); set the time picker to the last 44 days (14 days of mail plus 30 days of sender history, our choice)
#repo=YOUR_EMAIL_REPO direction=inbound
| now()
| rcpt := lower(recipient)
| match(file="YOUR_ADMIN_CONTACTS.csv", field=rcpt, column=email, strict=true)
| sdom := lower(sender_domain)
| case { test(@timestamp > _now - 1209600000) | recent := 1 ; * | recent := 0 }
| case {
sdom=/(^|\.)(microsoft\.com|microsoftonline\.com|azure\.com)$/ | lure := 0 ;
sender_display_name=/microsoft|entra|azure|service health|security notice|tenant/i | lure := 1 ;
subject=/microsoft|entra|azure|service health|security notice|tenant/i | lure := 1 ;
* | lure := 0 }
| default(field=url_count, value=0)
| default(field=attachment_count, value=0)
| case { test(url_count > 0) | linkfile := 1 ; test(attachment_count > 0) | linkfile := 1 ; * | linkfile := 0 }
| lure_recent := recent * lure
| link_recent := recent * linkfile
| groupBy([rcpt, sdom], function=[min(@timestamp, as=first_seen), sum(lure_recent, as=lure_msgs), sum(link_recent, as=link_msgs), max(_now, as=now_ms), collect([subject, sender])])
| case {
test(lure_msgs > 0) | flag := "1 Microsoft-themed lure from a non-Microsoft domain" ;
test(first_seen > now_ms - 1209600000) | test(link_msgs > 0) | flag := "2 new sender domain with a link or attachment" }
| sort(flag, order=asc, limit=10000)Microsoft KQL
let contacts = _GetWatchlist("YOUR_ADMIN_CONTACTS") | project Rcpt = tolower(tostring(EmailAddress));
let lure = @"(?i)microsoft|entra|azure|service health|security notice|tenant";
let msft = @"(?i)(^|\.)(microsoft\.com|microsoftonline\.com|azure\.com)$";
EmailEvents
| where Timestamp > ago(44d) and EmailDirection == "Inbound"
| extend Rcpt = tolower(RecipientEmailAddress)
| where Rcpt in (contacts)
| extend Sdom = tolower(SenderFromDomain), Recent = Timestamp > ago(14d), Lure = (column_ifexists("SenderDisplayName", "") matches regex lure or Subject matches regex lure) and not(SenderFromDomain matches regex msft), LinkOrFile = UrlCount > 0 or AttachmentCount > 0
| summarize FirstSeen = min(Timestamp), LureMsgs = countif(Recent and Lure), LinkMsgs = countif(Recent and LinkOrFile), Subjects = make_set_if(Subject, Recent, 10), Senders = make_set_if(SenderFromAddress, Recent, 10), Actions = make_set_if(DeliveryAction, Recent, 5) by Rcpt, Sdom
| extend Flag = case(LureMsgs > 0, "1 Microsoft-themed lure from a non-Microsoft domain", FirstSeen > ago(14d) and LinkMsgs > 0, "2 new sender domain with a link or attachment", "")
| where isnotempty(Flag)
| order by Flag asc, LureMsgs descHunt 2: admin sign-ins that do not fit
This flags an admin IP with a successful sign-in in the last 14 days and no successful sign-in from it in the 30 days before. It also flags ten or more failures for one admin from one IP in 14 days, our threshold, which fits password spray or MFA fatigue against the now-known addresses.
Field mapping: KQL unions interactive and non-interactive sign-ins; others match on user and IP.
False positives: travel, new home ISPs and MFA interrupts counted as failures. Spray spread across many IPs needs a per-user count.
Splunk
index=YOUR_ENTRA_INDEX sourcetype="azure:monitor:aad" (category=SignInLogs OR category=NonInteractiveUserSignInLogs) earliest=-44d latest=now
| eval user=lower('properties.userPrincipalName'), ip='properties.ipAddress'
| lookup YOUR_ADMIN_LIST.csv user OUTPUT user AS listed
| where isnotnull(listed)
| eval ok=if('properties.status.errorCode'=0, 1, 0), recent=if(_time>=relative_time(now(), "-14d"), 1, 0)
| stats min(eval(if(ok=1, _time, null()))) AS first_ok sum(eval(ok*recent)) AS recent_ok sum(eval((1-ok)*recent)) AS recent_fail values('properties.location.countryOrRegion') AS countries values('properties.appDisplayName') AS apps values(eval(if(ok=0, 'properties.status.errorCode', null()))) AS error_codes BY user ip
| eval flag=case(recent_ok>0 AND first_ok>=relative_time(now(), "-14d"), "1 successful sign-in from an IP with no successful sign-in in the preceding baseline", recent_fail>=10, "2 ten or more failures from one IP", true(), null())
| where isnotnull(flag)
| sort flag - recent_fail
| convert ctime(first_ok)Elastic
FROM logs-azure.signinlogs-*
| WHERE @timestamp >= NOW() - 44 days
| EVAL admin_upn = TO_LOWER(azure.signinlogs.properties.user_principal_name), ip = TO_STRING(source.ip)
| LOOKUP JOIN YOUR_ADMIN_LOOKUP ON admin_upn
| WHERE is_admin == 1
| EVAL ok = CASE(azure.signinlogs.properties.status.error_code == 0, 1, 0), recent = CASE(@timestamp >= NOW() - 14 days, 1, 0)
| EVAL ok_time = CASE(ok == 1, @timestamp, NULL), ok_recent = ok * recent, fail_recent = (1 - ok) * recent
| STATS first_ok = MIN(ok_time), recent_ok = SUM(ok_recent), recent_fail = SUM(fail_recent), countries = VALUES(source.geo.country_iso_code), apps = VALUES(azure.signinlogs.properties.app_display_name) BY admin_upn, ip
| EVAL flag = CASE(recent_ok > 0 AND first_ok >= NOW() - 14 days, "1 successful sign-in from an IP with no successful sign-in in the preceding baseline", recent_fail >= 10, "2 ten or more failures from one IP", NULL)
| WHERE flag IS NOT NULL
| SORT flag, recent_fail DESCCrowdStrike
// needs Entra ID sign-in logs ingested into LogScale or Next-Gen SIEM; #repo and every field name here are placeholders for your parser
// upload YOUR_ADMIN_LIST.csv (column upn); set the time picker to the last 44 days (14 days of hunting plus 30 days of history, our choice)
#repo=YOUR_ENTRA_REPO category=/SignInLogs$/
| now()
| user_principal_name := lower(user_principal_name)
| match(file="YOUR_ADMIN_LIST.csv", field=user_principal_name, column=upn, strict=true)
| case { test(@timestamp > _now - 1209600000) | recent := 1 ; * | recent := 0 }
| case { error_code="0" | ok := 1 | ok_time := @timestamp ; * | ok := 0 }
| ok_recent := ok * recent
| fail_recent := (1 - ok) * recent
| groupBy([user_principal_name, source_ip], function=[min(ok_time, as=first_ok), sum(ok_recent, as=recent_ok), sum(fail_recent, as=recent_fail), max(_now, as=now_ms), collect([country, app_name, error_code])])
| default(field=first_ok, value=0)
| case {
test(recent_ok > 0) | test(first_ok > now_ms - 1209600000) | flag := "1 successful sign-in from an IP with no successful sign-in in the preceding baseline" ;
test(recent_fail >= 10) | flag := "2 ten or more failures from one IP" }
| sort(flag, order=asc, limit=10000)Microsoft KQL
let admins = _GetWatchlist("YOUR_ADMIN_LIST") | project User = tolower(tostring(UserPrincipalName));
union (SigninLogs | where TimeGenerated > ago(44d) | extend Loc = tostring(LocationDetails)), (AADNonInteractiveUserSignInLogs | where TimeGenerated > ago(44d) | extend Loc = tostring(LocationDetails))
| extend User = tolower(UserPrincipalName)
| where User in (admins)
| extend Ok = ResultType == "0", Recent = TimeGenerated > ago(14d), Country = tostring(parse_json(Loc).countryOrRegion)
| summarize FirstOk = minif(TimeGenerated, Ok), RecentOk = countif(Ok and Recent), RecentFail = countif(not(Ok) and Recent), Countries = make_set(Country, 5), Apps = make_set_if(AppDisplayName, Recent, 10), ErrorCodes = make_set_if(ResultType, Recent and not(Ok), 10) by User, IPAddress
| extend Flag = case(RecentOk > 0 and FirstOk > ago(14d), "1 successful sign-in from an IP with no successful sign-in in the preceding baseline", RecentFail >= 10, "2 ten or more failures from one IP", "")
| where isnotempty(Flag)
| order by Flag asc, RecentFail descHunt 3: what an attacker does after a successful admin phish
This lists 30 days of security info changes, password resets, role assignments, app consents including admin consent, new app credentials and inbox rules. It keeps security info, password reset and inbox rule events only when a listed admin is the recorded actor or the inspected target. The Splunk, Elastic and KQL versions inspect only the first audit target, so check events with several targets separately. Inbox rule rows match only the recorded UserId, so separately check rules another account changed on an admin mailbox. Every role and app change stays in.
Field mapping: activity names come from Microsoft's Entra audit reference and inbox rule operations from the Unified Audit Log. We found no documented Entra Connect Health audit activity, so we dropped that check; review Connect Health configurations in the portal, as Microsoft advises.
False positives: onboarding, planned admin work and legitimate app installs.
Splunk
earliest=-30d latest=now ((index=YOUR_ENTRA_INDEX sourcetype="azure:monitor:aad" category=AuditLogs) OR (index=YOUR_O365_INDEX sourcetype="o365:management:activity" Operation IN ("New-InboxRule", "Set-InboxRule", "UpdateInboxRules")))
| eval op=coalesce(operationName, Operation)
| eval kind=case(in(op, "User registered security info", "Admin registered security info", "User changed default security info", "User updated security info", "Admin updated security info", "User deleted security info", "Admin deleted security info"), "security info", in(op, "Reset password (by admin)", "Reset password", "Change user password", "Set force change user password", "Admin started password reset"), "password reset", in(op, "Add member to role", "Add eligible member to role", "Add member to role outside of PIM (permanent)"), "role assignment", in(op, "Consent to application", "Add delegated permission grant", "Add app role assignment to service principal", "Add service principal credentials", "Add owner to application") OR like(op, "Update application%Certificates and secrets%"), "app consent or credential", in(op, "New-InboxRule", "Set-InboxRule", "UpdateInboxRules"), "inbox rule", true(), null())
| where isnotnull(kind)
| eval actor=lower(coalesce('properties.initiatedBy.user.userPrincipalName', UserId)), target=lower(coalesce(mvindex('properties.targetResources{}.userPrincipalName', 0), UserId)), target_name=mvindex('properties.targetResources{}.displayName', 0)
| lookup YOUR_ADMIN_LIST.csv user AS target OUTPUT user AS target_admin
| lookup YOUR_ADMIN_LIST.csv user AS actor OUTPUT user AS actor_admin
| eval admin_involved=if(isnotnull(target_admin) OR isnotnull(actor_admin), 1, 0)
| where kind="role assignment" OR kind="app consent or credential" OR admin_involved=1
| table _time kind op actor target target_name admin_involved
| sort - admin_involved - _timeElastic
FROM logs-azure.auditlogs-*, logs-o365.audit-*
| WHERE @timestamp >= NOW() - 30 days
| EVAL op = COALESCE(azure.auditlogs.operation_name, o365.audit.Operation)
| EVAL kind = CASE(op IN ("User registered security info", "Admin registered security info", "User changed default security info", "User updated security info", "Admin updated security info", "User deleted security info", "Admin deleted security info"), "security info", op IN ("Reset password (by admin)", "Reset password", "Change user password", "Set force change user password", "Admin started password reset"), "password reset", op IN ("Add member to role", "Add eligible member to role", "Add member to role outside of PIM (permanent)"), "role assignment", op IN ("Consent to application", "Add delegated permission grant", "Add app role assignment to service principal", "Add service principal credentials", "Add owner to application") OR op LIKE "Update application*Certificates and secrets*", "app consent or credential", op IN ("New-InboxRule", "Set-InboxRule", "UpdateInboxRules"), "inbox rule", NULL)
| WHERE kind IS NOT NULL
| EVAL actor = TO_LOWER(COALESCE(azure.auditlogs.properties.initiated_by.user.userPrincipalName, o365.audit.UserId)), target = TO_LOWER(COALESCE(azure.auditlogs.properties.target_resources.0.user_principal_name, o365.audit.UserId))
| EVAL admin_upn = target
| LOOKUP JOIN YOUR_ADMIN_LOOKUP ON admin_upn
| EVAL target_admin = CASE(is_admin == 1, 1, 0), admin_upn = actor
| DROP is_admin
| LOOKUP JOIN YOUR_ADMIN_LOOKUP ON admin_upn
| EVAL admin_involved = CASE(target_admin == 1 OR is_admin == 1, 1, 0)
| WHERE kind IN ("role assignment", "app consent or credential") OR admin_involved == 1
| KEEP @timestamp, kind, op, actor, target, admin_involved
| SORT admin_involved DESC, @timestamp DESC
| LIMIT 10000CrowdStrike
// needs Entra ID audit logs and the M365 Unified Audit Log ingested into LogScale or Next-Gen SIEM; #repo and every field name here are placeholders for your parser
// upload YOUR_ADMIN_LIST.csv (column upn); set the time picker to the last 30 days
#repo=YOUR_M365_REPO
| case {
in(field=operation, values=["User registered security info", "Admin registered security info", "User changed default security info", "User updated security info", "Admin updated security info", "User deleted security info", "Admin deleted security info"]) | kind := "security info" ;
in(field=operation, values=["Reset password (by admin)", "Reset password", "Change user password", "Set force change user password", "Admin started password reset"]) | kind := "password reset" ;
in(field=operation, values=["Add member to role", "Add eligible member to role", "Add member to role outside of PIM (permanent)"]) | kind := "role assignment" ;
in(field=operation, values=["Consent to application", "Add delegated permission grant", "Add app role assignment to service principal", "Add service principal credentials", "Add owner to application"]) | kind := "app consent or credential" ;
operation=/^Update application.*Certificates and secrets/ | kind := "app consent or credential" ;
in(field=operation, values=["New-InboxRule", "Set-InboxRule", "UpdateInboxRules"]) | kind := "inbox rule" }
| actor := lower(actor_upn)
| target := lower(target_upn)
| case { match(file="YOUR_ADMIN_LIST.csv", field=target, column=upn, strict=true) | target_admin := 1 ; * | target_admin := 0 }
| case { match(file="YOUR_ADMIN_LIST.csv", field=actor, column=upn, strict=true) | actor_admin := 1 ; * | actor_admin := 0 }
| admin_involved := target_admin + actor_admin
| case { kind=/^(role assignment|app consent or credential)$/ ; test(admin_involved > 0) }
| sort(field=[admin_involved, @timestamp], order=[desc, desc], limit=10000)
| select([@timestamp, kind, operation, actor, target, admin_involved])Microsoft KQL
let adminset = toscalar(_GetWatchlist("YOUR_ADMIN_LIST") | summarize make_set(tolower(tostring(UserPrincipalName))));
let sec = dynamic(["User registered security info", "Admin registered security info", "User changed default security info", "User updated security info", "Admin updated security info", "User deleted security info", "Admin deleted security info"]);
let pw = dynamic(["Reset password (by admin)", "Reset password", "Change user password", "Set force change user password", "Admin started password reset"]);
let role = dynamic(["Add member to role", "Add eligible member to role", "Add member to role outside of PIM (permanent)"]);
let app = dynamic(["Consent to application", "Add delegated permission grant", "Add app role assignment to service principal", "Add service principal credentials", "Add owner to application"]);
union
(AuditLogs
| where TimeGenerated > ago(30d)
| extend Op = OperationName, Actor = tolower(tostring(InitiatedBy.user.userPrincipalName)), Target = tolower(tostring(TargetResources[0].userPrincipalName)), TargetName = tostring(TargetResources[0].displayName)
| extend Kind = case(Op in (sec), "security info", Op in (pw), "password reset", Op in (role), "role assignment", Op in (app) or (Op startswith "Update application" and Op contains "Certificates and secrets"), "app consent or credential", "")
| where isnotempty(Kind)),
(OfficeActivity
| where TimeGenerated > ago(30d) and Operation in ("New-InboxRule", "Set-InboxRule", "UpdateInboxRules")
| extend Op = Operation, Actor = tolower(UserId), Target = tolower(UserId), TargetName = "", Kind = "inbox rule")
| extend AdminInvolved = iff(set_has_element(adminset, Target) or set_has_element(adminset, Actor), 1, 0)
| where Kind in ("role assignment", "app consent or credential") or AdminInvolved == 1
| project TimeGenerated, Kind, Op, Actor, Target, TargetName, AdminInvolved
| order by AdminInvolved desc, TimeGenerated descReading the results
In our judgment, a Microsoft-themed lure to a listed admin followed by a new-IP sign-in or an MFA registration on that account is an incident. Revoke sessions, reset through the callback rule and review consents. A lure or new-IP sign-in alone means warning that admin and confirming with them. An unplanned role assignment, admin consent or new app credential in Hunt 3 needs an owner today, lure or not.
One next step
To see how your tenant's admins, MFA and sign-in risk hold up, start with a free Inception Foresight M365 Assessment.



