Techniques
Sample rules
Azure AD OAuth Application Consent Granted By User
- source: splunk
- technicques:
- T1528
Description
The following analytic detects when a user in an Azure AD environment grants consent to an OAuth application. It leverages Azure AD audit logs to identify events where users approve application consents. This activity is significant as it can expose organizational data to third-party applications, a common tactic used by malicious actors to gain unauthorized access. If confirmed malicious, this could lead to unauthorized access to sensitive information and resources. Immediate investigation is required to validate the application’s legitimacy, review permissions, and mitigate potential risks.
Detection logic
`azure_monitor_aad` operationName="Consent to application" properties.result=success
| rename properties.* as *
| eval permissions_index = if(mvfind('targetResources{}.modifiedProperties{}.displayName', "ConsentAction.Permissions") >= 0, mvfind('targetResources{}.modifiedProperties{}.displayName', "ConsentAction.Permissions"), -1)
| eval permissions = mvindex('targetResources{}.modifiedProperties{}.newValue',permissions_index)
| rex field=permissions "Scope: (?<Scope>[^,]+)"
| stats count min(_time) as firstTime max(_time) as lastTime by operationName, user, Scope
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `azure_ad_oauth_application_consent_granted_by_user_filter`