Entra ID OAuth PRT Issuance to Non-Managed Device Detected

Last updated 10 days ago on 2025-12-15
Created 6 months ago on 2025-06-24

About

Identifies when a user signs in with a refresh token using the Microsoft Authentication Broker (MAB) client, followed by a Primary Refresh Token (PRT) sign-in from the same device within 1 hour from an unmanaged device. This pattern may indicate that an attacker has successfully registered a device using ROADtx and transitioned from short-term token access to long-term persistent access via PRTs. Excluding access to the Device Registration Service (DRS) ensures the PRT is being used beyond registration, often to access Microsoft 365 resources like Outlook or SharePoint.
Tags
Domain: CloudDomain: IdentityUse Case: Threat DetectionData Source: AzureData Source: Microsoft Entra IDData Source: Microsoft Entra ID Sign-In LogsTactic: PersistenceTactic: Initial AccessLanguage: eql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Persistence (TA0003)(external, opens in a new tab or window)

Credential Access (TA0006)(external, opens in a new tab or window)

Initial Access (TA0001)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
filebeat-*logs-azure.signinlogs-*
Related Integrations

azure(external, opens in a new tab or window)

Query
text code block:
sequence by azure.signinlogs.properties.user_id, azure.signinlogs.properties.device_detail.device_id with maxspan=1h [authentication where event.dataset == "azure.signinlogs" and azure.signinlogs.category == "NonInteractiveUserSignInLogs" and azure.signinlogs.properties.app_id == "29d9ed98-a469-4536-ade2-f981bc1d605e" and azure.signinlogs.properties.incoming_token_type == "refreshToken" and azure.signinlogs.properties.device_detail.trust_type == "Azure AD joined" and azure.signinlogs.properties.device_detail.device_id != null and azure.signinlogs.properties.token_protection_status_details.sign_in_session_status == "unbound" and azure.signinlogs.properties.user_type == "Member" and azure.signinlogs.result_signature == "SUCCESS" ] [authentication where event.dataset == "azure.signinlogs" and azure.signinlogs.properties.incoming_token_type == "primaryRefreshToken" and azure.signinlogs.properties.resource_display_name != "Device Registration Service" and azure.signinlogs.result_signature == "SUCCESS" and azure.signinlogs.properties.device_detail.is_managed != true and not ( azure.signinlogs.properties.app_display_name == "Windows Sign In" or user_agent.original == "Windows-AzureAD-Authentication-Provider/1.0" ) ]

Install detection rules in Elastic Security

Detect Entra ID OAuth PRT Issuance to Non-Managed Device Detected in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).