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