1. Resources
  2. Detection rules
  3. MFA Device Registered for an IAM User or the Root User

MFA Device Registered for an IAM User or the Root User detection rules

An attacker who has a session or IAM write access registers an MFA device of their own for an IAM user or the root user, so that they hold a valid second factor and the identity still looks protected.

Platform
AWS
Severity
Medium
Log source
AWS CloudTrail
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
A console session of the user or the root user, or permission to call iam:CreateVirtualMFADevice and iam:EnableMFADevice for the target user, plus the identity's password.
Impact
The attacker holds a second factor that IAM accepts for the identity, which makes the takeover of an administrator or the root user durable.
Response
Deactivate the device that the owner does not hold, then reset the console password of the identity and revoke its active console sessions.
Mitigation
Restrict creating and enabling MFA devices for other users to identity administrators, and register MFA for every console user and the root user.
CloudTrail events
EnableMFADeviceCreateVirtualMFADevice
Threat groups
APT29

How the attack works

IAM users and the root user can each register up to eight MFA devices of any type, and one device is enough to sign in. CreateVirtualMFADevice creates a virtual device (an authenticator app) in the account, and EnableMFADevice enables a device and associates it with a user. From then on IAM accepts the codes of that device as the second factor of the identity.

An attacker who reaches a console session, or a principal allowed to call these actions for other users, can register a device they hold. Because up to eight devices can exist side by side, the owner's device keeps working and nothing breaks, while the attacker can now complete sign-ins and obtain MFA-authenticated sessions that satisfy policies requiring MFA. Registering a device on an identity that had none also makes a taken-over identity look protected. CloudTrail records both calls under iam.amazonaws.com, with the caller in userIdentity, the device in requestParameters.serialNumber and the user in requestParameters.userName. A registration for the root user carries userIdentity.type Root.

What an attacker needs

  • A console session of the IAM user or the root user, or credentials for a principal allowed to call iam:CreateVirtualMFADevice and iam:EnableMFADevice for the target user.
  • To use the device at sign-in, the identity's password or the right to reset it.

Impact

The attacker holds a second factor that IAM accepts for the identity. With the password they complete console sign-ins, and with the identity's access keys they can request MFA-authenticated sessions. For an administrator or the root user this makes a takeover durable, and it stays unnoticed for as long as nobody reviews the list of registered devices.

Detection rules

MFA Device Enabled for an IAM Identity

Detects EnableMFADevice calls, which enable an MFA device and associate it with an IAM user or the root user. From that call on, IAM accepts the device as a second factor of the identity. Triage by comparing the caller (userIdentity.arn) with requestParameters.userName, by checking whether the identity already had a device, and by confirming the registration with the owner. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: MFA Device Enabled for an IAM Identity
id: 0d92ba70-58be-42db-bd3c-849e1927a4fb
status: experimental
description: >-
  Detects EnableMFADevice calls, which enable an MFA device and associate it
  with an IAM user or the root user. From that call on, IAM accepts the device
  as a second factor of the identity. Triage by comparing the caller
  (userIdentity.arn) with requestParameters.userName, by checking whether the
  identity already had a device, and by confirming the registration with the
  owner.
  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_EnableMFADevice.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html
  - https://attack.mitre.org/techniques/T1098/005/
author: Forestall
date: 2026-11-16
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.005
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: EnableMFADevice
  condition: selection
falsepositives:
  - Onboarding, users who replace a lost or old device, and MFA enrollment by the identity team. Expect the owner to confirm the registration; limit the rule to privileged users if the volume is high.
level: low

False positives

  • Onboarding, users who replace a lost or old device, and MFA enrollment by the identity team. Expect the owner to confirm the registration; limit the rule to privileged users if the volume is high.

MFA Device Enabled for the Root User

Detects EnableMFADevice calls made as the account root user (userIdentity.type Root), which register an MFA device for the root user. AWS shows this event in its console sign-in event reference under "Root user, MFA changed". The root user can hold up to eight devices, so a new one does not replace the device the owners already use. Outside the first setup of an account or a planned device replacement, confirm with the account owners who registered it. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelMediumStatusExperimentalLog sourceAWS CloudTrail
title: MFA Device Enabled for the Root User
id: 0bcc7a75-3c51-4f9b-90dc-317dd6b2102a
status: experimental
description: >-
  Detects EnableMFADevice calls made as the account root user
  (userIdentity.type Root), which register an MFA device for the root user.
  AWS shows this event in its console sign-in event reference under "Root
  user, MFA changed". The root user can hold up to eight devices, so a new one
  does not replace the device the owners already use. Outside the first setup
  of an account or a planned device replacement, confirm with the account
  owners who registered it.
  It also matches attempts that failed (errorCode present): check errorCode,
  because an unauthorized attempt is worth seeing.
references:
  - https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-aws-console-sign-in-events.html
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_EnableMFADevice.html
  - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html
