Try in Splunk Security Cloud


The following analytic identifies instances where a user has denied consent to an OAuth application seeking permissions within the Azure AD environment. This detection leverages Azure AD's audit logs, specifically focusing on user consent actions with error code 65004. Monitoring denied consent actions is significant as it can indicate users recognizing potentially suspicious or untrusted applications. If confirmed malicious, this activity could suggest attempts by unauthorized applications to gain access, potentially leading to data breaches or unauthorized actions within the environment. Understanding these denials helps refine security policies and enhance user awareness.

  • Type: TTP
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2024-05-18
  • Author: Mauricio Velazco, Splunk
  • ID: bb093c30-d860-4858-a56e-cd0895d5b49c




ID Technique Tactic
T1528 Steal Application Access Token Credential Access
Kill Chain Phase
  • Exploitation
  • DE.CM
  • CIS 10
 `azure_monitor_aad` operationName="Sign-in activity" properties.status.errorCode=65004 
| rename properties.* as * 
| stats count min(_time) as firstTime max(_time) as lastTime by operationName, user, appDisplayName, status.failureReason 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `azure_ad_user_consent_denied_for_oauth_application_filter`


The SPL above uses the following Macros:

:information_source: azure_ad_user_consent_denied_for_oauth_application_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • operationName
  • properties.status.errorCode
  • user
  • properties.appDisplayName
  • status.failureReason

How To Implement

You must install the latest version of Splunk Add-on for Microsoft Cloud Services from Splunkbase ( You must be ingesting Azure Active Directory events into your Splunk environment through an EventHub. This analytic was written to be used with the azure:monitor:aad sourcetype leveraging the SignInLogs log category.

Known False Positives

Users may deny consent for legitimate applications by mistake, filter as needed.

Associated Analytic Story


Risk Score Impact Confidence Message
36.0 60 60 User $user$ denied consent for an OAuth application.

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.


Test Dataset

Replay any dataset to Splunk Enterprise by using our tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 3