1. Resources
  2. Detection rules
  3. Authentication or Claims Policy Attached to an Application

Authentication or Claims Policy Attached to an Application detection rules

An attacker attaches a home realm discovery, claims mapping or token lifetime policy to an application, so that it accepts passwords of federated users directly, receives altered claims or issues longer-lived tokens.

Platform
Microsoft Entra ID
Severity
Medium
Log source
Microsoft Entra ID audit logs
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A role that manages the application's policies, which Microsoft's procedure for home realm discovery policies sets at Application Administrator or higher.
Impact
Password-only sign-in to one application for federated users, altered claims for a relying application, or tokens that stay valid for up to a day.
Response
Remove the policy from the application, review the sign-ins made while it was attached and reset the passwords of users who signed in with a password alone.
Mitigation
Keep the roles that manage enterprise applications on few accounts and review which authentication and claims policies are attached to which applications.
Audit activities
Add policy to service principalAdd policy to application
Threat groups
FIN13Salt Typhoon

How the attack works

Microsoft Entra ID has policy objects that change how it authenticates users for one application or what it puts into the tokens for it. A policy is created once and then assigned, and Microsoft documents that it takes effect for a specific application when it is attached to that application's service principal. Three types matter here. A home realm discovery policy decides where a user of the application is sent to authenticate. A claims mapping policy changes which claims the application receives and where their values come from. A token lifetime policy sets how long the access, ID and SAML tokens for the application stay valid.

Each of them can be turned against the organization by someone who manages applications. A home realm discovery policy with AllowCloudPasswordValidation lets an application authenticate a federated user with user name and password directly at the Microsoft Entra token endpoint, where password hash synchronization is on. Microsoft tells administrators to enable this only if authenticating the application without the policies of the on-premises identity provider is acceptable, because the federated provider and whatever it enforces are skipped. A claims mapping policy changes what a relying application is told about the user. Microsoft's own security note says that applications rely on claim values that can't be tampered with, and that those assumptions may no longer be correct once the token contents are customized. A token lifetime policy can stretch an access token to as much as one day, which keeps a stolen token usable for longer.

Microsoft's audit activity reference lists the assignment as Add policy to service principal and Add policy to application, in the category ApplicationManagement of Core Directory. Microsoft documents the names only. The record is not documented to say which type of policy was attached or what it contains, so the rule on this page matches the two activity names and the policy has to be read afterwards.

What an attacker needs

  • An account that can manage the application's policies. Microsoft's procedure for home realm discovery policies asks for at least the Application Administrator role.
  • For direct password authentication of federated users, a tenant with password hash synchronization turned on.
  • For altered claims, an application that accepts mapped claims, through a custom signing key or the setting in its manifest.

Impact

Depending on the policy, sign-in to one application with a password alone for users whose domain is federated, without the federated identity provider and its controls, a relying application that is told something untrue about who the user is or which attributes they have, or tokens for the application that remain valid for up to a day. None of this changes a user, a credential or a Conditional Access policy, so the usual alerts stay quiet.

Detection rules

Policy Added to an Application or Service Principal

Detects a policy object being attached to an application or to a service principal. Microsoft's audit activity reference lists both activities for Core Directory in the category ApplicationManagement: "Add policy to service principal" and "Add policy to application". The policies that are assigned this way include home realm discovery policies, which can allow an application to authenticate federated users with a password directly at Microsoft Entra ID, claims mapping policies, which change the claims a relying application receives, and token lifetime policies. Microsoft documents that such a policy takes effect for an application when it is attached to its service principal. The names of the activities are all Microsoft documents, so the rule matches on the names only and cannot tell the type of the policy or its content. It is rated low for that reason. Read the policy named in TargetResources. The actor is in InitiatedBy.

LevelLowStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Policy Added to an Application or Service Principal
id: 6d7eaf6f-3883-493f-a84b-ef9863c660e3
status: experimental
description: >-
  Detects a policy object being attached to an application or to a service
  principal. Microsoft's audit activity reference lists both activities for
  Core Directory in the category ApplicationManagement: "Add policy to
  service principal" and "Add policy to application". The policies that are
  assigned this way include home realm discovery policies, which can allow
  an application to authenticate federated users with a password directly at
  Microsoft Entra ID, claims mapping policies, which change the claims a
  relying application receives, and token lifetime policies. Microsoft
  documents that such a policy takes effect for an application when it is
  attached to its service principal. The names of the activities are all
  Microsoft documents, so the rule matches on the names only and cannot tell
  the type of the policy or its content. It is rated low for that reason.
  Read the policy named in TargetResources. The actor is in InitiatedBy.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/home-realm-discovery-policy
  - https://learn.microsoft.com/en-us/entra/identity-platform/reference-claims-customization
  - https://learn.microsoft.com/en-us/entra/identity-platform/configurable-token-lifetimes
  - https://attack.mitre.org/techniques/T1556/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.defense-impairment
  - attack.persistence
  - attack.t1556
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName:
      - Add policy to service principal
      - Add policy to application
  filter_failed:
    Result: failure
  condition: selection and not filter_failed
