Detection rules › Splunk

Azure AD External Guest User Invited

Status
production
Severity
medium
Group by
aws::recipientAccountId, aws::userAgent, dest, initiatedBy, signature, src, type, user, vendor_product
Author
Gowthamaraj Rajendran, Mauricio Velazco, Splunk
Source
github.com/splunk/security_content

The following analytic detects the invitation of an external guest user within Azure AD. It leverages Azure AD AuditLogs to identify events where an external user is invited, using fields such as operationName and initiatedBy. Monitoring these invitations is crucial as they can lead to unauthorized access if abused. If confirmed malicious, this activity could allow attackers to gain access to internal resources, potentially leading to data breaches or further exploitation of the environment.

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1136.003 Create Account: Cloud Account

Rule body splunk

name: Azure AD External Guest User Invited
id: c1fb4edb-cab1-4359-9b40-925ffd797fb5
version: 12
creation_date: '2022-08-19'
modification_date: '2026-05-13'
author: Gowthamaraj Rajendran, Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic detects the invitation of an external guest user within Azure AD. It leverages Azure AD AuditLogs to identify events where an external user is invited, using fields such as operationName and initiatedBy. Monitoring these invitations is crucial as they can lead to unauthorized access if abused. If confirmed malicious, this activity could allow attackers to gain access to internal resources, potentially leading to data breaches or further exploitation of the environment.
data_source:
    - Azure Active Directory Invite external user
search: |-
    `azure_monitor_aad` operationName="Invite external user"
      | rename properties.* as *
      | rename initiatedBy.user.userPrincipalName as initiatedBy
      | rename targetResources{}.type as type
      | rename userAgent as user_agent
      | fillnull
      | stats count min(_time) as firstTime max(_time) as lastTime
        BY dest user src
           vendor_account vendor_product user_agent
           initiatedBy type signature
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `azure_ad_external_guest_user_invited_filter`
how_to_implement: You must install the latest version of Splunk Add-on for Microsoft Cloud Services from Splunkbase(https://splunkbase.splunk.com/app/3110/#/details). You must be ingesting Azure Active Directory events into your Splunk environment. This analytic was written to be used with the azure:monitor:aad sourcetype leveraging the AuditLogs log category.
known_false_positives: Administrator may legitimately invite external guest users. Filter as needed.
references:
    - https://dirkjanm.io/assets/raw/US-22-Mollema-Backdooring-and-hijacking-Azure-AD-accounts_final.pdf
    - https://www.blackhat.com/us-22/briefings/schedule/#backdooring-and-hijacking-azure-ad-accounts-by-abusing-external-identities-26999
    - https://attack.mitre.org/techniques/T1136/003/
    - https://docs.microsoft.com/en-us/azure/active-directory/external-identities/b2b-quickstart-add-guest-users-portal
drilldown_searches:
    - name: View the detection results for - "$user$"
      search: '%original_detection_search% | search  user = "$user$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$user$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
finding:
    title: External Guest User $user$ initiated by $initiatedBy$
    entity:
        field: user
        type: user
        score: 50
intermediate_findings:
    entities:
        - field: initiatedBy
          type: user
          score: 50
          message: External Guest User $user$ initiated by $initiatedBy$
analytic_story:
    - Azure Active Directory Persistence
asset_type: Azure Active Directory
mitre_attack_id:
    - T1136.003
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: threat
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1136.003/azure_ad_external_guest_user_invited/azure-audit.log
          source: Azure AD
          sourcetype: azure:monitor:aad
      test_type: unit

Stages and Predicates

Stage 1: search

`azure_monitor_aad` operationName="Invite external user"

Stage 2: rename

| rename properties.* as *

Stage 3: rename

| rename initiatedBy.user.userPrincipalName as initiatedBy

Stage 4: rename

| rename targetResources{}.type as type

Stage 5: rename

| rename userAgent as user_agent

Stage 6: fillnull

| fillnull

Stage 7: stats

| stats count min(_time) as firstTime max(_time) as lastTime
    BY dest user src
       vendor_account vendor_product user_agent
       initiatedBy type signature

Stage 8: search

| `security_content_ctime(firstTime)`

Stage 9: search

| `security_content_ctime(lastTime)`

Stage 10: search

| `azure_ad_external_guest_user_invited_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
operationNameeq
  • "Invite external user"
sourcetypeeq
  • azure:monitor:aad