How the attack works
A federated identity credential makes a user-assigned managed identity trust tokens from an external identity provider (the issuer) for a given subject, such as a GitHub Actions workflow, a Kubernetes service account or a workload in another cloud. A workload that presents a matching token receives a Microsoft Entra access token as the managed identity, with every role it holds, and no secret or certificate is involved.
An attacker with write access to a managed identity adds a credential that trusts an issuer and subject they control, for example their own repository or an OpenID Connect issuer they host. They can then obtain tokens for the identity from outside Azure, the identity does not need to be attached to any resource, and rotating secrets or resetting passwords does not remove the access. The change is recorded in the Azure Activity log as Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write; later token use appears in the managed identity sign-in logs.
What an attacker needs
Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/writeon the identity (Owner, Contributor, Managed Identity Contributor or a custom role).
Impact
Durable, secretless access as the managed identity from outside the organization, with all of its Azure role assignments and directory permissions.
Detection rules
Federated Identity Credential Added to Azure Managed Identity
Detects a successful creation or update of a federated identity credential on a user-assigned managed identity, which lets tokens from the configured external issuer and subject obtain access tokens as that identity.
title: Federated Identity Credential Added to Azure Managed Identity
id: 97f6b123-e26d-4db1-a690-7f2aef54fc50
status: experimental
description: >-
Detects a successful creation or update of a federated identity credential
on a user-assigned managed identity, which lets tokens from the configured
external issuer and subject obtain access tokens as that identity.
references:
- https://attack.mitre.org/techniques/T1098/001/
- https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust-user-assigned-managed-identity
- https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/identity
author: Forestall
date: 2026-11-10
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.001
logsource:
product: azure
service: activitylogs
detection:
selection:
OperationNameValue: MICROSOFT.MANAGEDIDENTITY/USERASSIGNEDIDENTITIES/FEDERATEDIDENTITYCREDENTIALS/WRITE
ActivityStatusValue:
- Success
- Succeeded
condition: selection
falsepositives:
- Setup of GitHub Actions, Azure DevOps or Kubernetes workload identity by platform teams; exclude their deployment identities in a filter_ selection by Caller and review the issuer of each new credential.
level: medium
False positives
- Setup of GitHub Actions, Azure DevOps or Kubernetes workload identity by platform teams; exclude their deployment identities in a filter_ selection by Caller and review the issuer of each new credential.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Federated credential added, then the identity acts from an address it never used
With a federated credential, the token is obtained and used by a workload outside Azure, so what the identity then does in Resource Manager arrives from the address of that workload. Operations by the identity shortly after a credential was added, from an address that is neither one it used before nor one of your own runners or clusters, show the new trust in use.
- In the Azure Activity log, take the successful credential write of the rule on this page. The resource ID names the identity. Read the identity's principal ID from the identity resource.
- Over the next 7 days, take the Activity log events whose
Calleris that principal ID. A managed identity is a service principal, and Microsoft's examples show the object ID inCallerwhen a service principal makes the request. - Compare each
CallerIpAddresswith the addresses the identity used in the 30 days before the credential was added, and with the outbound addresses of your own runners, clusters and other workloads meant to use the identity. - Report events from addresses outside both lists, starting with role assignment writes, key listings and credential writes.
EventsMICROSOFT.MANAGEDIDENTITY/USERASSIGNEDIDENTITIES/FEDERATEDIDENTITYCREDENTIALS/WRITE
LimitsHosted runners of CI services share address ranges that change, which makes the address list hard to keep. The Activity log has no read operations, and calls to Microsoft Graph or to data planes such as Key Vault are not in it. A new identity has no history to compare with. The 7 and 30 days are starting points.
Triage
- Identify the Caller and the managed identity from the event, then read the new credential's issuer, subject and audience on the identity.
- Decide whether the issuer and subject belong to a known pipeline or cluster; treat personal repositories and unknown issuers as suspicious.
- Review the identity's role assignments and managed identity sign-ins since the change, and remove the credential if it is unexplained.
Response
Once the attack is confirmed:
- Record the issuer, subject and audience of the credential, then delete it from the identity. The three values identify the external workload that was trusted.
- Limit the identity while you investigate. Remove or reduce its role assignments and directory permissions until its sign-ins since the change are reviewed.
- Undo what was done as the identity since the credential was added, such as role assignments, credentials added to other identities, new resources and data access shown in its sign-ins and in the Activity log.
- Take write access to managed identities away from the caller, revoke its sessions and rotate its credentials. Contributor on the resource group of the identity is enough to add the credential again.
- Search the other user-assigned managed identities for federated credentials with the same issuer or subject, and for credentials added by the same caller.
- Confirm that the identity lists only the federated credentials you expect, and that its sign-in logs show no further sign-ins that you cannot tie to a known workload.
Mitigation
- Block federated credentials on managed identities that do not need them with Azure Policy (Not allowed resource types for
userAssignedIdentities/federatedIdentityCredentials), and restrict issuers with the built-in policy "Managed Identity Federated Credentials should be from allowed issuer types" (in preview). - Keep user-assigned managed identities least privileged and delete privileged identities that are no longer used.
- Restrict who can write managed identities; Contributor on their resource group is enough to add a credential.
Frequently asked questions
Does this attack apply to system-assigned managed identities?
No. Microsoft documents that configuring a federated identity credential on a system-assigned managed identity is not supported. The operation exists for user-assigned managed identities, and the rule matches the write of a credential on those.
Does the managed identity have to be attached to a resource to be abused this way?
No. With a federated credential, a workload outside Azure that presents a matching token receives an access token as the identity. The identity does not need to be attached to any resource, and no secret or certificate is involved, so rotating secrets does not remove the access.
How do we tell a legitimate federated credential from a malicious one?
Read the issuer, subject and audience of the new credential on the identity. An issuer and subject that belong to a known pipeline or cluster, added by the platform team, is the normal case. A personal repository or an issuer nobody recognizes is suspicious, whoever the caller was.
Where does later use of the federated credential show up?
Token use appears in the managed identity sign-in logs, and what the identity then does in Azure appears in the Activity log under its principal. The rule on this page sees only the moment the credential is written, so review both logs from that time onward. The Detection logic section describes how to follow the identity in the Activity log.
References
- MITRE ATT&CK T1098.001: Additional Cloud Credentials
- Configure a user-assigned managed identity to trust an external identity provider
- Block workload identity federation on managed identities using a policy
- Workload identity federation concepts
- How managed identities for Azure resources work with Azure virtual machines
- Azure Activity Log event schema
- View activity logs for Azure RBAC changes
- Azure permissions for Identity