Entra ID Register Device with Unusual User Agent
editEntra ID Register Device with Unusual User Agent
editDetects successful, user-initiated Microsoft Entra ID audit events for Register device where additional details indicate an Azure AD join or Azure AD register and the recorded user agent is not one of the common native registration clients (Dsreg, DeviceRegistrationClient, or Dalvik-based Android enrollment). Legitimate Windows and standard mobile enrollment flows present predictable user-agent strings; unexpected clients such as axios, node, python-requests, or offensive tooling like GraphSpy and ROADtools may reflect scripted or adversary-driven device registration used to obtain a Primary Refresh Token for persistence or token abuse. Registrations performed by service principals or the Device Registration Service itself (for example Windows 365 Cloud PC pre-authorized joins) and Microsoft-owned EvoSTS authorization checks are excluded. Baseline approved provisioning tools and MDM integrations before tuning.
Rule type: query
Rule indices:
- logs-azure.auditlogs-*
Severity: medium
Risk score: 47
Runs every: 5m
Searches indices from: now-9m (Date Math format, see also Additional look-back time)
Maximum alerts per execution: 100
References:
Tags:
- Domain: Cloud
- Domain: Identity
- Data Source: Azure
- Data Source: Microsoft Entra ID
- Data Source: Microsoft Entra ID Audit Logs
- Use Case: Threat Detection
- Tactic: Persistence
- Resources: Investigation Guide
- Noise: Low
- Performance: Normal
- Rule Type: Custom Query (KQL)
- Platform: Entra ID
Version: 3
Rule authors:
- Elastic
Rule license: Elastic License v2
Investigation guide
editTriage and analysis
Investigating Entra ID Register Device with Unusual User Agent
Review azure.auditlogs.properties.initiated_by.user.userPrincipalName, source IP fields on the audit event,
azure.auditlogs.properties.target_resources.0.display_name for the device name, and
azure.correlation_id for related audit entries.
Compare azure.auditlogs.properties.userAgent to your organization’s standard Autopilot, Intune, and Windows enrollment
clients. The rule matches both Azure AD join and Azure AD register (BYOD) trust types, and only user-initiated
registrations (azure.auditlogs.properties.initiated_by.user.id is populated).
Possible investigation steps
- Confirm whether the user intentionally joined a device and whether the user agent matches a known provisioning package.
-
Pivot to
azure.signinlogsfor the same principal and timeframe for risky sign-ins or token broker activity. -
Search for other
Register deviceevents from the same IP or user agent across the tenant. -
Treat scripted clients (
axios/*,node,python-requests/*) and offensive-tool device names (for exampleGraphSpy-Device,DESKTOP-*with a non-Dsreg user agent) as high-fidelity suspicious, especially from hosting ASNs. -
Check for a preceding Microsoft Authentication Broker sign-in to the Device Registration Service and a follow-on
primaryRefreshTokensign-in from an unmanaged device.
False positive analysis
- Linux Intune and other third-party enrollment clients can present unfamiliar user agents. Validate against device inventory and add narrow exceptions on the user agent.
- Service-initiated registrations (Windows 365 Cloud PC pre-authorized joins, Autopilot) have no initiating user and are excluded by the rule.
-
Microsoft-owned
EvoSTSauthorization checks from Microsoft ASN 8075 are excluded; the exclusion is bound to the ASN so a spoofed user agent from other infrastructure still alerts.
Response and remediation
- If malicious, remove the device in Entra ID, revoke refresh and primary refresh tokens for the user, and reset credentials per policy.
- Tighten device registration and join controls via Conditional Access and device compliance policies.
Rule query
editdata_stream.dataset:"azure.auditlogs" and event.action:"Register device" and
event.outcome:(success or Success) and
azure.auditlogs.properties.initiated_by.user.id:* and
azure.auditlogs.properties.userAgent:(* and not (Dsreg* or DeviceRegistrationClient or Dalvik*)) and
azure.auditlogs.properties.additional_details.value:("Azure AD join" or "Azure AD register") and
not (azure.auditlogs.properties.userAgent:EvoSTS and source.as.number:8075)
Framework: MITRE ATT&CKTM
-
Tactic:
- Name: Persistence
- ID: TA0003
- Reference URL: https://attack.mitre.org/tactics/TA0003/
-
Technique:
- Name: Account Manipulation
- ID: T1098
- Reference URL: https://attack.mitre.org/techniques/T1098/
-
Sub-technique:
- Name: Device Registration
- ID: T1098.005
- Reference URL: https://attack.mitre.org/techniques/T1098/005/