Detection rules › Splunk

O365 User Consent Blocked for Risky Application

Status
production
Severity
medium
Group by
Scope, aws::recipientAccountId, dest, group.name, reason, signature, src, user, vendor_product
Author
Mauricio Velazco, Splunk
Source
github.com/splunk/security_content

The following analytic identifies instances where Office 365 has blocked a user's attempt to grant consent to an application deemed risky or potentially malicious. This detection leverages O365 audit logs, specifically focusing on failed user consent actions due to system-driven blocks. Monitoring these blocked consent attempts is crucial as it highlights potential threats early on, indicating that a user might be targeted or that malicious applications are attempting to infiltrate the organization. If confirmed malicious, this activity suggests that O365's security measures successfully prevented a harmful application from accessing organizational data, warranting immediate investigation.

Known false positives

  • Microsofts algorithm to identify risky applications is unknown and may flag legitimate applications.

MITRE ATT&CK coverage

TacticTechniques
Credential Access

Telemetry coverage

PlatformRecord / event type
Microsoft 365Consent to application.

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: O365 User Consent Blocked for Risky Application
id: 242e4d30-cb59-4051-b0cf-58895e218f40
version: 9
creation_date: '2023-12-06'
modification_date: '2026-05-13'
author: Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic identifies instances where Office 365 has blocked a user's attempt to grant consent to an application deemed risky or potentially malicious. This detection leverages O365 audit logs, specifically focusing on failed user consent actions due to system-driven blocks. Monitoring these blocked consent attempts is crucial as it highlights potential threats early on, indicating that a user might be targeted or that malicious applications are attempting to infiltrate the organization. If confirmed malicious, this activity suggests that O365's security measures successfully prevented a harmful application from accessing organizational data, warranting immediate investigation.
data_source:
    - O365 Consent to application.
search: "`o365_management_activity` Workload=AzureActiveDirectory Operation=\"Consent to application.\" ResultStatus=Failure | eval permissions =mvindex('ModifiedProperties{}.NewValue', 4) | eval reason =mvindex('ModifiedProperties{}.NewValue', 5) | search reason = \"Risky application detected\" | rex field=permissions \"Scope: (?<Scope>[^,]+)\" | fillnull | stats max(_time) as lastTime by user, reason, object, Scope, dest, src, vendor_account, vendor_product, signature | `security_content_ctime(lastTime)` | `o365_user_consent_blocked_for_risky_application_filter`"
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
known_false_positives: Microsofts algorithm to identify risky applications is unknown and may flag legitimate applications.
references:
    - https://attack.mitre.org/techniques/T1528/
    - https://www.microsoft.com/en-us/security/blog/2022/09/22/malicious-oauth-applications-used-to-compromise-email-servers-and-spread-spam/
    - https://learn.microsoft.com/en-us/azure/active-directory/manage-apps/protect-against-consent-phishing
    - https://learn.microsoft.com/en-us/defender-cloud-apps/investigate-risky-oauth
    - https://www.alteredsecurity.com/post/introduction-to-365-stealer
    - https://github.com/AlteredSecurity/365-Stealer
finding:
    title: O365 has blocked $user$ attempt to grant to consent to an application deemed risky.
    entity:
        field: user
        type: user
        score: 50
analytic_story:
    - Office 365 Account Takeover
asset_type: O365 Tenant
mitre_attack_id:
    - T1528
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: identity

Stages and Predicates

Stage 1: search

`o365_management_activity` Workload=AzureActiveDirectory Operation="Consent to application." ResultStatus=Failure

Stage 2: eval

| eval permissions =mvindex('ModifiedProperties{}.NewValue', 4)

Stage 3: eval

| eval reason =mvindex('ModifiedProperties{}.NewValue', 5)

Stage 4: search

| search reason = "Risky application detected"

Stage 5: rex

| rex field=permissions "Scope: (?<Scope>[^,]+)"

Stage 6: fillnull

| fillnull

Stage 7: stats

| stats max(_time) as lastTime by user, reason, object, Scope, dest, src, vendor_account, vendor_product, signature

Stage 8: search

| `security_content_ctime(lastTime)`

Stage 9: search

| `o365_user_consent_blocked_for_risky_application_filter`

Indicators

These rows show field, operator, and value matches.