Azure AD Federated Identity Credential Added To Service Principal

 Original Source: [splunk source]
Name:Azure AD Federated Identity Credential Added To Service Principal
id:bfa745d4-4e43-4ff1-ad15-2f663fdf5cbf
version:2
date:None
author:descambiado, Onur Mustafa Erdogan, Splunk
status:production
type:TTP
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.
Data_source:
  • -Azure Active Directory
search:`azure_monitor_aad`
category=AuditLogs
operationName IN ("Update application", "Update service principal")
properties.targetResources{}.modifiedProperties{}.displayName="FederatedIdentityCredentials"

| rename properties.* as *
| rename initiatedBy.user.userPrincipalName as initiatedBy
| rename initiatedBy.app.displayName as initiatedByApp

| eval actor = coalesce(initiatedBy, initiatedByApp)

| rename targetResources{}.displayName as targetSpName
| rename userAgent as user_agent

| eval index_number=mvfind('targetResources{}.modifiedProperties{}.displayName', "FederatedIdentityCredentials")
| eval newCreds = mvindex('targetResources{}.modifiedProperties{}.newValue', index_number)
| eval oldCreds = mvindex('targetResources{}.modifiedProperties{}.oldValue', index_number)

| spath input=newCreds path={}.name output=newCredNames
| spath input=oldCreds path={}.name output=oldCredNames

| where mvcount(newCredNames) > coalesce(mvcount(oldCredNames), 0)

| fillnull value="unknown" dest src vendor_account vendor_product user_agent actor targetSpName newCreds oldCreds signature

| stats count min(_time) as firstTime
max(_time) as lastTime
BY dest src vendor_account vendor_product user_agent
actor targetSpName newCreds oldCreds signature

| rename actor as user

| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `azure_ad_federated_identity_credential_added_to_service_principal_filter`


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 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.
References:
  -https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation
  -https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust
  -https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect
  -https://attack.mitre.org/techniques/T1098/001/
drilldown_searches:
 name:'View the detection results for - "$targetSpName$"'
 search:'%original_detection_search% | search targetSpName = "$targetSpName$"'
 earliest_offset:'$info_min_time$'
 latest_offset:'$info_max_time$'
 name:'View risk events for the last 7 days for - "$user$"'
 search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") | 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'
analytic_story:['Azure Active Directory Persistence', 'NOBELIUM Group']

asset_type:Azure Active Directory

mitre_attack_id:['T1098.001', 'T1586.003', 'T1078.004']

product:['Splunk Enterprise', 'Splunk Enterprise Security', 'Splunk Cloud']

category:cloud

security_domain:identity

tags:

tests:
 name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1098.001/azure_ad_federated_identity_credential/azure-audit.log
  source: Azure AD
  sourcetype: azure:monitor:aad
 test_type:'unit'
manual_test:None