1. Resources
  2. Detection rules
  3. Account Access Removal

Account Access Removal detection rules

An attacker with administrative rights deletes or disables user accounts, often the administrators first, to lock an organization out of its own Microsoft Entra tenant during extortion or a destructive attack.

Platform
Microsoft Entra ID
Severity
High
Log source
Microsoft Entra ID audit logs
Last updated
MITRE ATT&CK technique
T1531Account Access Removal
Tactic
Impact
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A role that can delete or disable users, User Administrator or higher, or an application with equivalent Microsoft Graph permissions.
Impact
Staff and administrators lose access to the tenant and everything that signs in through it, and permanently deleted accounts must be rebuilt by hand.
Response
Block sign-in for the identity that removed the accounts and revoke its sessions, then restore the deleted users while the 30 days still run.
Mitigation
Keep at least two cloud-only emergency access accounts with credentials stored offline, and limit the roles that can delete users to the people who need them.
Audit activities
Bulk delete users - finished (bulk)Enable accountRestore userRemove member from roleRemove eligible member from roleRemove scoped member from roleRemove member from role in PIM completed (permanent)Remove eligible member from role in PIM completed (permanent)Remove permanent direct role assignmentRemove permanent eligible role assignmentDelete userDisable accountand 1 more in the rules below
Threat groups
AkiraLAPSUS$

How the attack works

Account access removal comes at the end of an intrusion. Once the attacker controls an identity that can manage users, they take access away from the people who could respond: accounts are deleted or disabled, usually starting with administrators and the security team. The purpose is pressure in an extortion case, sabotage, or time to finish something else while the organization cannot sign in.

In Microsoft Entra ID a deleted user stays in a suspended state for 30 days and can be restored with all its properties. A permanently deleted user cannot be restored by anyone, including Microsoft support, and has to be created again by hand. That makes permanent deletion the step that turns an outage into lasting damage. The bulk operations of the admin center add scale: one action deletes every user listed in an uploaded file.

All of this is written to the audit log, with the actor in InitiatedBy and the account in TargetResources: Delete user, Disable account, Hard Delete user and, for the admin center's bulk operation, Bulk delete users - finished (bulk). A single deletion is routine offboarding. The signal is in who did it, which accounts were removed, and in permanent or bulk deletion, which normal operations rarely need. Two more rules read the removal of role assignments, directly or through PIM, because an attacker who strips the administrators of their roles locks them out without deleting a single account. A last rule reads the reverse actions Enable account and Restore user, which responders use to recover and an attacker uses to bring back an account that was disabled to contain it.

What an attacker needs

  • A compromised identity with a role that can delete or disable users (User Administrator or higher), or an application with equivalent Microsoft Graph permissions.

Impact

Staff and administrators lose access to the tenant and to everything that signs in through it, and the response to the intrusion slows down. Permanently deleted accounts must be rebuilt by hand, with their group memberships, role assignments and licenses. If every administrator account is removed or disabled, the organization can no longer manage its own tenant.

Detection rules

Bulk User Deletion Run From the Admin Center

Detects the bulk delete operation of the Microsoft Entra admin center finishing. The operation deletes every user listed in an uploaded file in one action, which is rare in normal administration and an efficient way to remove access for many people at once.

LevelMediumStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Bulk User Deletion Run From the Admin Center
id: 5b21d2a7-0364-4252-92e1-e6d4b103895d
status: experimental
description: >-
  Detects the bulk delete operation of the Microsoft Entra admin center
  finishing. The operation deletes every user listed in an uploaded file in
  one action, which is rare in normal administration and an efficient way to
  remove access for many people at once.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/identity/users/users-bulk-delete
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-14
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName: Bulk delete users - finished (bulk)
  condition: selection
falsepositives:
  - Planned clean-ups, for example removing the accounts of a closed site, a finished project or a school year. Confirm the change record and the list of users with the administrator who ran it.
level: medium

False positives

  • Planned clean-ups, for example removing the accounts of a closed site, a finished project or a school year. Confirm the change record and the list of users with the administrator who ran it.

Disabled or Deleted Microsoft Entra Account Brought Back

