| ID | Technique | Tactic |
|---|---|---|
| T1078.004 | Cloud Accounts | Initial Access |
| T1098.001 | Additional Cloud Credentials | Persistence |
| T1586.003 | Cloud Accounts | Privilege Escalation |
Detection: Azure AD Federated Identity Credential Added To Service Principal
Description
The following analytic detects additions of federated identity credentials to Entra ID service principals. It leverages Azure Active Directory AuditLogs for the "Update service principal" or "Update application" operations and filters on the FederatedIdentityCredentials modifiedProperty. Workload identity federation allows external OIDC workloads such as GitHub Actions or Kubernetes to authenticate as the SP without a secret. If an attacker adds a federated credential pointing to a controlled OIDC issuer, they gain a persistent secretless authentication path into the SP that survives credential rotations and is not visible in standard secrets monitoring.
Search
1`azure_monitor_aad`
2category=AuditLogs
3operationName IN ("Update application", "Update service principal")
4properties.targetResources{}.modifiedProperties{}.displayName="FederatedIdentityCredentials"
5
6
7| rename properties.* as *
8
9| rename initiatedBy.user.userPrincipalName as initiatedBy
10
11| rename initiatedBy.app.displayName as initiatedByApp
12
13
14| eval actor = coalesce(initiatedBy, initiatedByApp)
15
16
17| rename targetResources{}.displayName as targetSpName
18
19| rename userAgent as user_agent
20
21
22| eval index_number=mvfind('targetResources{}.modifiedProperties{}.displayName', "FederatedIdentityCredentials")
23
24| eval newCreds = mvindex('targetResources{}.modifiedProperties{}.newValue', index_number)
25
26| eval oldCreds = mvindex('targetResources{}.modifiedProperties{}.oldValue', index_number)
27
28
29| spath input=newCreds path={}.name output=newCredNames
30
31| spath input=oldCreds path={}.name output=oldCredNames
32
33
34| where mvcount(newCredNames) > coalesce(mvcount(oldCredNames), 0)
35
36
37| fillnull
38
39
40| stats count min(_time) as firstTime
41 max(_time) as lastTime
42 BY dest src vendor_account vendor_product user_agent
43 actor targetSpName newCreds oldCreds signature
44
45
46| rename actor as user
47
48
49| `security_content_ctime(firstTime)`
50
51| `security_content_ctime(lastTime)`
52
53| `azure_ad_federated_identity_credential_added_to_service_principal_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| Azure Active Directory | 'azure:monitor:aad' |
'Azure AD' |
Macros Used
| Name | Value |
|---|---|
| azure_monitor_aad | sourcetype=azure:monitor:aad |
| azure_ad_federated_identity_credential_added_to_service_principal_filter | search * |
azure_ad_federated_identity_credential_added_to_service_principal_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
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 |
Implementation
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 through an EventHub. This analytic was written to be used with the "azure:monitor:aad sourcetype" leveraging the AuditLogs log category.
Known False Positives
Platform engineers legitimately configure federated credentials when setting up GitHub Actions OIDC federation, Kubernetes Workload Identity, or other secretless CI/CD patterns. Validate the actor, the target SP, and whether the issuer in newCreds corresponds to a known trusted OIDC provider. Unknown issuers or overly permissive subject claims in the newCreds JSON warrant immediate investigation.
Associated Analytic Story
Finding
| Title | Entity Field | Entity Type | Risk Score |
|---|---|---|---|
| User [$user$] added Federated Identity Credential to service principal [$targetSpName$] from [$src$] | user | user | 50 |
Intermediate Findings
| Message | Entity Field | Entity Type | Risk Score |
|---|---|---|---|
| User [$user$] added Federated Identity Credential to service principal [$targetSpName$] from [$src$] | targetSpName | user | 50 |
References
-
https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust
-
https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation
Detection Testing
| Test Type | Status | Dataset | Source | Sourcetype |
|---|---|---|---|---|
| Validation | ✅ Passing | N/A | N/A | N/A |
| Unit | ✅ Passing | Dataset | Azure AD |
azure:monitor:aad |
| Integration | ✅ Passing | Dataset | Azure AD |
azure:monitor:aad |
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: 1