1. Resources
  2. Detection rules
  3. IAM User Access Removed

IAM User Access Removed detection rules

An attacker with IAM write access deletes the console passwords and access keys of other IAM users, or the users themselves, so that administrators and responders cannot get in while the attack continues.

Platform
AWS
Severity
Medium
Log source
AWS CloudTrail
Last updated
MITRE ATT&CK technique
T1531Account Access Removal
Tactic
Impact
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Credentials allowed to delete or deactivate the passwords and access keys of other IAM users, in an account whose administrators depend on IAM user credentials.
Impact
The affected users can no longer sign in to the console or call the API, so the attacker works without interference and the response starts late.
Response
Through the emergency access account, the root user or the management account, deny everything to the principal that made the calls, then restore the affected users.
Mitigation
Restrict deleting other users' credentials to identity administrators, and keep a tested emergency access process that does not depend on the same IAM users.
CloudTrail events
DeleteAccessKeyUpdateAccessKeyDeleteLoginProfileDeleteRoleDeleteUser
Threat groups
AkiraLAPSUS$

How the attack works

An IAM user signs in to the console with a password (its login profile) and calls the API with access keys. A principal allowed to manage the credentials of other users can take both away without their cooperation. DeleteLoginProfile deletes the password, DeleteAccessKey deletes a key, UpdateAccessKey can set a key to inactive, and DeleteUser removes the user once its credentials and policies are gone. Roles can be taken away in the same manner, because DeleteRole removes a role that administrators or an emergency process depend on.

Attackers do this late in an intrusion, for impact rather than for access. Locking out the administrators and the people who would respond buys time to destroy or encrypt data or to run resources at the owner's expense, and it slows recovery afterwards. Accounts where people still sign in as IAM users, and emergency (break-glass) users, are the most exposed. Identities that federate through IAM Identity Center or an identity provider do not depend on these credentials.

The same calls are routine administration. Offboarding, access key rotation and the containment of a compromised user all produce them, so a single event proves nothing. What separates an attack is who made the call, how many users lost access within a short time, and whether privileged or emergency users are among them. CloudTrail records each call under iam.amazonaws.com with the caller in userIdentity and the affected user in requestParameters.userName; when no user name is given, the call applies to the caller. Removing an MFA device is a different event with a different purpose and has its own page (MFA Device Deactivated for an IAM User or the Root User).

What an attacker needs

  • Credentials for a principal allowed iam:DeleteLoginProfile, iam:DeleteAccessKey, iam:UpdateAccessKey or iam:DeleteUser on other users, directly or through a wildcard such as iam:*.
  • Administrators or emergency users that depend on IAM user credentials.

Impact

The affected users can no longer sign in to the console or call the API. If every administrator of an account is an IAM user, recovery falls back to the root user, and in a member account without root credentials to the management account of the organization. Until access is restored the attacker works without interference, and the response starts late.

Detection rules

IAM Access Key Deleted or Its Status Changed

Detects DeleteAccessKey calls, which delete an access key of an IAM user or of the root user, and UpdateAccessKey calls, which change the status of a key (to inactive, or back to active). A deleted or inactive key can no longer be used to call the API. Both calls are part of normal key rotation, so the rule is a low-level signal: triage by comparing the caller (userIdentity.arn) with requestParameters.userName and by counting how many users were affected in the same session. The rule does not read the new status of UpdateAccessKey: check the request parameters. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: IAM Access Key Deleted or Its Status Changed
id: d33809d0-777c-4f9f-bace-ac882bbe09fe
status: experimental
description: >-
  Detects DeleteAccessKey calls, which delete an access key of an IAM user or
  of the root user, and UpdateAccessKey calls, which change the status of a key
  (to inactive, or back to active). A deleted or inactive key can no longer be
  used to call the API. Both calls are part of normal key rotation, so the rule
  is a low-level signal: triage by comparing the caller (userIdentity.arn) with
  requestParameters.userName and by counting how many users were affected in
  the same session. The rule does not read the new status of UpdateAccessKey:
  check the request parameters.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteAccessKey.html
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateAccessKey.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-14
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName:
      - DeleteAccessKey
      - UpdateAccessKey
  condition: selection