Detects the reverse of account access removal: a disabled account is enabled again (Enable account) or a deleted user is restored from the recycle bin (Restore user). Responders see these events when they undo an attack. The same events are written when an attacker brings back an account that was disabled to contain it, or an account of someone who left the organization that nobody watches any more. A deleted user can be restored with all its properties for 30 days. The rule matches the two activity names and nothing else, so the account in TargetResources and the actor in InitiatedBy decide what the event means.

LevelLowStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Disabled or Deleted Microsoft Entra Account Brought Back
id: ff390972-c73c-42fb-b36d-a9ac0500ffc4
status: experimental
description: >-
  Detects the reverse of account access removal: a disabled account is enabled
  again (Enable account) or a deleted user is restored from the recycle bin
  (Restore user). Responders see these events when they undo an attack. The
  same events are written when an attacker brings back an account that was
  disabled to contain it, or an account of someone who left the organization
  that nobody watches any more. A deleted user can be restored with all its
  properties for 30 days. The rule matches the two activity names and nothing
  else, so the account in TargetResources and the actor in InitiatedBy decide
  what the event means.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/fundamentals/users-restore
  - https://attack.mitre.org/techniques/T1531/
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.impact
  - attack.t1531
  - attack.persistence
  - attack.t1098
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName:
      - Enable account
      - Restore user
  filter_failed:
    Result: failure
  condition: selection and not filter_failed
falsepositives:
  - Staff who return from leave, seasonal workers and accounts restored after a mistaken deletion. Expect them from the identity team and from the HR-driven provisioning service.
  - Recovery after an incident, when responders restore the accounts an attacker deleted or disabled.
  - Alert on it for accounts that were disabled during an incident, for privileged accounts and for actors that do not normally manage users.
level: low

False positives

  • Staff who return from leave, seasonal workers and accounts restored after a mistaken deletion. Expect them from the identity team and from the HR-driven provisioning service.
  • Recovery after an incident, when responders restore the accounts an attacker deleted or disabled.
  • Alert on it for accounts that were disabled during an incident, for privileged accounts and for actors that do not normally manage users.

Many Microsoft Entra Role Assignments Removed Within an Hour

Counts removals of Microsoft Entra role assignments, active or eligible, made directly or through PIM. Microsoft's security operations guide for PIM tells defenders to alert on bulk deletion changes to privileged account permissions and to investigate immediately when the change was not planned. An attacker who strips the administrators of their roles produces a run of these events. The rule fires at five or more removals of the same kind within one hour. The count is per audit activity name, because the audit log mapping has no single field for the initiator, so read InitiatedBy in the matching events to see whether one actor made them. Microsoft gives no number for removals (its default for additions is 4 in 60 minutes), so the threshold and the window are starting points.

Fires when one OperationName has at least 5 matching events within 1 hour.

Threshold ruleLevelHighStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Microsoft Entra Role Assignment Removed (Bulk Removal Base Event)
id: 319c6167-bbb6-4fa0-a3ac-0b423ad9c99c
name: entra_role_assignment_removed
status: experimental
description: >-
  Base event of the threshold rule in this file. A Microsoft Entra role
  assignment, active or eligible, was removed directly or through PIM. The
  PIM activities written when an activation ends are not in the list.
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    Category: RoleManagement
    OperationName:
      - Remove member from role
      - Remove eligible member from role
      - Remove scoped member from role
      - Remove member from role in PIM completed (permanent)
      - Remove eligible member from role in PIM completed (permanent)
      - Remove permanent direct role assignment
      - Remove permanent eligible role assignment
  filter_failed:
    Result: failure
  condition: selection and not filter_failed
level: low
---
title: Many Microsoft Entra Role Assignments Removed Within an Hour
id: 1b7b4bb8-1db8-4e73-a1b1-621517c05805
status: experimental
description: >-
  Counts removals of Microsoft Entra role assignments, active or eligible,
  made directly or through PIM. Microsoft's security operations guide for PIM
  tells defenders to alert on bulk deletion changes to privileged account
  permissions and to investigate immediately when the change was not planned.
  An attacker who strips the administrators of their roles produces a run of
  these events. The rule fires at five or more removals of the same kind
  within one hour. The count is per audit activity name, because the audit
  log mapping has no single field for the initiator, so read InitiatedBy in
  the matching events to see whether one actor made them. Microsoft gives no
  number for removals (its default for additions is 4 in 60 minutes), so the
  threshold and the window are starting points.
