Credential Access (TA0006)(external, opens in a new tab or window)
Initial Access (TA0001)(external, opens in a new tab or window)
text code block:sequence by user.id, azure.tenant_id with maxspan=5m [authentication where data_stream.dataset == "azure.signinlogs" and event.outcome == "success" and azure.signinlogs.properties.authentication_protocol == "deviceCode" and azure.signinlogs.properties.device_detail.is_managed == false and azure.signinlogs.properties.resource_id == "00000002-0000-0000-c000-000000000000"] [web where data_stream.dataset == "azure.aadgraphactivitylogs" and url.path : ( "*/users*", "*/groups*", "*/servicePrincipals*", "*/applications*", "*/applicationRefs*", "*/devices*", "*/directoryRoles*", "*/roleAssignments*", "*/eligibleRoleAssignments*", "*/roleDefinitions*", "*/directoryObjects*", "*/policies*", "*/oauth2PermissionGrants*", "*/administrativeUnits*", "*/tenantDetails*", "*/directorySettingTemplates*", "*/me*" )]
Install detection rules in Elastic Security
Detect Entra ID OAuth Device Code Sign-in to Azure AD Graph Enumeration 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).