falsepositives:
  - Access key rotation by users and by rotation automation, which deactivates and then deletes the old key. Add the rotation roles to a filter_* selection on userIdentity.arn; a user working on its own key shows the same name in userIdentity and requestParameters.userName.
  - Offboarding and deleting a user in the console, which deletes its keys first.
  - Containment of an exposed key by the response team, and reactivation of a key that was deactivated by mistake.
level: low

False positives

  • Access key rotation by users and by rotation automation, which deactivates and then deletes the old key. Add the rotation roles to a filter_* selection on userIdentity.arn; a user working on its own key shows the same name in userIdentity and requestParameters.userName.
  • Offboarding and deleting a user in the console, which deletes its keys first.
  • Containment of an exposed key by the response team, and reactivation of a key that was deactivated by mistake.

Console Password Deleted for an IAM User

Detects DeleteLoginProfile calls, which delete the console password of an IAM user (or of the root user, from a privileged root session). The user can no longer sign in to the console. Users cannot delete their own password from the console, so the call is normally made by someone else: triage by comparing the caller (userIdentity.arn) with requestParameters.userName and by counting how many users were affected in the same session. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: Console Password Deleted for an IAM User
id: c11e65fe-3cf3-45b5-97f8-3770f03a24b2
status: experimental
description: >-
  Detects DeleteLoginProfile calls, which delete the console password of an IAM
  user (or of the root user, from a privileged root session). The user can no
  longer sign in to the console. Users cannot delete their own password from
  the console, so the call is normally made by someone else: triage by
  comparing the caller (userIdentity.arn) with requestParameters.userName and
  by counting how many users were affected in the same session.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteLoginProfile.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-14
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: DeleteLoginProfile
  condition: selection
falsepositives:
  - Offboarding, moving people from IAM users to IAM Identity Center, and deleting a user in the console, which deletes the password first. Add the identity team roles to a filter_* selection on userIdentity.arn.
  - Containment of a compromised user by the response team, which deletes the password on purpose.
  - Deletion of member account root credentials through an sts:AssumeRoot session from the management account or the IAM delegated administrator account; match the session to its AssumeRoot call.
level: medium

False positives

  • Offboarding, moving people from IAM users to IAM Identity Center, and deleting a user in the console, which deletes the password first. Add the identity team roles to a filter_* selection on userIdentity.arn.
  • Containment of a compromised user by the response team, which deletes the password on purpose.
  • Deletion of member account root credentials through an sts:AssumeRoot session from the management account or the IAM delegated administrator account; match the session to its AssumeRoot call.

IAM Role Deleted

Detects DeleteRole calls, which remove an IAM role from the account. Where administrators and responders work through roles, for example a cross-account administration role or an emergency access role, deleting the role takes their access away in the same way as deleting a user. The Threat Technique Catalog for AWS also lists DeleteRole and DeleteUser as the way an attacker removes the identities they created, to hide what was done with them. AWS names DeleteRole among the IAM calls that CloudTrail logs. Deployment tools delete roles all the time, so the rule is a low-level signal: check which role was deleted and who made the call (userIdentity.arn), and see the threshold rule on this page for bursts. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: IAM Role Deleted
id: ae231eda-782a-4c21-b705-f44a8cdcaaf3
status: experimental
description: >-
  Detects DeleteRole calls, which remove an IAM role from the account. Where
  administrators and responders work through roles, for example a cross-account
  administration role or an emergency access role, deleting the role takes
  their access away in the same way as deleting a user. The Threat Technique
  Catalog for AWS also lists DeleteRole and DeleteUser as the way an
  attacker removes the identities they created, to hide what was done with
  them. AWS names DeleteRole among the IAM calls that CloudTrail logs.
  Deployment tools delete roles all the time, so the rule is a low-level
  signal: check which role was deleted and who made the call
  (userIdentity.arn), and see the threshold rule on this page for bursts.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteRole.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
  - https://aws-samples.github.io/threat-technique-catalog-for-aws/Techniques/T1070.A001.html
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-18
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: DeleteRole
  condition: selection
falsepositives:
  - Infrastructure-as-code pipelines and deployment tools, which delete the roles of the stacks they remove, and clean-up of unused roles by the identity team. Add those roles to a filter_* selection on userIdentity.arn and review deletions of administration and emergency access roles whoever made them.
level: low

