Detection rules › Splunk

O365 Service Principal New Client Credentials

Status
production
Severity
medium
Group by
ModifiedProperties{}.NewValue, ObjectId, aws::recipientAccountId, dest, object, signature, src, user, vendor_product
Author
Mauricio Velazco, Splunk
Source
github.com/splunk/security_content

The following analytic detects the addition of new credentials for Service Principals within an Office 365 tenant. It uses O365 audit logs, focusing on events related to credential modifications or additions in the AzureActiveDirectory workload. This activity is significant because Service Principals represent application identities, and their credentials allow applications to authenticate and access resources. If an attacker successfully adds or modifies these credentials, they can impersonate the application, leading to unauthorized data access, data exfiltration, or malicious operations under the application's identity.

MITRE ATT&CK coverage

Rule body splunk

name: O365 Service Principal New Client Credentials
id: a1b229e9-d962-4222-8c62-905a8a010453
version: 13
creation_date: '2023-12-06'
modification_date: '2026-05-13'
author: Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic detects the addition of new credentials for Service Principals within an Office 365 tenant. It uses O365 audit logs, focusing on events related to credential modifications or additions in the AzureActiveDirectory workload. This activity is significant because Service Principals represent application identities, and their credentials allow applications to authenticate and access resources. If an attacker successfully adds or modifies these credentials, they can impersonate the application, leading to unauthorized data access, data exfiltration, or malicious operations under the application's identity.
data_source:
    - O365
search: |-
    `o365_management_activity` Workload=AzureActiveDirectory Operation="Update application*Certificates and secrets management "
      | fillnull
      | stats earliest(_time) as firstTime latest(_time) as lastTime
        BY user ModifiedProperties{}.NewValue object
           ObjectId dest signature
           src vendor_account vendor_product
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `o365_service_principal_new_client_credentials_filter`
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
known_false_positives: Service Principal client credential modifications may be part of legitimate administrative operations. Filter as needed.
references:
    - https://attack.mitre.org/techniques/T1098/001/
    - https://www.mandiant.com/resources/blog/remediation-and-hardening-strategies-for-microsoft-365-to-defend-against-unc2452
    - https://microsoft.github.io/Azure-Threat-Research-Matrix/Persistence/AZT501/AZT501-2/
    - https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Cloud%20-%20Azure%20Pentest.md#add-credentials-to-all-enterprise-applications
drilldown_searches:
    - name: View the detection results for - "$object$"
      search: '%original_detection_search% | search  object = "$object$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$object$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$object$") | 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: New credentials added for Service Principal $object$
    entity:
        field: object
        type: user
        score: 50
intermediate_findings:
    entities:
        - field: user
          type: user
          score: 50
          message: New credentials added for Service Principal $object$
analytic_story:
    - Office 365 Persistence Mechanisms
    - NOBELIUM Group
asset_type: O365 Tenant
mitre_attack_id:
    - T1098.001
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: identity
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1098.001/o365_service_principal_credentials/o365_service_principal_credentials.log
          sourcetype: o365:management:activity
          source: o365
      test_type: unit

Stages and Predicates

Stage 1: search

`o365_management_activity` Workload=AzureActiveDirectory Operation="Update application*Certificates and secrets management "

Stage 2: fillnull

| fillnull

Stage 3: stats

| stats earliest(_time) as firstTime latest(_time) as lastTime
    BY user ModifiedProperties{}.NewValue object
       ObjectId dest signature
       src vendor_account vendor_product

Stage 4: search

| `security_content_ctime(firstTime)`

Stage 5: search

| `security_content_ctime(lastTime)`

Stage 6: search

| `o365_service_principal_new_client_credentials_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
Operationeq
  • "Update application*Certificates and secrets management "
Workloadeq
  • AzureActiveDirectory
sourcetypeeq
  • o365:management:activity