Techniques
Sample rules
Azure AD Federated Identity Credential Added To Service Principal
- source: splunk
- technicques:
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.
Detection logic
`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`