AWS Management Console Root Login

Identifies a successful login to the AWS Management Console by the Root user.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/06/11"
  3integration = ["aws"]
  4maturity = "production"
  5updated_date = "2024/05/21"
  6
  7[rule]
  8author = ["Elastic"]
  9description = "Identifies a successful login to the AWS Management Console by the Root user."
 10false_positives = [
 11    """
 12    It's strongly recommended that the root user is not used for everyday tasks, including the administrative ones.
 13    Verify whether the IP address, location, and/or hostname should be logging in as root in your environment.
 14    Unfamiliar root logins should be investigated immediately. If known behavior is causing false positives, it can be
 15    exempted from the rule.
 16    """,
 17]
 18from = "now-60m"
 19index = ["filebeat-*", "logs-aws.cloudtrail-*"]
 20interval = "10m"
 21language = "kuery"
 22license = "Elastic License v2"
 23name = "AWS Management Console Root Login"
 24note = """## Triage and analysis
 25
 26### Investigating AWS Management Console Root Login
 27
 28The 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. AWS 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).
 29
 30This rule looks for attempts to log in to the AWS Management Console as the root user.
 31
 32#### Possible investigation steps
 33
 34- Investigate other alerts associated with the user account during the past 48 hours.
 35- Examine whether this activity is common in the environment by looking for past occurrences on your logs.
 36- Consider the source IP address and geolocation for the calling user who issued the command. Do they look normal for the calling user?
 37- Examine the commands, API calls, and data management actions performed by the account in the last 24 hours.
 38- Contact the account owner and confirm whether they are aware of this activity.
 39- If you suspect the account has been compromised, scope potentially compromised assets by tracking access to servers,
 40services, and data accessed by the account in the last 24 hours.
 41
 42### False positive analysis
 43
 44- The alert can be dismissed if this operation is done under change management and approved according to the organization's policy for performing a task that needs this privilege level.
 45
 46### Response and remediation
 47
 48- Initiate the incident response process based on the outcome of the triage.
 49- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
 50    - Identify the account role in the cloud environment.
 51    - Identify the services or servers involved criticality.
 52    - Work with your IT team to identify and minimize the impact on users.
 53    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
 54    - Identify if there are any regulatory or legal ramifications related to this activity.
 55- Configure multi-factor authentication for the user.
 56- Follow security best practices [outlined](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/) by AWS.
 57- 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).
 58
 59## Setup
 60
 61The AWS Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
 62references = ["https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html"]
 63risk_score = 47
 64rule_id = "e2a67480-3b79-403d-96e3-fdd2992c50ef"
 65severity = "medium"
 66tags = [
 67    "Domain: Cloud",
 68    "Data Source: AWS",
 69    "Data Source: Amazon Web Services",
 70    "Data Source: AWS Signin",
 71    "Use Case: Identity and Access Audit",
 72    "Resources: Investigation Guide",
 73    "Tactic: Initial Access",
 74]
 75timestamp_override = "event.ingested"
 76type = "query"
 77
 78query = '''
 79event.dataset:aws.cloudtrail and event.provider:signin.amazonaws.com and event.action:ConsoleLogin and aws.cloudtrail.user_identity.type:Root and event.outcome:success
 80'''
 81
 82
 83[[rule.threat]]
 84framework = "MITRE ATT&CK"
 85[[rule.threat.technique]]
 86id = "T1078"
 87name = "Valid Accounts"
 88reference = "https://attack.mitre.org/techniques/T1078/"
 89
 90
 91[rule.threat.tactic]
 92id = "TA0001"
 93name = "Initial Access"
 94reference = "https://attack.mitre.org/tactics/TA0001/"
 95[[rule.threat]]
 96framework = "MITRE ATT&CK"
 97[[rule.threat.technique]]
 98id = "T1078"
 99name = "Valid Accounts"
100reference = "https://attack.mitre.org/techniques/T1078/"
101
102
103[rule.threat.tactic]
104id = "TA0003"
105name = "Persistence"
106reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating AWS Management Console Root Login

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. AWS provides a list of the tasks that require root user.

This rule looks for attempts to log in to the AWS Management Console as the root user.

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

  • The alert can be dismissed if this operation is done under change management and approved according to the organization's policy for performing a task that needs this privilege level.

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