Azure AD Service Principal Created
Description
The following analytic identifies the creation of a Service Principal in an Azure AD environment. An Azure Service Principal is an identity designed to be used with applications, services, and automated tools to access resources. It is similar to a service account within an Active Directory environment. Service Principal authentication does not support multi-factor authentication nor conditional access policies. Adversaries and red teams alike who have obtained administrative access may create a Service Principal to establish Persistence and obtain single-factor access to an Azure AD environment.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2022-08-17
- Author: Gowthamaraj Rajendran, Mauricio Velazco, Splunk
- ID: f8ba49e7-ffd3-4b53-8f61-e73974583c5d
Annotations
Kill Chain Phase
- Installation
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
5
6
7
`azuread` operationName="Add service principal" properties.initiatedBy.user.id=*
| rename properties.* as *
| rename targetResources{}.displayName as displayName
| rename initiatedBy.user.userPrincipalName as initiatedBy
| rename targetResources{}.type as type
| stats values(displayName) as displayName by _time, type, initiatedBy, result, operationName
| `azure_ad_service_principal_created_filter`
Macros
The SPL above uses the following Macros:
azure_ad_service_principal_created_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- _time
- properties.targetResources{}.displayName
- properties.targetResources{}.type
- properties.initiatedBy.user.userPrincipalName
- properties.result
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 thorough an EventHub. Specifically, this analytic leverages the AuditLogs log category.
Known False Positives
Administrator may legitimately create Service Principal. Filter as needed.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
45.0 | 50 | 90 | Service Principal named $displayName$ created by $initiatedBy$ |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
- https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals
- https://docs.microsoft.com/en-us/powershell/azure/create-azure-service-principal-azureps?view=azps-8.2.0
- https://www.truesec.com/hub/blog/using-a-legitimate-application-to-create-persistence-and-initiate-email-campaigns
- https://www.inversecos.com/2021/10/how-to-backdoor-azure-applications-and.html
- https://attack.mitre.org/techniques/T1136/003/
Test Dataset
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 | version: 1