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

Privileged Identity Management (PIM) Eligibility and Activation Abuse

Also known as: PIM abuse, PIM eligible assignment persistence, PIM role activation abuse, Entra PIM backdoor, Just-in-time access abuse

An attacker activates a privileged role that a compromised user is eligible for, or adds an eligible or permanent assignment for an account they control, using Privileged Identity Management's own requests.

Platform
Microsoft Entra ID
Impact
Critical
Last updated
Attack difficulty
Medium
Detection difficulty
Medium
Privileges required: Specific rights or roles
An account eligible for a privileged role, or an identity that manages PIM assignments: Privileged Role Administrator, Global Administrator or an app with RoleManagement.ReadWrite.Directory.
What the attacker gains
An active privileged directory role for the length of the activation, or a dormant eligible assignment that can be activated whenever the attacker returns.

How it works

Privileged Identity Management (PIM) replaces standing administrator roles with two kinds of assignment. An eligible assignment gives a principal the right to activate a role. An active assignment gives the role itself, either permanently or for a set period. An eligible user activates the role when needed; the activation creates a time-limited active assignment, and it expires on its own.

What an activation requires is set per role in the role's PIM settings: MFA, a justification text, a ticket number, approval by named approvers, and a maximum duration of up to 24 hours. The settings also say whether eligible and active assignments may be permanent.

PIM narrows the window in which an account is an administrator. It doesn't remove the paths; it moves them. The abuses fall into four groups.

Activation by whoever holds the eligible account

An attacker who controls an eligible user's session submits the activation request the user would have submitted. If the role needs only MFA and a justification, the request is granted at once. Microsoft requires that the request come from a session in which the user was challenged for MFA, and a token obtained by device code phishing or token theft meets that requirement, because the victim performed the MFA. Approval by another person is the setting that actually interrupts this.

An eligible assignment as persistence

An identity that manages PIM (Privileged Role Administrator, Global Administrator, or an application with RoleManagement.ReadWrite.Directory or RoleEligibilitySchedule.ReadWrite.Directory) adds an eligible assignment for an account the attacker controls. Nothing becomes active. Lists of current administrators don't change. Months later the account activates the role for an hour and deactivates it again.

A permanent active assignment through PIM

The same identity creates an active assignment with no expiry through the PIM API. The result is a standing administrator, but the audit trail reads as a PIM operation and not as an assignment made outside PIM, which is what many tenants alert on.

Weakening the gate

Changing a role's settings (removing the approval requirement, dropping MFA, lengthening the activation, allowing permanent assignments) affects every existing eligibility for that role without touching the list of eligible principals. Disabling PIM's built-in alerts hides the result. An attacker with role management rights does this first, then activates through an account that was eligible all along.

PIM for Groups extends the same model to group membership and ownership. An eligible membership in a group that holds a role, or in a group that is excluded from Conditional Access, is the same exposure one step removed.

Prerequisites

For activation:

  • Control of an account with an eligible assignment for a useful role, in a session that satisfies the role's activation settings.
  • No approval requirement on the role, or an approver the attacker also controls.

For adding assignments or changing settings:

  • Privileged Role Administrator or Global Administrator, active, or a service principal with RoleManagement.ReadWrite.Directory.

PIM itself requires Microsoft Entra ID P2 or ID Governance licensing, so these paths exist only in tenants that use it.

Attack steps

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

The steps below are for an authorized assessment or a lab.

1. Read eligibility and active assignments

# Who is eligible for which role, at which scope, until when
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilityScheduleInstances"

# Who holds an active assignment right now, and whether it is assigned or activated
az rest --method get \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignmentScheduleInstances"

In the second list, assignmentType separates a standing assignment (Assigned) from an activation (Activated), and memberType shows whether it comes directly or through a group.

2. Activate an eligible role

As the eligible user, request activation. principalId is the user's own object ID, and the duration can't exceed the role's maximum:

az rest --method post \
  --url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignmentScheduleRequests" \
  --body '{
    "action": "selfActivate",
    "principalId": "<own object id>",
    "roleDefinitionId": "<role definition id>",
    "directoryScopeId": "/",
    "justification": "Investigating sign-in issue",
    "scheduleInfo": {
      "startDateTime": "2026-11-29T09:00:00.000Z",
      "expiration": { "type": "AfterDuration", "duration": "PT1H" }
    }
  }'

A response with status Granted means the role is active. If the role requires approval, the request waits for an approver instead. Adding "isValidationOnly": true to the body checks whether the activation is subject to rules such as MFA without submitting it.

When finished, the same endpoint with "action": "selfDeactivate" ends the activation early.

3. Add an eligible assignment for a controlled account

With rights to manage PIM:

Connect-MgGraph -Scopes "RoleManagement.ReadWrite.Directory"

$params = @{
    action           = "adminAssign"
    justification    = "Operations coverage"
    roleDefinitionId = "<role definition id>"
    directoryScopeId = "/"
    principalId      = "<object id of the controlled account>"
    scheduleInfo     = @{
        startDateTime = [System.DateTime]::Parse("2026-11-29T00:00:00Z")
        expiration    = @{
            type        = "afterDateTime"
            endDateTime = [System.DateTime]::Parse("2027-11-29T00:00:00Z")
        }
    }
}
New-MgRoleManagementDirectoryRoleEligibilityScheduleRequest -BodyParameter $params

The response status Provisioned means the eligibility exists. How long an eligibility may last, and whether it may be permanent, depends on the role's settings.

4. Or create a permanent active assignment through PIM

