AWS IAM Virtual MFA Device Registration Attempt with Session Token

Last updated 7 days ago on 2026-02-25
Created a year ago on 2025-04-11

About

Detects attempts to create or enable a Virtual MFA device (CreateVirtualMFADevice, EnableMFADevice) using temporary AWS credentials (access keys beginning with ASIA). Session credentials are short-lived and tied to existing authenticated sessions, so using them to register or enable MFA devices is unusual. Adversaries who compromise temporary credentials may abuse this behavior to establish persistence by attaching new MFA devices to maintain access to high-privilege accounts despite key rotation or password resets.
Tags
Domain: CloudData Source: AWSData Source: Amazon Web ServicesData Source: AWS CloudTrailData Source: AWS IAMTactic: PersistenceUse Case: Identity and Access AuditLanguage: eql
Severity
medium
Risk Score
47
MITRE ATT&CK™

Persistence (TA0003)(external, opens in a new tab or window)

False Positive Examples
Some legitimate administrative workflows or CI/CD automation pipelines may temporarily configure or re-enable MFA devices using session-based credentials. Validate the calling identity’s purpose, source IP, and user agent to confirm whether this activity was authorized. This rule automatically excludes console login sessions, which filters out expected MFA operations performed via the AWS Management Console.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-aws.cloudtrail-*
Related Integrations

aws(external, opens in a new tab or window)

Query
text code block:
iam where event.dataset == "aws.cloudtrail" and event.provider == "iam.amazonaws.com" and event.outcome == "success" and event.action in ("CreateVirtualMFADevice", "EnableMFADevice") and startsWith (aws.cloudtrail.user_identity.access_key_id, "ASIA") and not aws.cloudtrail.session_credential_from_console == "true"

Install detection rules in Elastic Security

Detect AWS IAM Virtual MFA Device Registration Attempt with Session Token in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).