O365 Service Principal New Client Credentials


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.

Query · spl

`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`

Implementation guide

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.

Analyst notes

Known false positives: Service Principal client credential modifications may be part of legitimate administrative operations. Filter as needed.

Raw source O365 Service Principal New Client Credentials · SPL
Esc
Published by splunk/security_content ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
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

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.