Unusual Source IP for a User to Logon from

A machine learning job detected a user logging in from an IP address that is unusual for the user. This can be due to credentialed access via a compromised account when the user and the threat actor are in different locations. An unusual source IP address for a username could also be due to lateral movement when a compromised account is used to pivot between hosts.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/06/10"
  3integration = ["auditd_manager", "endpoint", "system"]
  4maturity = "production"
  5updated_date = "2024/06/18"
  6
  7[rule]
  8anomaly_threshold = 75
  9author = ["Elastic"]
 10description = """
 11A machine learning job detected a user logging in from an IP address that is unusual for the user. This can be due to
 12credentialed access via a compromised account when the user and the threat actor are in different locations. An unusual
 13source IP address for a username could also be due to lateral movement when a compromised account is used to pivot
 14between hosts.
 15"""
 16false_positives = ["Business travelers who roam to new locations may trigger this alert."]
 17from = "now-30m"
 18interval = "15m"
 19license = "Elastic License v2"
 20machine_learning_job_id = "auth_rare_source_ip_for_a_user"
 21name = "Unusual Source IP for a User to Logon from"
 22setup = """## Setup
 23
 24This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
 25- Elastic Defend
 26- Auditd Manager
 27- System
 28
 29### Anomaly Detection Setup
 30
 31Once the rule is enabled, the associated Machine Learning job will start automatically. You can view the Machine Learning job linked under the "Definition" panel of the detection rule. If the job does not start due to an error, the issue must be resolved for the job to commence successfully. For more details on setting up anomaly detection jobs, refer to the [helper guide](https://www.elastic.co/guide/en/kibana/current/xpack-ml-anomalies.html).
 32
 33### Elastic Defend Integration Setup
 34Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
 35
 36#### Prerequisite Requirements:
 37- Fleet is required for Elastic Defend.
 38- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 39
 40#### The following steps should be executed in order to add the Elastic Defend integration to your system:
 41- Go to the Kibana home page and click "Add integrations".
 42- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 43- Click "Add Elastic Defend".
 44- Configure the integration name and optionally add a description.
 45- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 46- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
 47- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 48- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
 49For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
 50- Click "Save and Continue".
 51- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
 52For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 53
 54### Auditd Manager Integration Setup
 55The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
 56Auditd Manager provides a user-friendly interface and automation capabilities for configuring and monitoring system auditing through the auditd daemon. With `auditd_manager`, administrators can easily define audit rules, track system events, and generate comprehensive audit reports, improving overall security and compliance in the system.
 57
 58#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
 59- Go to the Kibana home page and click “Add integrations”.
 60- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
 61- Click “Add Auditd Manager”.
 62- Configure the integration name and optionally add a description.
 63- Review optional and advanced settings accordingly.
 64- Add the newly installed “auditd manager” to an existing or a new agent policy, and deploy the agent on a Linux system from which auditd log files are desirable.
 65- Click “Save and Continue”.
 66- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
 67
 68#### Rule Specific Setup Note
 69Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
 70However, if more advanced configuration is required to detect specific behavior, audit rules can be added to the integration in either the "audit rules" configuration box or the "auditd rule files" box by specifying a file to read the audit rules from.
 71- For this detection rule no additional audit rules are required.
 72
 73### System Integration Setup
 74The System integration allows you to collect system logs and metrics from your servers with Elastic Agent.
 75
 76#### The following steps should be executed in order to add the Elastic Agent System integration "system" to your system:
 77- Go to the Kibana home page and click “Add integrations”.
 78- In the query bar, search for “System” and select the integration to see more details about it.
 79- Click “Add System”.
 80- Configure the integration name and optionally add a description.
 81- Review optional and advanced settings accordingly.
 82- Add the newly installed “system” to an existing or a new agent policy, and deploy the agent on your system from which system log files are desirable.
 83- Click “Save and Continue”.
 84- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/system).
 85"""
 86references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
 87risk_score = 21
 88rule_id = "d4b73fa0-9d43-465e-b8bf-50230da6718b"
 89severity = "low"
 90tags = [
 91    "Use Case: Identity and Access Audit",
 92    "Use Case: Threat Detection",
 93    "Rule Type: ML",
 94    "Rule Type: Machine Learning",
 95    "Tactic: Initial Access",
 96]
 97type = "machine_learning"
 98[[rule.threat]]
 99framework = "MITRE ATT&CK"
100[[rule.threat.technique]]
101id = "T1078"
102name = "Valid Accounts"
103reference = "https://attack.mitre.org/techniques/T1078/"
104
105
106[rule.threat.tactic]
107id = "TA0001"
108name = "Initial Access"
109reference = "https://attack.mitre.org/tactics/TA0001/"

References

Related rules

to-top