False positives

  • Infrastructure-as-code pipelines and deployment tools, which delete the roles of the stacks they remove, and clean-up of unused roles by the identity team. Add those roles to a filter_* selection on userIdentity.arn and review deletions of administration and emergency access roles whoever made them.

IAM User Deleted

Detects DeleteUser calls, which remove an IAM user from the account. IAM deletes a user only after its password, access keys, MFA devices and policies have been removed, so the call is the last step of taking an identity away. Triage by checking who the deleted user was (requestParameters.userName), who made the call (userIdentity.arn) and how many users were deleted in the same session. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM User Deleted
id: fd4dc594-4b2e-4495-ab7b-c8433630bb74
status: experimental
description: >-
  Detects DeleteUser calls, which remove an IAM user from the account. IAM
  deletes a user only after its password, access keys, MFA devices and policies
  have been removed, so the call is the last step of taking an identity away.
  Triage by checking who the deleted user was (requestParameters.userName), who
  made the call (userIdentity.arn) and how many users were deleted in the same
  session.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteUser.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-14
tags:
  - attack.impact
  - attack.t1531
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: DeleteUser
  condition: selection
falsepositives:
  - Offboarding and clean-up of unused users by the identity team, and infrastructure-as-code runs that remove users they created. Add those roles to a filter_* selection on userIdentity.arn and review deletions of administrator and emergency users whoever made them.
level: medium

False positives

  • Offboarding and clean-up of unused users by the identity team, and infrastructure-as-code runs that remove users they created. Add those roles to a filter_* selection on userIdentity.arn and review deletions of administrator and emergency users whoever made them.

Many IAM Users or Roles Deleted by One Principal

Counts, per calling principal (userIdentity.arn), the DeleteUser and DeleteRole calls it made. Five or more within 15 minutes is the pattern of identities being removed in bulk: administrators and emergency identities taken away to lock the owners out, or the users and roles an attacker created being deleted to remove the trace, which the Threat Technique Catalog for AWS describes. Denied calls are counted as well. The count and the window are starting points to tune. For role sessions the principal is the session ARN, so one role used with different session names is counted per session.

Fires when one userIdentity.arn has at least 5 matching events within 15 minutes.

Threshold ruleLevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: IAM User or Role Deleted (Deletion Burst Base Event)
id: f653f72b-9f90-434f-9c6d-c2cbe23167b0
name: aws_iam_user_or_role_deleted
status: experimental
description: >-
  Base event of the threshold rule in this file. A DeleteUser or DeleteRole
  call to IAM, whether it succeeded or carries an errorCode.
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName:
      - DeleteUser
      - DeleteRole
  condition: selection
level: low
---
title: Many IAM Users or Roles Deleted by One Principal
id: 1c184d80-83fb-453a-b5cc-143fc093a1d0
status: experimental
description: >-
  Counts, per calling principal (userIdentity.arn), the DeleteUser and
  DeleteRole calls it made. Five or more within 15 minutes is the pattern of
  identities being removed in bulk: administrators and emergency identities
  taken away to lock the owners out, or the users and roles an attacker
  created being deleted to remove the trace, which the Threat Technique
  Catalog for AWS describes. Denied calls are counted as well. The count and
  the window are starting points to tune. For role sessions the principal is
  the session ARN, so one role used with different session names is counted
  per session.
references:
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
  - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html
  - https://aws-samples.github.io/threat-technique-catalog-for-aws/Techniques/T1070.A001.html
  - https://attack.mitre.org/techniques/T1531/
author: Forestall
date: 2026-11-18
tags:
  - attack.impact
  - attack.t1531
correlation:
  type: event_count
  rules:
    - aws_iam_user_or_role_deleted
  group-by:
    - userIdentity.arn
  timespan: 15m
  condition:
    gte: 5
falsepositives:
  - Infrastructure-as-code pipelines that tear down a stack or an environment and delete its roles in one run. Exclude the deployment roles.
  - Offboarding of several people at once and clean-up of unused identities by the identity team. Confirm the change record.
  - The values of 5 deletions and 15 minutes are starting points, not tested limits. Measure what your own pipelines produce and adjust both.
level: medium