references:
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-privileged-identity-management
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-18
tags:
  - attack.impact
  - attack.t1531
correlation:
  type: event_count
  rules:
    - entra_role_assignment_removed
  group-by:
    - OperationName
  timespan: 1h
  condition:
    gte: 5
falsepositives:
  - Access reviews that remove many unused assignments when they are applied, and cleanup projects that move standing assignments into PIM. Announce them to the SOC.
  - In tenants that use PIM, the end of an activation may also be written by Core Directory as a removal made by PIM's own service, which raises the count of "Remove member from role" in busy hours. Check the initiator in InitiatedBy and raise the threshold if this is your normal level.
  - The values of five removals and one hour are starting points, not tested limits.
level: high

False positives

  • Access reviews that remove many unused assignments when they are applied, and cleanup projects that move standing assignments into PIM. Announce them to the SOC.
  • In tenants that use PIM, the end of an activation may also be written by Core Directory as a removal made by PIM's own service, which raises the count of "Remove member from role" in busy hours. Check the initiator in InitiatedBy and raise the threshold if this is your normal level.
  • The values of five removals and one hour are starting points, not tested limits.

Privileged Microsoft Entra Role Assignment Removed

Detects the removal of an active or eligible assignment of a role that controls the tenant or its security settings: Global Administrator, Privileged Role Administrator, Privileged Authentication Administrator, Security Administrator, Conditional Access Administrator and User Administrator. An attacker who holds a privileged account removes the other administrators so that nobody is left to respond. The rule reads the removal activities Microsoft lists for Core Directory and for PIM and matches the role in TargetResources by its display name (Microsoft's guidance names the Role.DisplayName modified property) and by Company Administrator, the legacy name of Global Administrator. Two PIM activities are left out on purpose, "Remove member from role (PIM activation expired)" and "Remove member from role completed (PIM deactivate)", because they are written when an activation ends. The timebound variants of the PIM removal activities are left out as well, because Microsoft does not say whether the normal end of a time-bound assignment writes them.

LevelMediumStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: Privileged Microsoft Entra Role Assignment Removed
id: 36e9e3c3-863d-48c0-bd17-4152e3e72b57
status: experimental
description: >-
  Detects the removal of an active or eligible assignment of a role that
  controls the tenant or its security settings: Global Administrator,
  Privileged Role Administrator, Privileged Authentication Administrator,
  Security Administrator, Conditional Access Administrator and User
  Administrator. An attacker who holds a privileged account removes the other
  administrators so that nobody is left to respond. The rule reads the removal
  activities Microsoft lists for Core Directory and for PIM and matches the
  role in TargetResources by its display name (Microsoft's guidance names the
  Role.DisplayName modified property) and by Company Administrator, the legacy
  name of Global Administrator. Two PIM activities are left out on purpose,
  "Remove member from role (PIM activation expired)" and "Remove member from
  role completed (PIM deactivate)", because they are written when an
  activation ends. The timebound variants of the PIM removal activities are
  left out as well, because Microsoft does not say whether the normal end of a
  time-bound assignment writes them.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/architecture/security-operations-privileged-identity-management
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-18
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: azure
  service: auditlogs
detection:
  selection_activity:
    Category: RoleManagement
    OperationName:
      - Remove member from role
      - Remove eligible member from role
      - Remove scoped member from role
      - Remove member from role in PIM completed (permanent)
      - Remove eligible member from role in PIM completed (permanent)
      - Remove permanent direct role assignment
      - Remove permanent eligible role assignment
  selection_role:
    TargetResources|contains:
      - Global Administrator
      - Company Administrator
      - Privileged Role Administrator
      - Privileged Authentication Administrator
      - Security Administrator
      - Conditional Access Administrator
      - User Administrator
  filter_failed:
    Result: failure
  condition: all of selection_* and not filter_failed
falsepositives:
  - An administrator who leaves the team or changes duties, and access reviews that remove unused assignments. Match each removal to a request and check that enough other administrators remain.
  - In tenants that use PIM, the end of an activation may also be written by Core Directory as a removal made by PIM's own service. Confirm the initiator in InitiatedBy before you exclude that service.
  - The role list is a starting point. Align it with the roles your responders depend on.
level: medium

False positives

  • An administrator who leaves the team or changes duties, and access reviews that remove unused assignments. Match each removal to a request and check that enough other administrators remain.
  • In tenants that use PIM, the end of an activation may also be written by Core Directory as a removal made by PIM's own service. Confirm the initiator in InitiatedBy before you exclude that service.
  • The role list is a starting point. Align it with the roles your responders depend on.

User Deleted or Disabled

Detects a user being deleted or a user account being disabled. Both happen every day in offboarding, so this rule is a building block: scope it to administrators and emergency access accounts, or to actors that do not normally manage users, before alerting on it.

LevelLowStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: User Deleted or Disabled
id: dd98e690-e301-4513-831c-6aa33c2c0834
status: experimental
description: >-
  Detects a user being deleted or a user account being disabled. Both happen
  every day in offboarding, so this rule is a building block: scope it to
  administrators and emergency access accounts, or to actors that do not
  normally manage users, before alerting on it.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/fundamentals/users-restore
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-14
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName:
      - Delete user
      - Disable account
  filter_failed:
    Result: failure
  condition: selection and not filter_failed
falsepositives:
  - Routine offboarding by the help desk, HR-driven provisioning and identity governance workflows. Exclude those actors in a filter on InitiatedBy once they are documented, and keep the alert for privileged target accounts.
level: low

False positives

  • Routine offboarding by the help desk, HR-driven provisioning and identity governance workflows. Exclude those actors in a filter on InitiatedBy once they are documented, and keep the alert for privileged target accounts.

User Permanently Deleted

Detects the permanent (hard) deletion of a user. A deleted user can be restored for 30 days; a permanently deleted user cannot be restored by anyone, including Microsoft support. Normal offboarding leaves the account to expire on its own, so a manual permanent deletion deserves a check of who did it and to which account.

LevelMediumStatusExperimentalLog sourceMicrosoft Entra ID audit logs
title: User Permanently Deleted
id: 8d06b964-25a1-40fa-8839-ec8218376fdb
status: experimental
description: >-
  Detects the permanent (hard) deletion of a user. A deleted user can be
  restored for 30 days; a permanently deleted user cannot be restored by
  anyone, including Microsoft support. Normal offboarding leaves the account
  to expire on its own, so a manual permanent deletion deserves a check of
  who did it and to which account.
references:
  - https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
  - https://learn.microsoft.com/en-us/entra/fundamentals/users-restore
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-14
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: azure
  service: auditlogs
detection:
  selection:
    OperationName: Hard Delete user
  filter_failed:
    Result: failure
  condition: selection and not filter_failed
falsepositives:
  - Administrators who clear deleted users to free a user principal name or to meet a data deletion request. Confirm the ticket and the account.
  - Deleted users that reach the end of the 30 days, if your tenant records their automatic removal under this activity. Check the actor in InitiatedBy and add a filter for the directory service if so.
level: medium

False positives

  • Administrators who clear deleted users to free a user principal name or to meet a data deletion request. Confirm the ticket and the account.
  • Deleted users that reach the end of the 30 days, if your tenant records their automatic removal under this activity. Check the actor in InitiatedBy and add a filter for the directory service if so.

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.

Role assignments removed by an account that received a privileged role shortly before

Detection hypothesisSequence of events

An attacker who takes over the tenant first gives a role to an account they control and then removes the roles of the real administrators. The same account appearing as the new member of a privileged role and, soon after, as the actor who removes other members is that takeover in two steps.

  1. A privileged role is assigned: category RoleManagement, activity Add member to role or Add eligible member to role, with the new member in TargetResources.
  2. Within 24 hours the same account removes role assignments of others: Remove member from role or Remove eligible member from role, with that account in InitiatedBy and a different account in TargetResources.
  3. Raise the priority when the removed accounts are your long-standing administrators or emergency access accounts.

EventsAdd member to roleAdd eligible member to roleRemove member from roleRemove eligible member from role

LimitsA new lead administrator who reorganizes the team's roles on the first day produces the same sequence, so confirm the handover. The 24 hours are a starting point. An attacker who uses one account to gain the role and another to remove the others is not joined.

Account disabled and enabled again by a different actor

Detection hypothesisSequence of events

Responders disable an account to contain it. If someone else enables it again soon after, either the containment was undone by mistake or an attacker with the right to manage users is bringing the account back.

  1. An account is disabled: audit activity Disable account, with the account in TargetResources and the actor in InitiatedBy.
  2. Within 7 days the same account is enabled: Enable account with the same account in TargetResources.
  3. Alert when the actor in InitiatedBy of the second event differs from the actor of the first, and check the sign-ins of the account after it was enabled.

EventsDisable accountEnable account

LimitsLeave and return processes, and a provisioning service that enables what a person disabled, produce the same pair. Exclude the provisioning identity by name. The 7 days are a starting point.

Triage

  • Identify the actor (InitiatedBy) and the accounts (TargetResources). Does the actor normally offboard users, and is there a leaver ticket for each account?
  • Check whether the removed accounts are administrators, emergency access accounts or members of the security team.
  • Count the deletions and disablements by the same actor in the period, and look at the actor's sign-ins before them for unfamiliar IP addresses or risk.
  • If the removal is not legitimate, restore the deleted users, enable the disabled ones, revoke the actor's sessions and reset its credentials, then review everything else the actor changed.

Response

Once the attack is confirmed:

  1. Block sign-in for the identity that removed the accounts and revoke its sessions. If the actor is an application, disable its service principal. If the administrators are already locked out, do this with an emergency access account.
  2. Take the role or Microsoft Graph permission that allows deleting users away from every identity the attacker used, and look for accounts, role assignments and application credentials the attacker created to come back.
  3. Restore the deleted users while the 30 days still run, administrators and the security team first, and enable the accounts that were disabled.
  4. Create permanently deleted accounts again by hand, with their group memberships, role assignments and licenses, because nobody can restore them.
  5. Confirm that the restored administrators can sign in and that the emergency access accounts are untouched, then keep watching the audit log for further deletions by other actors.

Mitigation

  • Keep at least two cloud-only emergency access accounts with the Global Administrator role, store their credentials offline and alert on every change to them.
  • Limit the roles that can delete users to the people who need them, and protect those roles with phishing-resistant MFA and Privileged Identity Management.
  • Protect permanent deletion with a Conditional Access protected action (microsoft.directory/deletedItems/delete), so it needs a fresh, strong authentication.
  • Review service principals that hold user management roles or Microsoft Graph permissions; an application can delete accounts as well as a person can.
  • Restore wrongly deleted users within the 30 days in which that is still possible.

Frequently asked questions

Can a permanently deleted user be restored?

No. A deleted user stays in a suspended state for 30 days and can be restored with all its properties in that time. A permanently deleted user cannot be restored by anyone, including Microsoft support. The account has to be created again by hand, with its group memberships, role assignments and licenses.

Why is the rule for deleted or disabled users only a building block?

Deleting and disabling accounts is daily offboarding work, so one event says little. The signal is in who did it and to which accounts. Scope the rule to administrators, emergency access accounts and the security team, or to actors that do not normally manage users, before you alert on it.

Does the bulk deletion rule also see many accounts deleted one by one?

No. `Bulk delete users - finished (bulk)` is written for the bulk operation of the admin center, which deletes every user listed in an uploaded file. Accounts deleted one at a time each produce their own `Delete user` event. To see that pattern, count the deletions and disablements of one actor over a short period.

What should we do first when administrators are being deleted?

Stop the actor before you repair anything. Sign in with an emergency access account, block the identity named in InitiatedBy and revoke its sessions. Then restore the deleted administrators, which is possible for 30 days unless they were permanently deleted.

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.