Techniques
Sample rules
M365 Identity Device Code Grant by an Unusual User (Non-Compliant Device)
- source: elastic
- technicques:
- T1078
- T1550
- T1566
Description
Identifies a Microsoft 365 user completing an OAuth device code grant (“Cmsi:Cmsi”) from a non-compliant device for the first time within the rule’s historical window, regardless of the requesting application or target resource. Device code phishing kits complete the full login (password and MFA) at the genuine Microsoft endpoint and harvest the resulting token by polling, so MFA does not stop them. Because the victim authorizes the flow in their own browser, the grant is frequently completed on a personal or attacker-controlled device that is not enrolled or compliant with the organization’s device policies. A user appearing with this device code flow on a non-compliant device for the first time in the lookback window is a strong early indicator of device code phishing, and removing the application and target constraints catches grants against any first-party application, not just the Microsoft Authentication Broker.
Detection logic
event.dataset: "o365.audit"
and o365.audit.ExtendedProperties.RequestType: "Cmsi:Cmsi"
and o365.audit.Actor.Type: (0 or 2 or 3 or 5 or 10)
and o365.audit.DeviceProperties.Value: "False"