$params = @{
    action           = "adminAssign"
    justification    = "Service continuity"
    roleDefinitionId = "<role definition id>"
    directoryScopeId = "/"
    principalId      = "<object id of the controlled account>"
    scheduleInfo     = @{
        startDateTime = [System.DateTime]::Parse("2026-11-29T00:00:00Z")
        expiration    = @{ type = "NoExpiration" }
    }
}
New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest -BodyParameter $params

5. Use the role inside the window

An activated role is used for the actions that outlast it: a credential on an application, a new role or eligible assignment, a Conditional Access exclusion, a federated domain. The activation then expires and the account looks ordinary again.

Impact

Activation gives the attacker the role itself, including Global Administrator, for up to the role's maximum duration, which is enough to plant any persistence the tenant allows. An added eligible assignment is a standing way back that doesn't count as an administrator in most reports. A permanent active assignment is a plain administrator account. Weakened role settings lower the bar for everyone who is eligible, including accounts the attacker compromises later.

OPSEC and artifacts

  • Eligible is quieter than active. An eligible assignment doesn't appear in the role's active members or in the tokens of the account until activation. It is recorded once, as "Add eligible member to role", and then nothing until it is used.
  • Activations look like administration. A short activation with a plausible justification, during working hours, by an account that activates regularly, is indistinguishable from normal use in a single record. What gives it away is context: a new address or device for the request, no matching change ticket, or directory writes inside the window that the user wouldn't make.
  • Activation sends notifications. PIM can email administrators and approvers when a role is activated or assigned. Operators check the role's notification settings first; the audit record is written either way.
  • Staying inside PIM avoids the "outside PIM" alert. An active assignment created through the PIM API doesn't trigger the alert for roles assigned outside PIM. It is still recorded, with its permanent or time-bound form in the activity name.
  • Settings changes are their own event. "Update role setting in PIM" records each change to a role's policy. It is rare in a healthy tenant.
  • The effective interval is recorded. Request, approval, completion and expiry are separate audit records with provider timestamps. An action by the account can be placed inside or outside the activation, and if the account had another source of the same authority, the interval alone doesn't show which one authorized the action.
  • Deactivating early shortens the visible window and writes another record.

Detection

The PIM timeline for directory roles:

AuditLogs
| where ActivityDisplayName in~ (
    "Add eligible member to role",
    "Add member to role requested (PIM activation)",
    "Add member to role request approved (PIM activation)",
    "Add member to role completed (PIM activation)",
    "Remove member from role (PIM activation expired)",
    "Update role setting in PIM")
    or ActivityDisplayName startswith "Add eligible member to role in PIM"
    or ActivityDisplayName startswith "Add member to role in PIM"
| mv-expand Target = TargetResources
| project ActivityDateTime, Id, ActivityDisplayName, Result, CorrelationId,
          TargetType = tostring(Target.type), TargetName = tostring(Target.displayName),
          TargetId = tostring(Target.id), InitiatedBy
| order by ActivityDateTime asc

Order request, approval, completion and expiry by ActivityDateTime, then list the account's other audit activity between completion and expiry. A request can be retried, so several request rows may lead to one activation.

Mitigation

  • Require approval for the roles that matter. Global Administrator, Privileged Role Administrator, Privileged Authentication Administrator and the application administrator roles should need a second person to approve activation. MFA and a justification alone don't stop someone who holds the user's session. The PIM guide walks through the settings.
  • Require stronger authentication at activation. Use the role setting that requires a Conditional Access authentication context, and bind it to a policy that demands a phishing-resistant method and a compliant device.
  • Keep activations short and require a ticket number where a change system exists.
  • Don't allow permanent eligible or permanent active assignments in role settings, apart from emergency access accounts. See the break-glass accounts guide.
  • Review eligibility like standing access. Run access reviews on eligible and active assignments for privileged roles, and remove eligibility that hasn't been activated in months.
  • Limit who can manage PIM. Privileged Role Administrator should itself be eligible with approval, and no application should hold RoleManagement.ReadWrite.Directory unless role management is its purpose.
  • Keep PIM alerts and notifications on, send them to a monitored mailbox, and alert on any change to role settings.
  • Use cloud-only, dedicated administrator accounts for eligibility, so that phishing a user's everyday account doesn't yield an eligible administrator.
  • Export the audit log to a workspace. The default retention of 30 days is shorter than the time an unused eligible assignment can wait.

Detection rules for this attack

Log events to collect

FAQ

Is an eligible role assignment dangerous if it is never activated?

Yes. Eligibility is standing permission to become an administrator. Whoever controls the eligible account can activate the role when the role's settings allow it, and those settings often ask for nothing more than a justification text. An eligible assignment added by an attacker also doesn't show up in a list of active administrators, which makes it a good hiding place.

Does requiring MFA on activation stop an attacker with a stolen session?

Not always. The activation request must come from a session in which the user was challenged for MFA. A token obtained through device code phishing or an adversary-in-the-middle proxy already carries that claim, because the victim completed MFA themselves. Requiring approval by a second person, or a Conditional Access authentication context with a phishing-resistant method, is what stops this.

How can I tell an activation from a permanent assignment in the logs?

The audit activity names differ. Activations are recorded as Add member to role requested, request approved and completed (PIM activation), followed by Remove member from role (PIM activation expired). Eligible assignments are recorded as Add eligible member to role, and assignments made directly, bypassing PIM, as Add member to role outside of PIM.

What should be checked after a suspicious activation?

Who requested it and from where, who approved it if approval applied, the effective start and end, and every directory change made by that account inside the interval. Then check whether any standing assignment, eligible assignment or role setting changed during the activation, because those outlive it.

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.