Detection: 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.

 1`o365_management_activity` Workload=AzureActiveDirectory Operation="Update application*Certificates and secrets management "
 2  
 3| fillnull
 4  
 5| stats earliest(_time) as firstTime latest(_time) as lastTime
 6    BY user ModifiedProperties{}.NewValue object
 7       ObjectId dest signature
 8       src vendor_account vendor_product
 9  
10| `security_content_ctime(firstTime)`
11  
12| `security_content_ctime(lastTime)`
13  
14| `o365_service_principal_new_client_credentials_filter`

Data Source

Name Platform Sourcetype Source
O365 Other 'o365:management:activity' 'o365'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
o365_service_principal_new_client_credentials_filter search *
o365_service_principal_new_client_credentials_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1098.001 Additional Cloud Credentials Persistence
Exploitation
Installation
DE.CM
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Intermediate Finding (Risk Event) Yes
TTP detections generate a Finding (Notable) and may generate Intermediate Findings (Risk Events) for associated entities.

Implementation

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.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
New credentials added for Service Principal $object$ object user 50

Intermediate Findings

Message Entity Field Entity Type Risk Score
New credentials added for Service Principal $object$ user user 50

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset o365 o365:management:activity
Integration ✅ Passing Dataset o365 o365:management:activity

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


Source: GitHub | Version: 13