Detect Device Registration in Sumo Logic CSE
Adversaries may register a device to an adversary-controlled account to establish persistence or escalate privileges. Devices may be registered in an MFA system (Duo, Okta) to bypass multi-factor authentication requirements, or registered in a device management system (Entra ID, Intune) to access sensitive data while bypassing conditional access policies. APT29 has enrolled attacker-controlled devices into compromised Azure AD tenants. Tools like AADInternals can automate device registration to Entra ID. Adversaries may also exploit self-enrollment workflows that require only a username and password for dormant or first-device scenarios.
MITRE ATT&CK
- Tactic
- Persistence Privilege Escalation
- Technique
- T1098 Account Manipulation
- Sub-technique
- T1098.005 Device Registration
- Canonical reference
- https://attack.mitre.org/techniques/T1098/005/
Sumo Detection Query
_sourceCategory=azure/audit OR _sourceCategory=azure/aad/audit
| json field=_raw "operationName" as operation_name nodrop
| json field=_raw "result" as result nodrop
| json field=_raw "initiatedBy.user.userPrincipalName" as initiated_by_upn nodrop
| json field=_raw "initiatedBy.user.ipAddress" as source_ip nodrop
| json field=_raw "initiatedBy.app.displayName" as app_name nodrop
| json field=_raw "targetResources[0].displayName" as device_name nodrop
| json field=_raw "targetResources[0].id" as device_id nodrop
| where operation_name in (
"Add device",
"Register device",
"Add registered owner to device",
"Add registered users to device",
"Update device",
"Enroll device"
)
| where result = "success"
| eval is_known_app = if (
app_name in (
"Microsoft Intune",
"Microsoft Azure Active Directory Connect",
"Microsoft Intune Enrollment",
"Azure Active Directory",
"Microsoft Authentication Broker"
), 1, 0
)
| eval base_score = if (is_known_app = 0, 2, 0)
| timeslice 1h
| count as registration_count,
values(device_name) as device_names,
values(source_ip) as source_ips,
last(app_name) as initiating_app,
last(base_score) as base_score
by initiated_by_upn, _timeslice
| eval bulk_flag = if (registration_count >= 3, 1, 0)
| eval total_score = base_score + if (bulk_flag = 1, 2, 0)
| where total_score > 0 or bulk_flag = 1
| eval alert_reason = if (
bulk_flag = 1 and total_score > 2, "Bulk registration by unexpected app",
if (bulk_flag = 1, "Bulk device registration (3+ in 1 hour)",
if (total_score > 0, "Registration by unexpected application",
"Suspicious device registration"
)
)
)
| fields _timeslice, initiated_by_upn, source_ips, initiating_app, device_names, registration_count, total_score, alert_reason
| sort by total_score desc Detects T1098.005 device registration abuse by parsing Azure AD audit log JSON in Sumo Logic and applying a suspicion-scoring model. Scores 2 points for registrations initiated by an application outside the known MDM allowlist and adds 2 more points when 3+ devices are registered by the same user within a 1-hour timeslice. The combined score drives alert triage prioritisation, with bulk-plus-unexpected-app combinations scoring highest.
Data Sources
Required Tables
False Positives & Tuning
- Bulk MDM onboarding events triggered when IT deploys a new device fleet and enrolment completes for multiple machines in the same hour
- Third-party EMM solutions (Jamf Pro, VMware Workspace ONE, Ivanti) that appear as unexpected initiating apps relative to the Microsoft-centric allowlist
- Partner tenants with B2B delegated admin rights performing device enrollment in a customer Azure AD environment
- BYOD self-enrollment campaigns where employees register multiple personal devices (phone, tablet, laptop) within a single session
Other platforms for T1098.005
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Register Device to Entra ID using AADInternals PowerShell Module
Expected signal: Azure AD AuditLogs: OperationName='Add device' with actor UPN, source IP, and DeviceName='TestDevice-AtomicTest'. Result='success'. The initiating app will appear as an unexpected application ID (not standard Intune). SigninLogs will show token acquisition event from the same session.
- Test 2MFA Device Enrollment on Dormant Account Using Only Password
Expected signal: Azure AD AuditLogs: OperationName='User registered security info' or 'User started security info registration' and 'Update user' with modified properties showing phoneAuthenticationMethod added. SigninLogs: ROPC flow authentication (non-interactive) from the test IP. Identity Protection may flag the ROPC sign-in as risky.
- Test 3Bulk Device Registration to Entra ID via Graph API
Expected signal: Azure AD AuditLogs: 5 separate 'Add device' events within ~10 seconds from the same actor UPN and IP address. Each event will have Result='success' and DeviceName='AtomicTestDevice-Bulk-{1-5}'. The rapid succession of registrations will be visible in the timestamp sequence.
- Test 4Register Device to Entra ID Using Existing PRT (Primary Refresh Token) via dsregcmd
Expected signal: Azure AD AuditLogs: OperationName='Add device' or 'Register device' with DeviceName matching the machine's hostname. Initiated by the currently logged-on user. Windows Event Log (System): Event ID 4648 or Events from Microsoft-Windows-User Device Registration source. Certificate created in CERT:\LocalMachine\My for the device.
References (14)
- https://attack.mitre.org/techniques/T1098/005/
- https://www.mandiant.com/resources/blog/apt29-continues-targeting-microsoft
- https://www.cisa.gov/uscert/ncas/alerts/aa22-074a
- https://o365blog.com/post/devices/
- https://o365blog.com/post/mdm
- https://o365blog.com/post/bprt/
- https://www.microsoft.com/security/blog/2022/01/26/evolved-phishing-device-registration-trick-adds-to-phishers-toolbox-for-victims-without-mfa
- https://www.microsoft.com/security/blog/2022/03/22/dev-0537-criminal-actor-targeting-organizations-for-data-exfiltration-and-destruction/
- https://learn.microsoft.com/en-us/entra/identity/devices/overview
- https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
- https://expel.com/blog/observing-atlas-lion-part-one/
- https://www.darkreading.com/threat-intelligence/fireeye-s-mandia-severity-zero-alert-led-to-discovery-of-solarwinds-attack
- https://github.com/dirkjanm/ROADtools
- https://learn.microsoft.com/en-us/graph/api/device-post-devices
Unlock Pro Content
Get the full detection package for T1098.005 including response playbook, investigation guide, and atomic red team tests.