falsepositives:
  - Administrators who set up single sign-on for an enterprise application and customize its claims. Microsoft states that the claims customization of the admin center and a claims policy use the same underlying policy, so that work can write this activity.
  - Planned token lifetime or home realm discovery policies for a legacy application. Match the event to the owner of the application and to a change record.
level: low

False positives

  • Administrators who set up single sign-on for an enterprise application and customize its claims. Microsoft states that the claims customization of the admin center and a claims policy use the same underlying policy, so that work can write this activity.
  • Planned token lifetime or home realm discovery policies for a legacy application. Match the event to the owner of the application and to a change record.

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.

Policy attached to an application, then password-only sign-ins by federated users to it

Detection hypothesisSequence of eventsJoins two logsNeeds your own lists

The purpose of a home realm discovery policy with direct password validation is that an application can sign federated users in with the resource owner password credentials flow. An attacker who attaches such a policy uses it soon after. The assignment followed by sign-ins of that kind to the same application shows the abuse.

  1. Audit log: activity Add policy to service principal. Take the service principal from TargetResources and the actor from InitiatedBy.
  2. Sign-in logs, interactive and non-interactive, for the following 7 days: successful sign-ins (ResultType 0) to that application with AuthenticationProtocol equal to ropc.
  3. Keep the sign-ins of users whose domain is federated in your tenant.
  4. Alert when such sign-ins exist, and raise the priority when they come from an address the application has not been used from before.

EventsAdd policy to service principal

LimitsA legacy application for which the policy was attached on purpose produces the same sign-ins, so confirm the change first. The 7 days are a starting point. The hypothesis covers home realm discovery policies only, and it sees nothing when the attacker has not yet used the policy.

Triage

  • Identify the application or service principal in TargetResources and the actor in InitiatedBy.
  • Read the policy that was attached. Its type and its definition show whether it is a home realm discovery, a claims mapping or a token lifetime policy and what it sets.
  • For a home realm discovery policy, check whether AllowCloudPasswordValidation is true and whether the tenant has federated domains with password hash synchronization.
  • For a claims mapping policy, check which claims are changed and whether the application uses them to decide who the user is or what they may do.
  • Ask the owner of the application for the change record, and review the sign-in behind the actor's session.
  • Review the sign-ins to the application after the change for the resource owner password credentials flow and for unfamiliar addresses.

Response

Once the attack is confirmed:

  1. Remove the policy from the application, and delete the policy object when nobody owns it.
  2. Review the sign-ins to the application since the policy was attached. For users who signed in with a password alone, reset the password and revoke the sessions.
  3. For altered claims, review what the affected users did in the relying application while the policy was attached, together with the owner of that application.
  4. Revoke the sessions and reset the credentials of the account that attached the policy, and remove the role that allowed it.
  5. Check the other applications and the organization default for policies of the same types created or changed by the same actor.

Mitigation

  • Keep Application Administrator, Cloud Application Administrator and other roles that manage enterprise applications on few accounts, eligible through Privileged Identity Management.
  • List the home realm discovery, claims mapping and token lifetime policies of the tenant and the applications they are attached to, and compare the list with what the application owners expect.
  • Do not allow direct password authentication of federated users for any application unless a documented legacy need exists, and remove the policy when the need ends.
  • Follow Microsoft's advice on customized claims. Use a custom signing key and avoid setting the application manifest to accept mapped claims.
  • Require MFA for all users and applications with Conditional Access. The resource owner password credentials flow cannot answer an MFA prompt, so a password alone is then not enough.

Frequently asked questions

Does the rule show which kind of policy was attached?

No. Microsoft lists the activities `Add policy to service principal` and `Add policy to application` and documents their names only. The detection matches the names and is rated low for that reason. The type and the definition of the policy have to be read from the policy object, which the event names in TargetResources.

Why does a home realm discovery policy matter for security?

One of its settings, AllowCloudPasswordValidation, allows federated user authentication with user name and password directly at a Microsoft Entra token endpoint when password hash synchronization is on. Microsoft tells administrators to enable it only if authenticating the application without the policies of the on-premises identity provider is acceptable. An attacker who knows a password then does not have to pass the federated provider.

Can a claims mapping policy change any claim an application receives?

Not by itself. Microsoft restricts a set of claims by default, and an application has to acknowledge customized tokens through a custom signing key or a manifest setting, otherwise Microsoft Entra ID returns an error. The risk is highest for applications that already accept mapped claims and decide access from them.

Is there a public incident report for this technique?

No public incident report describes this at the audit event level. The page is based on what Microsoft documents about these policy types: what each setting does, that a policy takes effect when it is attached to a service principal, and Microsoft's own cautions about direct password authentication and customized claims.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.