AWS IAM Virtual MFA Device Registration Attempt with Session Token

Last updated 2 months ago on 2025-11-03
Created 9 months 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. Additionally, when a user creates or enables a Virtual MFA device through the AWS Management Console, the underlying CloudTrail event will also show a temporary credential (access key ID beginning with ASIA), because the console itself issues short-lived STS session credentials for every logged-in user. These events are expected and should not be considered suspicious.
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
filebeat-*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")

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).