AWS Root Login Without MFA

Identifies attempts to login to AWS as the root user without using multi-factor authentication (MFA). Amazon AWS best practices indicate that the root user should be protected by MFA.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/07/06"
  3integration = ["aws"]
  4maturity = "production"
  5min_stack_comments = "AWS integration breaking changes, bumping version to ^2.0.0"
  6min_stack_version = "8.9.0"
  7updated_date = "2024/04/14"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies attempts to login to AWS as the root user without using multi-factor authentication (MFA). Amazon AWS best
 13practices indicate that the root user should be protected by MFA.
 14"""
 15false_positives = [
 16    """
 17    Some organizations allow login with the root user without MFA, however, this is not considered best practice by AWS
 18    and increases the risk of compromised credentials.
 19    """,
 20]
 21from = "now-60m"
 22index = ["filebeat-*", "logs-aws.cloudtrail-*"]
 23interval = "10m"
 24language = "kuery"
 25license = "Elastic License v2"
 26name = "AWS Root Login Without MFA"
 27note = """## Triage and analysis
 28
 29### Investigating AWS Root Login Without MFA
 30
 31Multi-factor authentication (MFA) in AWS is a simple best practice that adds an extra layer of protection on top of your user name and password. With MFA enabled, when a user signs in to an AWS Management Console, they will be prompted for their user name and password, as well as for an authentication code from their AWS MFA device. Taken together, these multiple factors provide increased security for your AWS account settings and resources.
 32
 33For more information about using MFA in AWS, access the [official documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.html).
 34
 35The AWS root account is the one identity that has complete access to all AWS services and resources in the account, which is created when the AWS account is created. AWS strongly recommends that you do not use the root user for your everyday tasks, even the administrative ones. Instead, adhere to the best practice of using the root user only to create your first IAM user. Then securely lock away the root user credentials and use them to perform only a few account and service management tasks. Amazon provides a [list of the tasks that require root user](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html#aws_tasks-that-require-root).
 36
 37This rule looks for attempts to log in to AWS as the root user without using multi-factor authentication (MFA), meaning the account is not secured properly.
 38
 39#### Possible investigation steps
 40
 41- Investigate other alerts associated with the user account during the past 48 hours.
 42- Examine whether this activity is common in the environment by looking for past occurrences on your logs.
 43- Consider the source IP address and geolocation for the calling user who issued the command. Do they look normal for the calling user?
 44- Examine the commands, API calls, and data management actions performed by the account in the last 24 hours.
 45- Contact the account owner and confirm whether they are aware of this activity.
 46- If you suspect the account has been compromised, scope potentially compromised assets by tracking access to servers,
 47services, and data accessed by the account in the last 24 hours.
 48
 49### False positive analysis
 50
 51- While this activity is not inherently malicious, the root account must use MFA. The security team should address any potential benign true positive (B-TP), as this configuration can risk the entire cloud environment.
 52
 53### Response and remediation
 54
 55- Initiate the incident response process based on the outcome of the triage.
 56- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 57    - Identify the account role in the cloud environment.
 58    - Identify the services or servers involved criticality.
 59    - Work with your IT team to identify and minimize the impact on users.
 60    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 61    - Identify if there are any regulatory or legal ramifications related to this activity.
 62- Configure multi-factor authentication for the user.
 63- Follow security best practices [outlined](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/) by AWS.
 64- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
 65
 66## Setup
 67
 68The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
 69references = ["https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html"]
 70risk_score = 73
 71rule_id = "bc0c6f0d-dab0-47a3-b135-0925f0a333bc"
 72severity = "high"
 73tags = [
 74    "Domain: Cloud",
 75    "Data Source: AWS",
 76    "Data Source: Amazon Web Services",
 77    "Data Source: AWS Route53",
 78    "Use Case: Identity and Access Audit",
 79    "Resources: Investigation Guide",
 80    "Tactic: Privilege Escalation"
 81]
 82timestamp_override = "event.ingested"
 83type = "query"
 84
 85query = '''
 86event.dataset:aws.cloudtrail and event.provider:signin.amazonaws.com and event.action:ConsoleLogin and
 87  aws.cloudtrail.user_identity.type:Root and
 88  aws.cloudtrail.console_login.additional_eventdata.mfa_used:false and
 89  event.outcome:success
 90'''
 91
 92
 93[[rule.threat]]
 94framework = "MITRE ATT&CK"
 95[[rule.threat.technique]]
 96id = "T1078"
 97name = "Valid Accounts"
 98reference = "https://attack.mitre.org/techniques/T1078/"
 99
100
101[rule.threat.tactic]
102id = "TA0004"
103name = "Privilege Escalation"
104reference = "https://attack.mitre.org/tactics/TA0004/"

Triage and analysis

Investigating AWS Root Login Without MFA

Multi-factor authentication (MFA) in AWS is a simple best practice that adds an extra layer of protection on top of your user name and password. With MFA enabled, when a user signs in to an AWS Management Console, they will be prompted for their user name and password, as well as for an authentication code from their AWS MFA device. Taken together, these multiple factors provide increased security for your AWS account settings and resources.

For more information about using MFA in AWS, access the official documentation.

The AWS root account is the one identity that has complete access to all AWS services and resources in the account, which is created when the AWS account is created. AWS strongly recommends that you do not use the root user for your everyday tasks, even the administrative ones. Instead, adhere to the best practice of using the root user only to create your first IAM user. Then securely lock away the root user credentials and use them to perform only a few account and service management tasks. Amazon provides a list of the tasks that require root user.

This rule looks for attempts to log in to AWS as the root user without using multi-factor authentication (MFA), meaning the account is not secured properly.

Possible investigation steps

  • Investigate other alerts associated with the user account during the past 48 hours.
  • Examine whether this activity is common in the environment by looking for past occurrences on your logs.
  • Consider the source IP address and geolocation for the calling user who issued the command. Do they look normal for the calling user?
  • Examine the commands, API calls, and data management actions performed by the account in the last 24 hours.
  • Contact the account owner and confirm whether they are aware of this activity.
  • If you suspect the account has been compromised, scope potentially compromised assets by tracking access to servers, services, and data accessed by the account in the last 24 hours.

False positive analysis

  • While this activity is not inherently malicious, the root account must use MFA. The security team should address any potential benign true positive (B-TP), as this configuration can risk the entire cloud environment.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
    • Identify the account role in the cloud environment.
    • Identify the services or servers involved criticality.
    • Work with your IT team to identify and minimize the impact on users.
    • Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
    • Identify if there are any regulatory or legal ramifications related to this activity.
  • Configure multi-factor authentication for the user.
  • Follow security best practices outlined by AWS.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

Setup

The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.

References

Related rules

to-top