author: Forestall
date: 2026-11-16
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.005
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: EnableMFADevice
    userIdentity.type: Root
  condition: selection
falsepositives:
  - First setup of a new account and planned replacement of the root MFA device by the account owners; confirm the change record and that the owners hold every registered device.
level: medium

False positives

  • First setup of a new account and planned replacement of the root MFA device by the account owners; confirm the change record and that the owners hold every registered device.

Virtual MFA Device Created

Detects CreateVirtualMFADevice calls, which create a new virtual MFA device in the account. The device protects nothing until EnableMFADevice associates it with a user, so this event is the first of the two steps of a virtual device registration and names the caller who started it. Use it together with the rules on EnableMFADevice, and look for a device that was created by one principal and enabled for another. It also matches attempts that failed (errorCode present): check errorCode, because an unauthorized attempt is worth seeing.

LevelLowStatusExperimentalLog sourceAWS CloudTrail
title: Virtual MFA Device Created
id: cd61125a-19d9-4f88-96b5-406c4ef25eba
status: experimental
description: >-
  Detects CreateVirtualMFADevice calls, which create a new virtual MFA device
  in the account. The device protects nothing until EnableMFADevice associates
  it with a user, so this event is the first of the two steps of a virtual
  device registration and names the caller who started it. Use it together
  with the rules on EnableMFADevice, and look for a device that was created
  by one principal and enabled for another.
  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_CreateVirtualMFADevice.html
  - https://docs.aws.amazon.com/IAM/latest/APIReference/API_EnableMFADevice.html
author: Forestall
date: 2026-11-16
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.005
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventSource: iam.amazonaws.com
    eventName: CreateVirtualMFADevice
  condition: selection
falsepositives:
  - Every legitimate enrollment of an authenticator app, including enrollments that a user starts in the console and does not finish. Useful mainly as context for the rules on EnableMFADevice.
level: low

False positives

  • Every legitimate enrollment of an authenticator app, including enrollments that a user starts in the console and does not finish. Useful mainly as context for the rules on EnableMFADevice.

Triage

  • Compare the caller (userIdentity.arn) with requestParameters.userName. A device registered for someone else's user, or for the root user, is the key signal.
  • Check whether the identity already had a device. A second device on a protected identity is unusual, and a first device registered right after a sign-in from a new address deserves the same attention.
  • Look at the session that made the call, with its source address, its user agent and the ConsoleLogin event before it.
  • Look for DeactivateMFADevice, UpdateLoginProfile or CreateAccessKey for the same user around the same time.
  • Confirm with the owner, through a channel other than the account itself, whether they registered the device.

Response

Once the attack is confirmed:

  1. Deactivate the device that the owner does not hold, and delete it if it is a virtual device.
  2. Reset the console password of the identity, revoke its active console sessions and deactivate access keys that were created around the change.
  3. Register a new device together with the owner if the owner's device was removed, after you have verified the owner through a channel other than the account itself.
  4. Contain the principal that registered the device by deactivating its access keys or revoking its role sessions, and review what it and the affected identity did afterwards.
  5. If the root user was affected, change its password, check its access keys and the contact details of the account, and confirm that every remaining root MFA device is held by the owners.

Mitigation

  • Restrict iam:CreateVirtualMFADevice and iam:EnableMFADevice on other users to identity administrators, and let users manage only their own device.
  • Register MFA for the root user and for every IAM user with a console password, so that no identity is left for someone else to enroll first.
  • Move people to IAM Identity Center or federation, so that few IAM users have a password and MFA devices 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.
  • Review the MFA devices of privileged users and of the root user on a schedule, and confirm each device with its owner.

Frequently asked questions

Why is a new MFA device a risk when MFA is meant to protect the identity?

MFA proves that the person signing in holds a registered device. It does not prove who registered the device. A device that an attacker registers is as valid as the owner's, so the attacker passes every MFA check with it. The identity shows MFA as enabled the whole time, which is why a registration that nobody ordered is the thing to look for.

Does the owner notice when a second device is added?

Usually not. AWS allows up to eight MFA devices for the root user and for each IAM user, and one device is enough to sign in. The owner's device keeps working after another one is added, so nothing fails for the owner. The added device shows only in the list of devices of the identity and in the CloudTrail event.

Which events show the registration of a device?

A virtual device produces two calls. CreateVirtualMFADevice creates the device in the account, and EnableMFADevice enables it and associates it with the user. CreateVirtualMFADevice applies to virtual devices only. EnableMFADevice is the call that gives the identity a new second factor, so the rules on that call matter most.

What is the usual harmless cause of these alerts?

Onboarding, users who replace a phone, and administrators who enroll MFA for an account. In the harmless case the owner confirms the registration and the session that made the call is the owner's usual one. A device registered by another principal, from a new address, or shortly before a password reset or a new access key does not fit that pattern.

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.