AiTM or Device-Code OAuth Authentication Flow Compromise

This rule monitors for suspicious OAuth Device Code flow authentication attempts in Azure AD sign-in logs. It detects activity involving the device code protocol combined with specific error flags or indicators of potentially compromised or non-compliant devices (such as missing device IDs, non-compliant status, or empty trust types), which are indicative of Adversary-in-the-Middle (AiTM) phishing or token interception attacks.