AWS STS AssumeRoot by Rare User and Member Account
Identifies when the STS AssumeRoot
action is performed by a rare user in AWS. The AssumeRoot action allows users to
assume the root member account role, granting elevated but specific permissions based on the task policy specified.
Adversaries whom may have compromised user credentials, such as access and secret keys, can use this technique to
escalate privileges and gain unauthorized access to AWS resources. This is a New
Terms rule that identifies
when the STS AssumeRoot
action is performed by a user that rarely assumes this role and specific member account.
Rule type: new_terms
Rule indices:
- filebeat-*
- logs-aws.cloudtrail-*
Rule Severity: low
Risk Score: 21
Runs every:
Searches indices from: now-9m
Maximum alerts per execution: ?
References:
Tags:
- Domain: Cloud
- Data Source: AWS
- Data Source: Amazon Web Services
- Data Source: AWS STS
- Resources: Investigation Guide
- Use Case: Identity and Access Audit
- Tactic: Privilege Escalation
Version: ?
Rule authors:
- Elastic
Rule license: Elastic License v2
This rule identifies instances where AWS STS (Security Token Service) is used to assume a root role, granting temporary credentials for AWS resource access. While this action is often legitimate, it can be exploited by adversaries to obtain unauthorized access, escalate privileges, or move laterally within an AWS environment.
Identify the Actor and Assumed Role:
- User Identity: Review the
aws.cloudtrail.user_identity.arn
andaws.cloudtrail.user_identity.type
fields to determine who initiated theAssumeRoot
action. - Account Context: Check the
aws.cloudtrail.recipient_account_id
field for the account affected by the action. This is likely the management account. - Authentication: If available, review the
aws.cloudtrail.user_identity.access_key_id
to identify the access key used for the action. This key may be compromised in the case of unauthorized activity. - Resources: Inspect
aws.cloudtrail.resources.type
andaws.cloudtrail.resources.arn
to determine the resource or role assumed. This is the member account where the root role was assumed.
- User Identity: Review the
Analyze Request Parameters:
- Session Details: Check
aws.cloudtrail.flattened.request_parameters.durationSeconds
for session duration. - Permissions: Review
aws.cloudtrail.flattened.request_parameters.taskPolicyArn
for the associated policy. These policies are predefined and grant specific permissions to the assumed root account. - Target Entity: Inspect the
aws.cloudtrail.flattened.request_parameters.targetPrincipal
field for the entity being accessed. This is typically the member account. - Target Policy: Inspect the
aws.cloudtrail.flattened.request_parameters.targetPolicyArn
field for the policy applied to temporary root credentials. This can help determine the scope of the permissions granted.
- Session Details: Check
Examine Response Details:
- Credentials Issued: Review
aws.cloudtrail.flattened.response_elements.credentials
to confirm credentials were issued and note their expiration (expiration
field). The temporary access key can be used to pivot into other actions done by the assumed root account by searching for the value inaws.cloudtrail.user_identity.access_key_id
.
- Credentials Issued: Review
Inspect Source Details:
- Source IP and Location: Evaluate
source.address
andsource.geo
fields to confirm the request's origin. Unusual locations might indicate unauthorized activity. - User Agent: Analyze
user_agent.original
to determine the tool or application used (e.g., AWS CLI, SDK, or custom tooling).
- Source IP and Location: Evaluate
Correlate with Related Events:
- Concurrent Events: Look for surrounding CloudTrail events that indicate follow-up actions, such as access to sensitive resources or privilege escalation attempts.
- Historical Activity: Review historical activity for the
aws.cloudtrail.user_identity.arn
to determine if this action is anomalous.
Evaluate Privilege Escalation Risk:
- Role Privileges: Inspect the privileges granted by the assumed role or task policy (
aws.cloudtrail.flattened.request_parameters.taskPolicyArn
). - Operational Context: Confirm whether the action aligns with routine operations or is unusual.
- Role Privileges: Inspect the privileges granted by the assumed role or task policy (
- Authorized Administrative Activity:
- Verify if the activity was initiated by an AWS administrator for legitimate purposes.
- Automated Workflows:
- Identify if the action was part of an automated process or workflow.
- Revoke Unauthorized Credentials:
- If malicious activity is identified, immediately revoke the session tokens and access keys associated with the
AssumeRoot
action. - It may be worth removing the compromised access key from the affected user or service account.
- If malicious activity is identified, immediately revoke the session tokens and access keys associated with the
- Enhance Monitoring:
- Increase the monitoring frequency for sensitive roles and actions, especially
AssumeRoot
.
- Increase the monitoring frequency for sensitive roles and actions, especially
- Review IAM Policies:
- Limit permissions for accounts or roles to assume root and enforce multi-factor authentication (MFA) where applicable.
- Contain and Investigate:
- Isolate affected accounts or roles and follow incident response procedures to determine the scope and impact of the activity.
For more information on AssumeRoot, refer to the AWS STS documentation.
event.dataset: "aws.cloudtrail"
and event.provider: "sts.amazonaws.com"
and event.action: "AssumeRoot"
and event.outcome: "success"
Framework: MITRE ATT&CK
Tactic:
- Name: Privilege Escalation
- Id: TA0004
- Reference URL: https://attack.mitre.org/tactics/TA0004/
Technique:
- Name: Abuse Elevation Control Mechanism
- Id: T1548
- Reference URL: https://attack.mitre.org/techniques/T1548/
Sub Technique:
- Name: Temporary Elevated Cloud Access
- Id: T1548.005
- Reference URL: https://attack.mitre.org/techniques/T1548/005/
Framework: MITRE ATT&CK
Tactic:
- Name: Persistence
- Id: TA0003
- Reference URL: https://attack.mitre.org/tactics/TA0003/
Technique:
- Name: Account Manipulation
- Id: T1098
- Reference URL: https://attack.mitre.org/techniques/T1098/
Sub Technique:
- Name: Additional Cloud Roles
- Id: T1098.003
- Reference URL: https://attack.mitre.org/techniques/T1098/003/