Spike in Failed Logon Events

A machine learning job found an unusually large spike in authentication failure events. This can be due to password spraying, user enumeration or brute force activity and may be a precursor to account takeover or credentialed access.

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 found an unusually large spike in authentication failure events. This can be due to password
 12spraying, user enumeration or brute force activity and may be a precursor to account takeover or credentialed access.
 13"""
 14false_positives = [
 15    """
 16    A misconfigured service account can trigger this alert. A password change on an account used by an email client can
 17    trigger this alert. Security test cycles that include brute force or password spraying activities may trigger this
 18    alert.
 19    """,
 20]
 21from = "now-30m"
 22interval = "15m"
 23license = "Elastic License v2"
 24machine_learning_job_id = "auth_high_count_logon_fails"
 25name = "Spike in Failed Logon Events"
 26setup = """## Setup
 27
 28This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
 29- Elastic Defend
 30- Auditd Manager
 31- System
 32
 33### Anomaly Detection Setup
 34
 35Once 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).
 36
 37### Elastic Defend Integration Setup
 38Elastic 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.
 39
 40#### Prerequisite Requirements:
 41- Fleet is required for Elastic Defend.
 42- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 43
 44#### The following steps should be executed in order to add the Elastic Defend integration to your system:
 45- Go to the Kibana home page and click "Add integrations".
 46- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 47- Click "Add Elastic Defend".
 48- Configure the integration name and optionally add a description.
 49- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 50- 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).
 51- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 52- 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.
 53For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
 54- Click "Save and Continue".
 55- 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.
 56For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 57
 58### Auditd Manager Integration Setup
 59The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
 60Auditd 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.
 61
 62#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
 63- Go to the Kibana home page and click “Add integrations”.
 64- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
 65- Click “Add Auditd Manager”.
 66- Configure the integration name and optionally add a description.
 67- Review optional and advanced settings accordingly.
 68- 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.
 69- Click “Save and Continue”.
 70- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
 71
 72#### Rule Specific Setup Note
 73Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
 74However, 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.
 75- For this detection rule no additional audit rules are required.
 76
 77### System Integration Setup
 78The System integration allows you to collect system logs and metrics from your servers with Elastic Agent.
 79
 80#### The following steps should be executed in order to add the Elastic Agent System integration "system" to your system:
 81- Go to the Kibana home page and click “Add integrations”.
 82- In the query bar, search for “System” and select the integration to see more details about it.
 83- Click “Add System”.
 84- Configure the integration name and optionally add a description.
 85- Review optional and advanced settings accordingly.
 86- 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.
 87- Click “Save and Continue”.
 88- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/system).
 89"""
 90note = """## Triage and analysis
 91
 92### Investigating Spike in Failed Logon Events
 93
 94This rule uses a machine learning job to detect a substantial spike in failed authentication events. This could indicate attempts to enumerate users, password spraying, brute force, etc.
 95
 96#### Possible investigation steps
 97
 98- Identify the users involved and if the activity targets a specific user or a set of users.
 99- Check if the authentication comes from different sources.
100- Investigate if the host where the failed authentication events occur is exposed to the internet.
101  - If the host is exposed to the internet, and the source of these attempts is external, the activity can be related to bot activity and possibly not directed at your organization.
102  - If the host is not exposed to the internet, investigate the hosts where the authentication attempts are coming from, as this can indicate that they are compromised and the attacker is trying to move laterally.
103- Investigate other alerts associated with the involved users and hosts during the past 48 hours.
104- Check whether the involved credentials are used in automation or scheduled tasks.
105- If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
106- Investigate whether there are successful authentication events from the involved sources. This could indicate a successful brute force or password spraying attack.
107
108### False positive analysis
109
110- If the account is used in automation tasks, it is possible that they are using expired credentials, causing a spike in authentication failures.
111- Authentication failures can be related to permission issues.
112
113### Response and remediation
114
115- Initiate the incident response process based on the outcome of the triage.
116- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
117- Assess whether the asset should be exposed to the internet, and take action to reduce your attack surface.
118  - If the asset needs to be exposed to the internet, restrict access to remote login services to specific IPs.
119- 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).
120"""
121references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
122risk_score = 21
123rule_id = "99dcf974-6587-4f65-9252-d866a3fdfd9c"
124severity = "low"
125tags = [
126    "Use Case: Identity and Access Audit",
127    "Use Case: Threat Detection",
128    "Rule Type: ML",
129    "Rule Type: Machine Learning",
130    "Tactic: Credential Access",
131    "Resources: Investigation Guide",
132]
133type = "machine_learning"
134[[rule.threat]]
135framework = "MITRE ATT&CK"
136[[rule.threat.technique]]
137id = "T1110"
138name = "Brute Force"
139reference = "https://attack.mitre.org/techniques/T1110/"
140
141
142[rule.threat.tactic]
143id = "TA0006"
144name = "Credential Access"
145reference = "https://attack.mitre.org/tactics/TA0006/"

Triage and analysis

Investigating Spike in Failed Logon Events

This rule uses a machine learning job to detect a substantial spike in failed authentication events. This could indicate attempts to enumerate users, password spraying, brute force, etc.

Possible investigation steps

  • Identify the users involved and if the activity targets a specific user or a set of users.
  • Check if the authentication comes from different sources.
  • Investigate if the host where the failed authentication events occur is exposed to the internet.
    • If the host is exposed to the internet, and the source of these attempts is external, the activity can be related to bot activity and possibly not directed at your organization.
    • If the host is not exposed to the internet, investigate the hosts where the authentication attempts are coming from, as this can indicate that they are compromised and the attacker is trying to move laterally.
  • Investigate other alerts associated with the involved users and hosts during the past 48 hours.
  • Check whether the involved credentials are used in automation or scheduled tasks.
  • If this activity is suspicious, contact the account owner and confirm whether they are aware of it.
  • Investigate whether there are successful authentication events from the involved sources. This could indicate a successful brute force or password spraying attack.

False positive analysis

  • If the account is used in automation tasks, it is possible that they are using expired credentials, causing a spike in authentication failures.
  • Authentication failures can be related to permission issues.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Assess whether the asset should be exposed to the internet, and take action to reduce your attack surface.
    • If the asset needs to be exposed to the internet, restrict access to remote login services to specific IPs.
  • 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).

References

Related rules

to-top