False positives

  • Infrastructure-as-code pipelines that tear down a stack or an environment and delete its roles in one run. Exclude the deployment roles.
  • Offboarding of several people at once and clean-up of unused identities by the identity team. Confirm the change record.
  • The values of 5 deletions and 15 minutes are starting points, not tested limits. Measure what your own pipelines produce and adjust both.

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.

IAM user or role created and deleted again within a short time

Detection hypothesisSequence of events

The Threat Technique Catalog for AWS describes actors that create users and roles, act through them and delete them to remove the trace. An identity whose whole life, from creation to deletion, fits into a short time and that was used in between is that pattern.

  1. A CreateUser or CreateRole event from iam.amazonaws.com. The example records AWS publishes name the new identity in requestParameters.userName and requestParameters.roleName.
  2. Within 24 hours a DeleteUser or DeleteRole event for the same name.
  3. Between the two, collect what the identity did, from the events whose userIdentity.arn is the user or a session of the role, and the access keys and policies it was given.

EventsCreateUserCreateRoleDeleteUserDeleteRole

LimitsTest deployments and pipelines that build and tear down an environment create and delete roles within minutes, so their callers have to be excluded. The 24 hours are a starting point. An identity that the attacker leaves in place does not match.

Triage

  • Compare the caller (userIdentity.arn) with requestParameters.userName. A credential removed from another user by a principal outside the identity team is the key signal.
  • Count the users that lost a password or key in the same session. Several administrators within minutes is not offboarding.
  • For UpdateAccessKey, read the request parameters for the new status; the rule also matches a key being set back to active, which is a different question (who reactivated an old key, and why).
  • Review what the caller did around the same time, such as new users or access keys, policy attachments, and deletions of data, backups or trails.
  • If the change is not approved, regain access through the emergency process or the root user, deactivate the credentials of the caller and restore the affected users.

Response

Once the attack is confirmed:

  1. Use an access path that does not depend on the deleted credentials: the emergency access account, the root user or, for a member account, the management account. From there, attach a policy that denies everything to the principal that made the calls, which also stops its existing sessions.
  2. Look for what the lockout was meant to cover before you restore everyday access, such as deleted data, backups and trails, new users, access keys and roles, and resources started at your expense.
  3. Restore the affected users. Set new console passwords, set keys that were only made inactive back to active once their owners confirm them, and issue new keys in place of deleted ones.
  4. Create deleted users again with the policies and group memberships they had, and register their MFA devices again.
  5. Afterwards, confirm that every restored administrator can sign in, and test the emergency access process again.

Mitigation

  • Restrict iam:DeleteLoginProfile, iam:DeleteAccessKey, iam:UpdateAccessKey and iam:DeleteUser on other users to identity administrators, and let everyone else manage only the credentials of their own user (Resource arn:aws:iam::*:user/${aws:username}).
  • Move people to IAM Identity Center or federation, so that few administrators depend on IAM user credentials that can be deleted inside the account.
  • Keep an emergency access process that does not depend on the same IAM users, for example a separate emergency access account with cross-account roles, and test it.
  • Secure the root user credentials and know how to use them in an emergency. In AWS Organizations with centralized root access, the management account can allow password recovery for the root user of a member account whose users are locked out.
  • Protect emergency users and roles with a service control policy that denies changes to them by any other principal.

Frequently asked questions

How do I tell a lockout from routine key rotation or offboarding?

A single event proves nothing, because rotation, offboarding and the containment of a compromised user produce the same calls. Look at who made the call, how many users lost a password or key within a short time, and whether privileged or emergency users are among them. Several administrators within minutes, by a principal outside the identity team, is not housekeeping.

Does the access key rule show whether a key was switched off or back on?

No. It matches `DeleteAccessKey` and `UpdateAccessKey` without reading the new status, so a key set to inactive and a key set back to active look the same to the rule. Read the request parameters. A reactivated old key raises a different question, namely who brought it back and why.

Are people who sign in through IAM Identity Center affected by these calls?

No. Identities that federate through IAM Identity Center or an identity provider do not depend on IAM user passwords and access keys, so deleting those credentials does not lock them out. The exposure is in accounts where people still sign in as IAM users, and in emergency users.

What can I do if every administrator of the account has lost access?

Recovery falls back to the root user of the account. In a member account without root credentials it falls back to the management account of the organization, which with centralized root access can allow password recovery for the root user of that member account. Make sure this path is known and tested before it is needed.

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.