Entra ID OAuth Device Code Sign-in to Azure AD Graph Enumeration
Correlates a successful Entra ID device-code sign-in to the legacy Azure AD Graph audience (00000002-0000-0000-c000-000000000000) from an unmanaged device with directory enumeration against graph.windows.net by the…
Description
Correlates a successful Entra ID device-code sign-in to the legacy Azure AD Graph audience (00000002-0000-0000-c000-000000000000) from an unmanaged device with directory enumeration against graph.windows.net by the same user within a short window. Device-code phishing is the dominant OAuth phishing variant against Microsoft tenants: the adversary initiates the flow, relays the user-facing code to the victim, and on redemption walks away with an access or refresh token bound to the targeted resource without ever handling the user's password or MFA factor. When the redeemed audience is AAD Graph and the redeeming device is unmanaged, the follow-on Graph traffic is the compromised cloud account being used by the attacker, not by the user. This rule fires when that token is immediately turned around against the directory under the same identity to read user, group, service principal, application, role assignment, directory object, policy, OAuth permission grant, or tenant detail collections.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 5 ATT&CK techniques it maps to.
- Log source category
- event_index
Known benign triggers
- A developer or operator legitimately running first-party tooling under the device-code flow that then enumerates directory objects during onboarding or troubleshooting. Validate the calling app and source IP and exclude as appropriate.
- Authorized red team or audit activity (ROADrecon, ROADtools, AADInternals, roadtx). Document the engagement window and add exceptions on the calling user.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| github.com/Gerenios/AADInternals | 5from 2 sources |
| github.com/dirkjanm/ROADtools | 16from 2 sources |
| learn.microsoft.com/en-us/graph/migrate-azure-ad-graph-overview | 6 |
From the source
- At source
- Open at source
- Upstream identifier
- aa04377a-19b5-4940-952f-aad173790d23
- Tagged by the source as
- Data Source: AzureData Source: Azure AD GraphData Source: Azure AD Graph Activity LogsData Source: Microsoft Entra IDData Source: Microsoft Entra ID Sign-in LogsDomain: CloudDomain: IdentityNoise: UnknownPerformance: FastPlatform: AzurePlatform: Entra IDProfile: RecommendedResources: Investigation GuideRule Type: Event Correlation (EQL)Tactic: Credential AccessTactic: DiscoveryTactic: Initial AccessThreat: Device Code PhishingUse Case: Identity and Access AuditUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 20, 2026
- Version
- 3