
Summary
Detects Microsoft Entra ID sign-ins where a Primary Refresh Token (PRT) is presented by a first-party command-line or scripting client. The rule targets sign-ins that use a PRT as the incoming token and originate from known Entra ID CLI tools (Azure CLI, Azure PowerShell, Microsoft Graph PowerShell, Azure AD PowerShell, Exchange Online PowerShell, Teams PowerShell, SharePoint Online Management Shell, Intune PowerShell). PRTs are typically redeemed by device-integrated components (Windows sign-in, Edge, Office, OneDrive, Microsoft Authentication Broker). A PRT used from a CLI client can indicate PRT replay, a scenario where an attacker with a registered device and a device-bound PRT could mint tokens for Microsoft Graph or other resources without interactive prompts. The detection queries the azure.signinlogs dataset for entries where incoming_token_type equals primaryRefreshToken and app_id matches a set of first-party CLI tools, with a successful sign-in outcome. While this captures potential misuse, legitimate activity can occur when WAM broker authentication is used on managed devices, or during authorized testing, so contextual validation is required. The rule provides a structured basis for investigating credential misuse and token replay, including correlation with device identity, user, source IP, and resource accessed, plus recommended remediation if the activity proves malicious.
Categories
- Cloud
- Identity Management
Data Sources
- Logon Session
ATT&CK Techniques
- T1528
- T1550
- T1550.001
Created: 2026-11-19