AWS EC2 Instance Console Login via Assumed Role

Last updated 2 months ago on 2025-11-05
Created a year ago on 2024-07-24

About

Detects successful AWS Management Console or federation login activity performed using an EC2 instance’s assumed role credentials. EC2 instances typically use temporary credentials to make API calls, not to authenticate interactively via the console. A successful "ConsoleLogin" or "GetSigninToken" event using a session pattern that includes "i-" (the EC2 instance ID) is highly anomalous and may indicate that an adversary obtained the instance’s temporary credentials from the instance metadata service (IMDS) and used them to access the console. Such activity can enable lateral movement, privilege escalation, or persistence within the AWS account.
Tags
Domain: CloudData Source: AWSData Source: Amazon Web ServicesData Source: AWS EC2Data Source: AWS STSData Source: AWS Sign-InUse Case: Identity and Access AuditTactic: Lateral MovementTactic: Credential AccessTactic: PersistenceLanguage: eql
Severity
high
Risk Score
73
MITRE ATT&CK™

Lateral Movement (TA0008)(external, opens in a new tab or window)

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

Credential Access (TA0006)(external, opens in a new tab or window)

False Positive Examples
This is very uncommon behavior and should result in minimal false positives, ensure validity of the triggered event and include exceptions where necessary.
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:
info where event.dataset == "aws.cloudtrail" and event.provider == "signin.amazonaws.com" and event.action in ("ConsoleLogin", "GetSigninToken") and event.outcome == "success" and aws.cloudtrail.user_identity.type == "AssumedRole" and stringContains (user.id, ":i-")

Install detection rules in Elastic Security

Detect AWS EC2 Instance Console Login via Assumed Role 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).