LoFP LoFP / legitimate applications may be granted tenant wide consent, filter as needed.

Techniques

Sample rules

Description

The following analytic identifies instances where admin consent is granted to an application within an Azure AD tenant. It leverages Azure AD audit logs, specifically events related to the admin consent action within the ApplicationManagement category. This activity is significant because admin consent allows applications to access data across the entire tenant, potentially exposing vast amounts of organizational data. If confirmed malicious, an attacker could gain extensive and persistent access to sensitive data, leading to data exfiltration, espionage, further malicious activities, and potential compliance violations.

Detection logic

`azure_monitor_aad` operationName="Consent to application" 
| eval new_field=mvindex('properties.targetResources{}.modifiedProperties{}.newValue', 4) 
| rename properties.* as *  
| rex field=new_field "ConsentType: (?<ConsentType>[^\,]+)" 
| rex field=new_field "Scope: (?<Scope>[^\,]+)"  
| search  ConsentType = "AllPrincipals"  
| stats count min(_time) as firstTime max(_time) as lastTime by operationName, user, targetResources{}.displayName, targetResources{}.id, ConsentType, Scope 
| `security_content_ctime(firstTime)`  
| `security_content_ctime(lastTime)` 
| `azure_ad_tenant_wide_admin_consent_granted_filter`

Description

The following analytic identifies instances where admin consent is granted to an application within an Azure AD and Office 365 tenant. It leverages O365 audit logs, specifically events related to the admin consent action within the AzureActiveDirectory workload. This activity is significant because admin consent allows applications to access data across the entire tenant, potentially exposing vast amounts of organizational data. If confirmed malicious, an attacker could gain extensive and persistent access to organizational data, leading to data exfiltration, espionage, further malicious activities, and potential compliance violations.

Detection logic

`o365_management_activity` Operation="Consent to application."  
| eval new_field=mvindex('ModifiedProperties{}.NewValue', 4) 
| rex field=new_field "ConsentType: (?<ConsentType>[^\,]+)" 
| rex field=new_field "Scope: (?<Scope>[^\,]+)"  
| search  ConsentType = "AllPrincipals"  
| stats count min(_time) as firstTime max(_time) as lastTime by Operation, user, object, ObjectId, ConsentType, Scope 
| `security_content_ctime(firstTime)`  
| `security_content_ctime(lastTime)` 
| `o365_tenant_wide_admin_consent_granted_filter`