How the attack works
IAM users and the root user can each have up to eight MFA devices: passkeys and security keys, authenticator apps (virtual devices) and hardware tokens. DeactivateMFADevice removes a device from the identity it protects; DeleteVirtualMFADevice then deletes a virtual device, which IAM allows only after the device has been deactivated. A principal allowed to call iam:DeactivateMFADevice on other users can take the second factor away from any of them.
Attackers do this after they gain IAM write access or a console session. With the device gone, a password they know or set with UpdateLoginProfile is enough to sign in as the user, and they can register their own device (EnableMFADevice) so that the identity still looks protected and still satisfies policies that require MFA. CloudTrail records the call under iam.amazonaws.com with the caller in userIdentity and the device in requestParameters.serialNumber; requestParameters.userName names the user, and when it is absent the call applies to the caller. A third rule reads DeleteVirtualMFADevice, the separate call that deletes a virtual device once it has been deactivated.
What an attacker needs
- Credentials for a principal allowed to call iam:DeactivateMFADevice on the target user, or a session of the user or the root user itself.
- To benefit from it, the identity's password, or the right to reset it.
Impact
The identity signs in with a password alone, or with a device the attacker holds. For an administrator or the root user this turns one stolen password into full account control, and an attacker-registered device makes the takeover durable.
Detection rules
MFA Device Deactivated for an IAM Identity
Detects DeactivateMFADevice calls, which remove an MFA device from an IAM user or the root user. Triage by comparing the caller (userIdentity.arn) with requestParameters.userName and by looking for a new device, a password reset or a sign-in without MFA for the same identity afterwards. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: MFA Device Deactivated for an IAM Identity
id: ed0c1e5f-9680-452f-8c0a-a4603b6ed58e
status: experimental
description: >-
Detects DeactivateMFADevice calls, which remove an MFA device from an IAM
user or the root user. Triage by comparing the caller (userIdentity.arn)
with requestParameters.userName and by looking for a new device, a password
reset or a sign-in without MFA for the same identity afterwards.
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_DeactivateMFADevice.html
- https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-11
tags:
- attack.defense-impairment
- attack.persistence
- attack.t1556.006
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: iam.amazonaws.com
eventName: DeactivateMFADevice
condition: selection
falsepositives:
- Users replacing a lost or old device, and offboarding by the identity team; confirm with the device owner and expect a new device to be registered by the same person.
level: medium
False positives
- Users replacing a lost or old device, and offboarding by the identity team; confirm with the device owner and expect a new device to be registered by the same person.
Root User MFA Device Deactivated
Detects DeactivateMFADevice calls made as the account root user (userIdentity.type Root), which remove an MFA device from the root user. Unless the organization is deleting member root credentials through centralized root access, this should be rare and planned. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: Root User MFA Device Deactivated
id: ed39f5df-7b43-458e-91e5-4433c013e630
status: experimental
description: >-
Detects DeactivateMFADevice calls made as the account root user
(userIdentity.type Root), which remove an MFA device from the root user.
Unless the organization is deleting member root credentials through
centralized root access, this should be rare and planned.
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_DeactivateMFADevice.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-track-privileged-tasks.html
- https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-11
tags:
- attack.defense-impairment
- attack.persistence
- attack.t1556.006
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: iam.amazonaws.com
eventName: DeactivateMFADevice
userIdentity.type: Root
condition: selection
falsepositives:
- Planned replacement of the root MFA device, and 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: high
False positives
- Planned replacement of the root MFA device, and 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.
Virtual MFA Device Deleted
Detects DeleteVirtualMFADevice calls, which delete a virtual MFA device from the account. IAM requires a user's virtual device to be deactivated before it can be deleted, so for a device that was in use this event follows a DeactivateMFADevice call and completes the removal. The event carries the device in requestParameters.serialNumber and no user name: match the serial number to the earlier deactivation to see whose device it was. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.
title: Virtual MFA Device Deleted
id: 7822f982-235c-4477-a8b5-0db4d4ea747d
status: experimental
description: >-
Detects DeleteVirtualMFADevice calls, which delete a virtual MFA device from
the account. IAM requires a user's virtual device to be deactivated before
it can be deleted, so for a device that was in use this event follows a
DeactivateMFADevice call and completes the removal. The event carries the
device in requestParameters.serialNumber and no user name: match the serial
number to the earlier deactivation to see whose device it was.
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_DeleteVirtualMFADevice.html
- https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeactivateMFADevice.html
- https://attack.mitre.org/techniques/T1556/006/
author: Forestall
date: 2026-11-16
tags:
- attack.defense-impairment
- attack.persistence
- attack.t1556.006
logsource:
product: aws
service: cloudtrail
detection:
selection:
eventSource: iam.amazonaws.com
eventName: DeleteVirtualMFADevice
condition: selection
falsepositives:
- Users and administrators who replace an authenticator app, offboarding, and cleanup of virtual devices that were created and never enabled; confirm with the device owner.
level: low
False positives
- Users and administrators who replace an authenticator app, offboarding, and cleanup of virtual devices that were created and never enabled; confirm with the device owner.
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.
MFA device removed, then a sign-in without MFA or a new device for the same identity
Removing a device is only useful to an attacker when something follows it: a console sign-in with the password alone, or a device of their own registered in its place. Both leave events for the same identity within a short time, and both are rarer than the removal itself.
- A
DeactivateMFADeviceevent fromiam.amazonaws.com. Note the identity inrequestParameters.userName, the device inrequestParameters.serialNumber, the caller inuserIdentity.arnand thesourceIPAddress. - Within 24 hours, a
ConsoleLoginevent fromsignin.amazonaws.comfor the same identity withresponseElements.ConsoleLoginSuccess andadditionalEventData.MFAUsedNo. For an IAM user matchuserIdentity.userName, for the root useruserIdentity.typeRoot in the same account. - Or, in the same window, an
EnableMFADeviceevent for the same identity whoserequestParameters.serialNumberdiffers from the removed device. - Raise the priority when the caller of the removal is not the identity itself, or when the sign-in or the new device comes from an address the identity did not use before.
EventsDeactivateMFADeviceConsoleLoginEnableMFADevice
LimitsA user who replaces a lost device produces the same sequence, usually from the usual address and with the owner's confirmation. The root user carries no user name when the account has no alias, so match it by type and account. Sign-ins through IAM Identity Center or another identity provider are not IAM user ConsoleLogin events. The 24 hour window is a starting point.
Triage
- Compare the caller (userIdentity.arn) with requestParameters.userName; a device removed from someone else's user, or from the root user, is the key signal.
- Look for EnableMFADevice with a different serial number, UpdateLoginProfile or CreateAccessKey for the same user, and a ConsoleLogin with MFAUsed No shortly after.
- Confirm with the device owner whether the device was lost or replaced. If not, reset the password, register MFA again with the owner and review the caller's activity.
Response
Once the attack is confirmed:
- Lock the identity before you restore anything. Reset its console password, revoke its active console sessions and deactivate access keys that were created around the change.
- Deactivate every MFA device that was registered for the identity after the removal and that its owner does not hold.
- Register a new device together with the owner, after you have verified the owner through a channel other than the account itself.
- Contain the principal that removed the device by deactivating its access keys or revoking its role sessions, and review what it and the affected identity did afterwards.
- If the root user was affected, also check its access keys and the contact details of the account, and confirm that the next root sign-in shows MFA.
Mitigation
- Restrict iam:DeactivateMFADevice and iam:DeleteVirtualMFADevice on other users to identity administrators, and let users manage only their own device from an MFA-authenticated session.
- Move people to IAM Identity Center or federation, so that few IAM users have a password and MFA device to tamper with.
- In AWS Organizations, centralize root access and delete member account root credentials, and keep the management account's root user on phishing-resistant MFA.
Frequently asked questions
Does the rule also see a new device being registered in place of the old one?
No. The rules on this page match the removal of a device (`DeactivateMFADevice`, and `DeleteVirtualMFADevice` for a virtual device). A device that the attacker registers appears as `EnableMFADevice` with a different serial number, which a separate page of this library covers. An identity that still shows an MFA device after the alert is therefore no proof that nothing happened.
What does the rule for the deletion of a virtual MFA device add?
Little on its own. IAM allows `DeleteVirtualMFADevice` only after the device has been deactivated, so the deactivation always comes first, and it is the step that takes the second factor away. The deletion rule is low level. It completes the picture, and it shows an attempt that failed, which the deactivation rules for IAM users and the root user do not.
What is the usual harmless cause of this alert?
Users who replace a lost or old device, and offboarding by the identity team. In the harmless case the owner confirms it and the same person registers a new device shortly after. A device removed by someone else, followed by a password reset, a new access key or a sign-in without MFA, does not fit that pattern.
References
- MITRE ATT&CK T1556.006: Modify Authentication Process: Multi-Factor Authentication
- IAM API Reference: DeactivateMFADevice
- AWS multi-factor authentication in IAM
- AWS: Allows MFA-authenticated IAM users to manage their own MFA device
- AWS Management Console sign-in events
- Revoke IAM role temporary security credentials
- Manage passwords for IAM users (revoke active console sessions)
- IAM API Reference: EnableMFADevice
- CloudTrail userIdentity element