I work at an MSSP. Our clients trust us with access to their environments, and so do the vendor tools we connect to their tenants. This post is about what happens when one of those trusted tools is turned against every customer at once, and the attacker driving it is a team of AI agents that does not sleep.
In October 2026, Microsoft attributed a supply chain compromise of ConnectWise Cloud Backup (formerly SkyKick Backup) to Storm-0940, a China-aligned actor active since 2021. Using a stolen credential of the backup application and ARTEX, an open-source multi-agent AI pentest framework, the actor attempted sign-ins to more than 2,250 Microsoft 365 tenants. In some of them it went from first touch to privileged cloud access in under three hours. In one, an application gave itself Global Administrator and planted new secrets in other applications, including a security vendor's own app, in about five minutes.
No user typed a password. No phishing email. No endpoint was touched, so no EDR saw anything. Every step was an API call to Microsoft's cloud, and every step left a trace in logs that most SOCs either do not collect or never look at. This post goes deep on how the app-only path works, where it shows up, and how to detect it in Cortex XDR and Splunk. The four new rules are in my detection library as DL-0076 to DL-0079, and you can paste raw Entra ID audit or sign-in JSON into the playground to see them fire.
What happened
| Date (2026, UTC) | What happened |
|---|---|
| Early September | Earliest ARTEX-driven activity Microsoft attributes to Storm-0940 |
| 10 to 14 October | Password spray from 144.172.64.99 against 327 accounts in 8 organizations: more than 151,000 failed logons, about 2,900 per minute at the 11 October peak, almost all ending in lockouts. No successful sign-in from this wave |
| 13 to 14 October | Scripted sign-ins as the backup app from 144.172.64.128 with curl/7.88.1, plus spraying against four law firm tenants |
| 15 October, 06:13 to 08:34 | Graph tokens collected in customer tenants one after another, a few seconds apart, in sorted tenant GUID order: a script working through a list |
| 15 October | ConnectWise Cloud Management service principals add themselves to directory roles (mostly Exchange Administrator) in about fifty monitored tenants; a PIM alert for one self-assignment is reported publicly |
| 16 October | ConnectWise publishes its first advisory; Huntress confirms sign-ins in more than 160 of its customers' tenants |
| 17 October, 05:01 | ConnectWise shuts down Cloud Backup access and disables seven application identities; SaaS Security and Cloud Management go offline the next day |
| 21 October | Microsoft publishes its analysis, attribution to Storm-0940 and hunting queries |
The targeting was broad: aerospace and defense, energy, finance, government, legal, manufacturing, semiconductors, technology and think tanks, among others. Microsoft says most of the attempts failed. The ones that worked are the reason every MSP and every tenant that trusts one should read this.
Why the usual defenses never fired
To understand the detections you have to understand the path, because it is not a user path at all.
One secret, every tenant
A SaaS backup service is registered in Microsoft Entra ID as a multi-tenant application. The application object lives in the vendor's tenant. When a customer connects the service, an administrator grants admin consent, and Entra creates a service principal for that app inside the customer's tenant, with the application permissions the vendor asked for (to read every mailbox, every OneDrive and SharePoint site, Teams, the directory). From then on the vendor's backend does not need anyone to sign in. It uses the OAuth 2.0 client credentials flow with the app's secret or certificate, once per customer tenant:
POST https://login.microsoftonline.com/<customer-tenant-id>/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id=506e08f9-6e9a-4da4-942b-a099a03644ae # ConnectWise Cloud Backup
&client_secret=<the vendor's credential>
&scope=https://graph.microsoft.com/.default
&grant_type=client_credentials
The token that comes back is an app-only token. Decoded, the parts that matter look like this (illustrative values):
{
"aud": "https://graph.microsoft.com",
"tid": "<customer-tenant-id>",
"appid": "506e08f9-6e9a-4da4-942b-a099a03644ae",
"idtyp": "app",
"roles": [ "...the application permissions the customer consented to..." ]
}
Read that again from the attacker's side. The credential is the vendor's, and it is valid in every tenant that ever consented to the app. Whoever holds it can loop over the customer list and collect a token per tenant. That is exactly the "sorted GUID order, a few seconds apart" pattern Huntress saw on 15 October. Several consequences follow, and each one breaks a control most of us rely on:
- No MFA. There is no user, so there is no second factor to ask for. BleepingComputer reports the attacker signed in directly as the backup app, with its secret, through scripts, so MFA never came into play.
- No user Conditional Access. Policies that target users do not apply to app-only tokens. Location rules for applications need Conditional Access for workload identities, which few tenants have.
- Not in the sign-in log you look at. App-only sign-ins go to Service principal sign-ins, a separate tab and a separate log category (
ServicePrincipalSignInLogs). ConnectWise had to tell customers explicitly not to search the default user sign-ins view. - No endpoint at all. The attacker never touched a device of the victim. The EDR, the firewall and the proxy are all outside the path.
- Revoking sessions does nothing. Disabling the service principal stops new tokens, but a token already issued stays valid until it expires, up to about 90 minutes. Resetting user passwords is irrelevant.
From reading data to owning the tenant
Backup only needs to read. But some of the ConnectWise Cloud Management apps had been granted much more, and Microsoft assessed that the actor likely abused Directory.ReadWrite.All. Write permissions over the directory, roles or applications are where reading turns into owning, because Microsoft Graph lets an app act on other principals, including itself. Two Graph calls are enough for the whole persistence chain:
# 1. Put a service principal (here: itself) in a directory role
POST https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments
{ "principalId": "<its own service principal id>",
"roleDefinitionId": "62e90394-69f5-4237-9190-012177145e10", # Global Administrator
"directoryScopeId": "/" }
# 2. Add a new secret to ANOTHER application it now controls
POST https://graph.microsoft.com/v1.0/servicePrincipals/<other app>/addPassword
{ "passwordCredential": { "displayName": "...", "endDateTime": "2028-..." } }
That is what happened in one partner tenant: ConnectWise Cloud Management - MS Teams added itself to Global Administrator, then a script with the user agent Python-urllib/3.12 added client secrets to an MSP management application and to the Huntress Security Platform app. The whole sequence took about five minutes. The new secrets are the real backdoor: they belong to apps nobody suspects, they survive the vendor rotating its own credential, and they survive every password reset in the tenant.
ARTEX: why the speed matters
ARTEX is public on GitHub (AGPL-3.0), and several forks translate it to English, Korean and other languages. It is a self-hosted system: a Go backend with an embedded Next.js interface and PostgreSQL. Its design explains what Microsoft observed:
- A goals agent breaks a target down and extracts the scope.
- A single planner is the only agent that creates new intents. It wakes up whenever the knowledge graph changes and pushes work into a frontier queue.
- Many worker agents (goroutines, one planner and N workers per task) each take one intent, run it with tools (a Kali, Bash and HTTP toolset, nmap among them), and write what they learned back.
- Two graphs hold the state: a shared asset graph (domains, subdomains, IPs, services, apps, endpoints) and a per-task exploration graph (goals, intents, facts, findings) linked by "spawns" and "proves" edges.
- It can drive models from Anthropic, OpenAI or a local Ollama instance, so a capable operator does not depend on any single provider.
Put that together and you get what Microsoft describes: agents that run continuously, chase several paths at once, and turn a finding into the next action in seconds. Peak spraying hit about 2,900 attempts a minute. Some tenants went from first targeting to privileged access in less than three hours.
For a SOC, the lesson is not "detect AI". Nothing in these logs says an LLM was involved. The lesson is about time. If your process for a "new credential added to an application" alert is a ticket that someone opens tomorrow morning, an agent has already used that credential, pivoted and planted the next one. The rules below are cheap and quiet enough to run in real time, and the response steps assume you act within the hour.
Where it shows up, and where it does not
| Stage | What the attacker did | Where it is logged | Blind spot |
|---|---|---|---|
| Recon and spray | Password spraying at machine speed | Entra sign-in logs (user) | None, if you look per source IP per minute |
| Initial access | Client credentials sign-in as the vendor app | Service principal sign-ins | Not in the default sign-in view; often not exported to the SIEM |
| Reconnaissance | Graph reads of users, groups, apps, mail, SharePoint | Graph activity logs; M365 unified audit for mail and files | Directory reads leave no audit record without Graph activity logs, which must be enabled and paid for |
| Privilege escalation | App added to Exchange Administrator or Global Administrator | Entra audit: Add member to role | App-only audit records carry no source IP |
| Persistence | New secrets on other apps | Entra audit: Add service principal credentials, Update application - Certificates and secrets management | Same: no IP, but the user agent is recorded in additional details |
| Collection | Bulk Key Vault secret reads, mailbox and file access | Key Vault diagnostic logs, M365 unified audit | Key Vault logging is off unless a diagnostic setting sends it somewhere |
The good news hidden in that table: the minimal tier here needs no agent at all. Entra ID audit logs and sign-in logs exist in every Microsoft 365 tenant. For the many clients that will never send you server logs, these two sources alone catch the escalation and the persistence. The full tier adds Graph activity logs, Key Vault diagnostics and the M365 unified audit log.
Step 1: find out if you are exposed
The seven application IDs involved, as published by ConnectWise and reported by The Hacker News. Search by application ID, not by display name: older tenants still show "SkyKick".
| Application | Application ID |
|---|---|
| ConnectWise Cloud Backup (SkyKick Backup) | 506e08f9-6e9a-4da4-942b-a099a03644ae |
| ConnectWise Cloud Management | 2399d300-6fca-4e6a-a686-399fefe75b83 |
| ConnectWise Cloud Management - MS Teams | 24205314-2b89-4e07-a2a4-579e898a5640 |
| ConnectWise Cloud Management - Exchange Online | b78f6a77-d4e5-46fb-87e5-d1648bd02519 |
| ConnectWise Cloud Management - MS Graph | 0de14c77-b9b0-4137-9360-34878a929827 |
| ConnectWise Cloud Management - Partner Center | 412dcf96-176d-4b3a-a1b0-4981ad66971e |
| ConnectWise Cloud Management - SharePoint Online | b2b55f5b-7758-4719-8d8f-88ae172e6bdb |
This read-only PowerShell, using the Microsoft Graph SDK, answers the three questions that matter for each tenant: are these apps here, do any service principals hold directory roles they should not, and which application credentials appeared since 13 October.
Connect-MgGraph -Scopes "Application.Read.All","Directory.Read.All","RoleManagement.Read.Directory"
$ids = "506e08f9-6e9a-4da4-942b-a099a03644ae","2399d300-6fca-4e6a-a686-399fefe75b83",
"24205314-2b89-4e07-a2a4-579e898a5640","b78f6a77-d4e5-46fb-87e5-d1648bd02519",
"0de14c77-b9b0-4137-9360-34878a929827","412dcf96-176d-4b3a-a1b0-4981ad66971e",
"b2b55f5b-7758-4719-8d8f-88ae172e6bdb"
# 1. Which ConnectWise / SkyKick service principals exist here, and are they enabled?
foreach ($id in $ids) {
Get-MgServicePrincipal -Filter "appId eq '$id'" |
Select-Object DisplayName, AppId, Id, AccountEnabled
}
# 2. Every directory role held by a service principal (any vendor, not only ConnectWise)
Get-MgRoleManagementDirectoryRoleAssignment -All -ExpandProperty RoleDefinition |
ForEach-Object {
$sp = Get-MgServicePrincipal -ServicePrincipalId $_.PrincipalId -ErrorAction SilentlyContinue
if ($sp) { [pscustomobject]@{ App = $sp.DisplayName; AppId = $sp.AppId; Role = $_.RoleDefinition.DisplayName } }
}
# 3. Secrets and certificates created since 13 October 2026, on applications and service principals
$since = Get-Date "2026-10-13"
Get-MgApplication -All -Property DisplayName,AppId,PasswordCredentials,KeyCredentials |
ForEach-Object {
$app = $_
@($app.PasswordCredentials) + @($app.KeyCredentials) | Where-Object { $_.StartDateTime -ge $since } |
Select-Object @{n="App";e={$app.DisplayName}}, @{n="AppId";e={$app.AppId}}, DisplayName, KeyId, StartDateTime, EndDateTime
}
Get-MgServicePrincipal -All -Property DisplayName,AppId,PasswordCredentials,KeyCredentials |
ForEach-Object {
$sp = $_
@($sp.PasswordCredentials) + @($sp.KeyCredentials) | Where-Object { $_.StartDateTime -ge $since } |
Select-Object @{n="ServicePrincipal";e={$sp.DisplayName}}, @{n="AppId";e={$sp.AppId}}, DisplayName, KeyId, StartDateTime, EndDateTime
}
Anything you cannot tie to a person and a ticket goes into the investigation. A secret with an end date years away, created by nobody you know, is the classic sign. In Cortex XDR, the same inventory from telemetry, every service principal sign-in by these apps since 1 October grouped by source:
Cortex XDR: ConnectWise / SkyKick app sign-ins since 1 October, by source address
config case_sensitive = false
| dataset = msft_azure_ad_raw
| filter appId in ("506e08f9-6e9a-4da4-942b-a099a03644ae", "2399d300-6fca-4e6a-a686-399fefe75b83",
"24205314-2b89-4e07-a2a4-579e898a5640", "b78f6a77-d4e5-46fb-87e5-d1648bd02519",
"0de14c77-b9b0-4137-9360-34878a929827", "412dcf96-176d-4b3a-a1b0-4981ad66971e",
"b2b55f5b-7758-4719-8d8f-88ae172e6bdb")
| alter error_code = json_extract_scalar(status, "$.errorCode")
| comp count() as signins, min(_time) as first_seen, max(_time) as last_seen, values(error_code) as results
by appDisplayName, ipAddress, userAgent
| sort asc first_seen
The real service authenticates from Azure private IPv6 space. Public IPv4 sources, and above all the 144.172.64.0/24 range, are what you are looking for. If this returns nothing at all, check that service principal sign-ins are collected in the first place before you conclude anything.
Step 2: detect it, one layer at a time
The rules are compiled from one YAML source to both languages. In Cortex XDR they read the Office 365 / Entra ID data source: audit records in msft_azure_ad_audit_raw and sign-ins in msft_azure_ad_raw, with columns named after the Microsoft Graph directoryAudit and signIn resources. In Splunk they read azure:monitor:aad from the Splunk Add-on for Microsoft Cloud Services, through an azure_monitor_aad macro. Each query starts by flattening the nested JSON (initiator, targets, additional details) into plain columns, so the logic is the same on both platforms.
Layer 0: the spray, at machine speed
Before the supply chain path, Storm-0940 sprayed. Humans spray slowly to stay under lockout thresholds; agents do not care. Count failures per source address per minute, together with the number of distinct accounts:
Cortex XDR: password spray per source per minute
config case_sensitive = false
| dataset = msft_azure_ad_raw
| filter userPrincipalName != null
| alter error_code = json_extract_scalar(status, "$.errorCode")
| filter error_code in ("50126", "50053", "50055", "50057") // bad password, locked, expired, disabled
| bin _time span = 1m
| comp count() as failures, count_distinct(userPrincipalName) as accounts by _time, ipAddress
| filter failures >= 30 or accounts >= 10
| sort desc failuresSplunk: same idea
`azure_monitor_aad` category=SignInLogs properties.status.errorCode IN (50126, 50053, 50055, 50057)
| bin _time span=1m
| stats count as failures dc(properties.userPrincipalName) as accounts by _time properties.ipAddress
| where failures >= 30 OR accounts >= 10
| sort - failures
Lockout code 50053 dominating the results, as it did here (almost 98% of the activity), is a sign of a spray that does not care about being noisy. Take the source addresses and look for any success from them, in user and in service principal sign-ins.
Layer 1: the vendor app signs in from the wrong place
The highest-value signal for this specific campaign: one of the seven apps authenticating from public IPv4, or from the actor's ranges.
Cortex XDR (XQL)
config case_sensitive = false
| dataset = msft_azure_ad_raw
| filter appId != null
| alter si_app_id = appId, si_app_name = appDisplayName, si_sp_name = servicePrincipalName, si_ip = ipAddress, si_user_agent = userAgent, si_resource = resourceDisplayName, si_error = json_extract_scalar(status, "$.errorCode")
| filter si_app_id in ("506e08f9-6e9a-4da4-942b-a099a03644ae", "2399d300-6fca-4e6a-a686-399fefe75b83", "24205314-2b89-4e07-a2a4-579e898a5640", "b78f6a77-d4e5-46fb-87e5-d1648bd02519", "0de14c77-b9b0-4137-9360-34878a929827", "412dcf96-176d-4b3a-a1b0-4981ad66971e", "b2b55f5b-7758-4719-8d8f-88ae172e6bdb") and (si_ip ~= "(?i)^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$" or (incidr(si_ip, "144.172.64.0/24") or incidr(si_ip, "187.15.88.0/22")))
| fields _time, si_app_name, si_app_id, si_sp_name, si_ip, si_user_agent, si_resource, si_error
| sort desc _time
| limit 1000Splunk (SPL)
`azure_monitor_aad` category=ServicePrincipalSignInLogs
| eval si_app_id='properties.appId', si_app_name='properties.appDisplayName', si_sp_name='properties.servicePrincipalName', si_ip=coalesce('properties.ipAddress',callerIpAddress), si_user_agent='properties.userAgent', si_resource='properties.resourceDisplayName', si_error='properties.status.errorCode', si_event_types=category
| where (lower(si_app_id)="506e08f9-6e9a-4da4-942b-a099a03644ae" OR lower(si_app_id)="2399d300-6fca-4e6a-a686-399fefe75b83" OR lower(si_app_id)="24205314-2b89-4e07-a2a4-579e898a5640" OR lower(si_app_id)="b78f6a77-d4e5-46fb-87e5-d1648bd02519" OR lower(si_app_id)="0de14c77-b9b0-4137-9360-34878a929827" OR lower(si_app_id)="412dcf96-176d-4b3a-a1b0-4981ad66971e" OR lower(si_app_id)="b2b55f5b-7758-4719-8d8f-88ae172e6bdb") AND (match(si_ip, "(?i)^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$") OR (cidrmatch("144.172.64.0/24", si_ip) OR cidrmatch("187.15.88.0/22", si_ip)))
| table _time si_app_name si_app_id si_sp_name si_ip si_user_agent si_resource si_error
| sort - _time
The general version works for every vendor you trust, and it is the one I would actually leave running: a multi-tenant app signing in from an address it has never used before. Set the time range to 30 days:
Cortex XDR: service principals signing in from a new address in the last 24 hours
config case_sensitive = false
| dataset = msft_azure_ad_raw
| filter to_string(signInEventTypes) contains "servicePrincipal"
| alter error_code = json_extract_scalar(status, "$.errorCode")
| filter error_code = "0"
| comp min(_time) as first_seen, count() as signins by appDisplayName, appId, ipAddress
| alter hours_since_first = timestamp_diff(current_time(), first_seen, "HOUR")
| filter hours_since_first <= 24
| sort asc first_seen
Layer 2: the app grants itself power
Two ways to escalate, two rules. First, a high-privilege permission granted to an app, the step that makes everything else possible. Granting these should happen a few times a year, during vendor onboarding, with a named owner.
Cortex XDR (XQL)
config case_sensitive = false
| dataset = msft_azure_ad_audit_raw
| filter activityDisplayName != null
| alter aud_operation = activityDisplayName, aud_initiator_app = json_extract_scalar(initiatedBy, "$.app.displayName"), aud_initiator_user = json_extract_scalar(initiatedBy, "$.user.userPrincipalName"), aud_target_type = json_extract_scalar(targetResources, "$[0].type"), aud_target_name = json_extract_scalar(targetResources, "$[0].displayName"), aud_targets = to_string(targetResources), aud_user_agent = arrayindex(regextract(to_string(additionalDetails), "User-Agent\\\",\\\"value\\\":\\\"([^\\\"]*)"), 0)
| filter aud_operation in ("add app role assignment to service principal", "add app role assignment grant to user", "consent to application") and (aud_targets contains "RoleManagement.ReadWrite.Directory" or aud_targets contains "AppRoleAssignment.ReadWrite.All" or aud_targets contains "Application.ReadWrite.All" or aud_targets contains "Directory.ReadWrite.All" or aud_targets contains "Mail.ReadWrite" or aud_targets contains "Mail.Read" or aud_targets contains "Files.ReadWrite.All" or aud_targets contains "Sites.FullControl.All" or aud_targets contains "full_access_as_app")
| fields _time, aud_operation, aud_initiator_app, aud_initiator_user, aud_target_type, aud_target_name, aud_user_agent, aud_targets
| sort desc _time
| limit 1000Splunk (SPL)
`azure_monitor_aad` category=AuditLogs
| eval aud_operation=operationName, aud_category=category, aud_result='properties.result', aud_initiator_app='properties.initiatedBy.app.displayName', aud_initiator_app_id='properties.initiatedBy.app.appId', aud_initiator_user='properties.initiatedBy.user.userPrincipalName', aud_target_type=mvindex('properties.targetResources{}.type',0), aud_target_name=mvindex('properties.targetResources{}.displayName',0), aud_targets=mvjoin(mvappend('properties.targetResources{}.displayName','properties.targetResources{}.modifiedProperties{}.newValue')," | "), aud_user_agent=mvindex('properties.additionalDetails{}.value',mvfind('properties.additionalDetails{}.key',"User-Agent"))
| where (lower(aud_operation)="add app role assignment to service principal" OR lower(aud_operation)="add app role assignment grant to user" OR lower(aud_operation)="consent to application") AND (match(aud_targets, "(?i)RoleManagement\\.ReadWrite\\.Directory") OR match(aud_targets, "(?i)AppRoleAssignment\\.ReadWrite\\.All") OR match(aud_targets, "(?i)Application\\.ReadWrite\\.All") OR match(aud_targets, "(?i)Directory\\.ReadWrite\\.All") OR match(aud_targets, "(?i)Mail\\.ReadWrite") OR match(aud_targets, "(?i)Mail\\.Read") OR match(aud_targets, "(?i)Files\\.ReadWrite\\.All") OR match(aud_targets, "(?i)Sites\\.FullControl\\.All") OR match(aud_targets, "(?i)full_access_as_app"))
| table _time aud_operation aud_initiator_app aud_initiator_user aud_target_type aud_target_name aud_user_agent aud_targets
| sort - _time
Then the role assignment itself. The key field is the initiator: when initiatedBy is an app and the target is a service principal getting a privileged role, there is no human in the loop. When the initiating app and the target are the same, it is the exact self-assignment from this campaign.
Cortex XDR (XQL)
config case_sensitive = false
| dataset = msft_azure_ad_audit_raw
| filter activityDisplayName != null
| alter aud_operation = activityDisplayName, aud_initiator_app = json_extract_scalar(initiatedBy, "$.app.displayName"), aud_initiator_user = json_extract_scalar(initiatedBy, "$.user.userPrincipalName"), aud_target_type = json_extract_scalar(targetResources, "$[0].type"), aud_target_name = json_extract_scalar(targetResources, "$[0].displayName"), aud_targets = to_string(targetResources), aud_user_agent = arrayindex(regextract(to_string(additionalDetails), "User-Agent\\\",\\\"value\\\":\\\"([^\\\"]*)"), 0)
| filter ((aud_operation in ("add member to role", "add eligible member to role") and aud_target_type = "serviceprincipal") and aud_initiator_app ~= "(?i).+") and (aud_targets contains "Global Administrator" or aud_targets contains "Company Administrator" or aud_targets contains "Privileged Role Administrator" or aud_targets contains "Privileged Authentication Administrator" or aud_targets contains "Application Administrator" or aud_targets contains "Cloud Application Administrator" or aud_targets contains "Exchange Administrator" or aud_targets contains "SharePoint Administrator" or aud_targets contains "Security Administrator" or aud_targets contains "Hybrid Identity Administrator" or aud_targets contains "User Administrator" or aud_targets contains "Partner Tier2 Support" or aud_targets contains "Directory Writers")
| fields _time, aud_operation, aud_initiator_app, aud_initiator_user, aud_target_type, aud_target_name, aud_user_agent, aud_targets
| sort desc _time
| limit 1000Splunk (SPL)
`azure_monitor_aad` category=AuditLogs
| eval aud_operation=operationName, aud_category=category, aud_result='properties.result', aud_initiator_app='properties.initiatedBy.app.displayName', aud_initiator_app_id='properties.initiatedBy.app.appId', aud_initiator_user='properties.initiatedBy.user.userPrincipalName', aud_target_type=mvindex('properties.targetResources{}.type',0), aud_target_name=mvindex('properties.targetResources{}.displayName',0), aud_targets=mvjoin(mvappend('properties.targetResources{}.displayName','properties.targetResources{}.modifiedProperties{}.newValue')," | "), aud_user_agent=mvindex('properties.additionalDetails{}.value',mvfind('properties.additionalDetails{}.key',"User-Agent"))
| where (((lower(aud_operation)="add member to role" OR lower(aud_operation)="add eligible member to role") AND lower(aud_target_type)="serviceprincipal") AND match(aud_initiator_app, "(?i).+")) AND (match(aud_targets, "(?i)Global\\ Administrator") OR match(aud_targets, "(?i)Company\\ Administrator") OR match(aud_targets, "(?i)Privileged\\ Role\\ Administrator") OR match(aud_targets, "(?i)Privileged\\ Authentication\\ Administrator") OR match(aud_targets, "(?i)Application\\ Administrator") OR match(aud_targets, "(?i)Cloud\\ Application\\ Administrator") OR match(aud_targets, "(?i)Exchange\\ Administrator") OR match(aud_targets, "(?i)SharePoint\\ Administrator") OR match(aud_targets, "(?i)Security\\ Administrator") OR match(aud_targets, "(?i)Hybrid\\ Identity\\ Administrator") OR match(aud_targets, "(?i)User\\ Administrator") OR match(aud_targets, "(?i)Partner\\ Tier2\\ Support") OR match(aud_targets, "(?i)Directory\\ Writers"))
| table _time aud_operation aud_initiator_app aud_initiator_user aud_target_type aud_target_name aud_user_agent aud_targets
| sort - _time
Layer 3: the backdoor, new secrets on other apps
The step that outlives everything else. Real admins add secrets as users, through the portal, from a browser. A secret added by an application, or by a scripting client, is worth an alert every time. The user agent is not in the top-level record: Entra stores it in the audit record's additionalDetails, which is why the query extracts it first.
Cortex XDR (XQL)
config case_sensitive = false
| dataset = msft_azure_ad_audit_raw
| filter activityDisplayName != null
| alter aud_operation = activityDisplayName, aud_initiator_app = json_extract_scalar(initiatedBy, "$.app.displayName"), aud_initiator_user = json_extract_scalar(initiatedBy, "$.user.userPrincipalName"), aud_target_type = json_extract_scalar(targetResources, "$[0].type"), aud_target_name = json_extract_scalar(targetResources, "$[0].displayName"), aud_targets = to_string(targetResources), aud_user_agent = arrayindex(regextract(to_string(additionalDetails), "User-Agent\\\",\\\"value\\\":\\\"([^\\\"]*)"), 0)
| filter aud_operation ~= "(?i)^(add service principal credentials|update application.*certificates and secrets)" and (aud_initiator_app ~= "(?i).+" or aud_user_agent ~= "(?i)(python-requests|python-urllib|curl/|go-http-client|azure-toolkit)")
| fields _time, aud_operation, aud_initiator_app, aud_initiator_user, aud_target_type, aud_target_name, aud_user_agent, aud_targets
| sort desc _time
| limit 1000Splunk (SPL)
`azure_monitor_aad` category=AuditLogs
| eval aud_operation=operationName, aud_category=category, aud_result='properties.result', aud_initiator_app='properties.initiatedBy.app.displayName', aud_initiator_app_id='properties.initiatedBy.app.appId', aud_initiator_user='properties.initiatedBy.user.userPrincipalName', aud_target_type=mvindex('properties.targetResources{}.type',0), aud_target_name=mvindex('properties.targetResources{}.displayName',0), aud_targets=mvjoin(mvappend('properties.targetResources{}.displayName','properties.targetResources{}.modifiedProperties{}.newValue')," | "), aud_user_agent=mvindex('properties.additionalDetails{}.value',mvfind('properties.additionalDetails{}.key',"User-Agent"))
| where match(aud_operation, "(?i)^(add service principal credentials|update application.*certificates and secrets)") AND (match(aud_initiator_app, "(?i).+") OR match(aud_user_agent, "(?i)(python-requests|python-urllib|curl/|go-http-client|azure-toolkit)"))
| table _time aud_operation aud_initiator_app aud_initiator_user aud_target_type aud_target_name aud_user_agent aud_targets
| sort - _time
Layer 4: the chain, correlated
Each rule above stands alone, but the campaign's signature is the sequence: one application taking a role and adding credentials within the same hour. This hunt groups the audit log per initiating app per hour and keeps the apps that did both:
Cortex XDR: an application that took a role and added credentials in the same hour
config case_sensitive = false
| dataset = msft_azure_ad_audit_raw
| alter initiating_app = json_extract_scalar(initiatedBy, "$.app.displayName")
| filter initiating_app != null
| filter activityDisplayName in ("Add member to role", "Add service principal credentials",
"Add app role assignment to service principal")
or activityDisplayName contains "Certificates and secrets"
| bin _time span = 1h
| comp values(activityDisplayName) as operations, count() as changes by _time, initiating_app
| alter took_role = array_length(arrayfilter(operations, "@element" contains "to role")),
added_creds = array_length(arrayfilter(operations, "@element" contains "credentials" or "@element" contains "secrets"))
| filter took_role > 0 and added_creds > 0
| sort desc _timeSplunk: same correlation
`azure_monitor_aad` category=AuditLogs properties.initiatedBy.app.displayName=*
(operationName="Add member to role" OR operationName="Add service principal credentials"
OR operationName="Add app role assignment to service principal" OR operationName="*Certificates and secrets*")
| eval initiating_app='properties.initiatedBy.app.displayName'
| bin _time span=1h
| stats values(operationName) as operations count as changes by _time initiating_app
| where (isnotnull(mvfind(operations, "to role"))) AND (isnotnull(mvfind(operations, "(?i)credentials|secrets")))
| sort - _time
Full tier: what the attacker did with the access
These need log sources you have to switch on, usually through diagnostic settings into an Event Hub that Cortex XDR reads into msft_azure_raw. They are worth it for any client that keeps secrets in Azure.
The Graph calls themselves. With Microsoft Graph activity logs enabled, you see the request, not only its result. These are the two calls from the escalation above, plus the older role-membership endpoint:
Cortex XDR: role assignment and new-credential calls in Graph activity logs
config case_sensitive = false
| dataset = msft_azure_raw
| filter category = "MicrosoftGraphActivityLogs"
| alter method = json_extract_scalar(properties, "$.requestMethod"),
uri = json_extract_scalar(properties, "$.requestUri"),
app = json_extract_scalar(properties, "$.appId"),
ip = json_extract_scalar(properties, "$.ipAddress"),
ua = json_extract_scalar(properties, "$.userAgent"),
code = json_extract_scalar(properties, "$.responseStatusCode")
| filter method = "POST"
| filter uri ~= "(?i)/(addPassword|addKey)$"
or uri ~= "(?i)/roleManagement/directory/roleAssignments"
or uri ~= "(?i)/directoryRoles/[^/]+/members"
or uri ~= "(?i)/servicePrincipals/[^/]+/appRoleAssignments"
| fields _time, app, ip, ua, method, uri, code
| sort desc _time
Bulk Key Vault reads. Microsoft saw secrets read across several vaults in a short window. Their threshold is a good start: 20 or more successful SecretGet calls across 3 or more vaults by one identity in 15 minutes.
Cortex XDR: bulk Key Vault secret reads
config case_sensitive = false
| dataset = msft_azure_raw
| filter category = "AuditEvent" and operationName = "SecretGet"
| filter to_string(resultSignature) = "OK" or to_string(httpStatusCode) = "200"
| alter caller_app = json_extract_scalar(identity, "$.claim.appid")
| bin _time span = 15m
| comp count() as secret_reads, count_distinct(resourceId) as vaults, values(callerIpAddress) as ips by _time, caller_app
| filter secret_reads >= 20 and vaults >= 3
| sort desc secret_reads
Mailbox persistence. ConnectWise, Huntress and Microsoft all ask to check forwarding, inbox rules and delegated access. In the M365 unified audit log:
Splunk: forwarding, inbox rules and delegation (Splunk Add-on for Microsoft Office 365)
index=* sourcetype=o365:management:activity Workload=Exchange
(Operation=New-InboxRule OR Operation=Set-InboxRule OR Operation=UpdateInboxRules
OR Operation=Add-MailboxPermission OR Operation=Add-RecipientPermission
OR (Operation=Set-Mailbox (Parameters{}.Name=ForwardingSmtpAddress OR Parameters{}.Name=ForwardingAddress OR Parameters{}.Name=DeliverToMailboxAndForward)))
| table _time UserId ClientIP Operation Parameters{}.Name Parameters{}.Value
| sort - _timeCortex XDR: same, Office 365 Exchange dataset
config case_sensitive = false
| dataset = msft_o365_exchange_online_raw
| filter Operation in ("New-InboxRule", "Set-InboxRule", "UpdateInboxRules", "Set-Mailbox",
"Add-MailboxPermission", "Add-RecipientPermission")
| filter Operation != "Set-Mailbox" or to_string(Parameters) contains "Forwarding"
| fields _time, UserId, ClientIP, Operation, Parameters
| sort desc _time
properties.* through Event Hub. Paste a real audit record into the playground first, then run each query once on your own data.Step 3: respond
Order matters here, because the evidence lives in the configuration you are about to change, and the logs expire fast (7 days of Entra logs on free tenants, 30 with P1 or P2).
- Disable, do not delete. For each of the seven apps, open the enterprise application and set "Enabled for users to sign-in?" to No. This also blocks new app-only tokens. Deleting the service principal destroys its permissions, owners and credentials, which are your evidence.
- Export the logs now. Audit logs, user and service principal sign-ins, the M365 unified audit log and Graph activity logs if you have them. Do not let the export delay containment, but do it the same hour.
- Review from 1 October, not from the advisory. Microsoft recommends at least 15 October and service principal sign-ins from 1 October. Look at failed sign-ins too, and do not limit the search to the published IPs.
- Remove what was added. Directory roles held by service principals you did not intend, app role assignments and consent grants nobody owns, and every secret or certificate since 13 October that you cannot explain. Check app owners as well.
- Rotate what was readable. Key Vault secrets read during the window, credentials of the other apps that got new secrets, and anything stored in mailboxes or SharePoint that the backup app could read.
- Wait out the tokens. Tokens issued before you disabled the app work for up to about 90 minutes. Keep watching Graph activity for that long after containment.
- Re-enable only on the vendor's word. ConnectWise asked customers to keep connections disabled until it sends restoration instructions directly.
What I am changing as an MSSP
The uncomfortable part of this story is that MSPs and MSSPs are the trusted app. A few things I now treat as non-negotiable for every client tenant:
- Inventory every multi-tenant app and what it can do. Most tenants have dozens of vendor service principals with application permissions nobody remembers granting.
- Treat
RoleManagement.ReadWrite.Directory,AppRoleAssignment.ReadWrite.AllandApplication.ReadWrite.Allas Global Administrator. Because they are: any app holding one can make itself Global Administrator. - Ingest service principal sign-ins and the audit log for every client, even the ones that send nothing else. It costs almost nothing and it is the only place this attack is visible.
- Baseline where each vendor app signs in from, and alert on the first new address. That single hunt would have caught the token sweep within minutes.
- Restrict user consent and use Conditional Access for workload identities where the license allows, to pin vendor apps to their known locations.
The detections
| Rule | What it catches | Log source |
|---|---|---|
| DL-0078 | ConnectWise / SkyKick app signing in from public IPv4 or Storm-0940 infrastructure | Service principal sign-ins |
| DL-0079 | Tenant-wide Graph or Exchange permission granted to an app | Entra audit |
| DL-0076 | Privileged directory role given to a service principal by an application | Entra audit |
| DL-0077 | Secret or certificate added to an app by another app or a script | Entra audit |
Plus the hunts in this post: password spray per minute, new sign-in address for any service principal, the role-then-credentials correlation, Graph escalation calls, bulk Key Vault reads and mailbox persistence. If a rule misbehaves on your platform, open an issue on the repo with the error and I will fix it.
Indicators
Useful for looking back, not for long-term rules.
- Addresses:
144.172.64.60,144.172.64.99,144.172.64.128; transient VPN exits around 15 and 16 October:187.15.88.186,187.15.89.186,187.15.90.217 - User agents:
Python-urllib/3.12,python-requests/2.31.0,python-requests/2.34.2,curl/7.88.1,azure-toolkit/1.0. ConnectWise's own SDK shows askiota-dotnet, which is not suspicious by itself. - Applications: the seven IDs in the table above.
- Defender alerts named by Microsoft: "Application self-assigned Global Administrator role", "Malicious sign-in from known threat actor IP address", and for Key Vault, KV_AccountVolumeAccessDeniedAnomaly.
Sources
- Microsoft Threat Intelligence: Storm-0940 uses ARTEX in a ConnectWise supply chain compromise
- The Hacker News: compromised ConnectWise credential used to sign in to Microsoft 365 tenants (Huntress and Todyl findings, application IDs)
- BleepingComputer: role self-assignment in about fifty tenants, Global Administrator and secret planting
- Cybersecurity Dive: ConnectWise suspends Cloud Backup
- WindowsForum: which apps to disable and which Entra backdoors to hunt
- ARTEX on GitHub (English translation of the original project)
- Splunk Security Content: privileged role assigned to a service principal
- Splunk Security Content: new client credentials on a service principal
- Cortex Marketplace: Microsoft Entra ID datasets
Thanks for reading. Running an MSP or MSSP, or protecting tenants that trust one? Tell me what these queries found, or what they missed. I reply within a day.