Spike in Logon Events
A machine learning job found an unusually large spike in successful authentication events. This can be due to password spraying, user enumeration or brute force activity.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2021/06/10"
3integration = ["auditd_manager", "endpoint", "system"]
4maturity = "production"
5updated_date = "2025/01/15"
6
7[rule]
8anomaly_threshold = 75
9author = ["Elastic"]
10description = """
11A machine learning job found an unusually large spike in successful authentication events. This can be due to password
12spraying, user enumeration or brute force activity.
13"""
14false_positives = [
15 """
16 Build servers and CI systems can sometimes trigger this alert. Security test cycles that include brute force or
17 password spraying activities may trigger this alert.
18 """,
19]
20from = "now-30m"
21interval = "15m"
22license = "Elastic License v2"
23machine_learning_job_id = "auth_high_count_logon_events"
24name = "Spike in Logon Events"
25setup = """## Setup
26
27This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
28- Elastic Defend
29- Auditd Manager
30- System
31
32### Anomaly Detection Setup
33
34Once 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).
35
36### Elastic Defend Integration Setup
37Elastic 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.
38
39#### Prerequisite Requirements:
40- Fleet is required for Elastic Defend.
41- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
42
43#### The following steps should be executed in order to add the Elastic Defend integration to your system:
44- Go to the Kibana home page and click "Add integrations".
45- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
46- Click "Add Elastic Defend".
47- Configure the integration name and optionally add a description.
48- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
49- 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).
50- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
51- 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.
52For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
53- Click "Save and Continue".
54- 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.
55For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
56
57### Auditd Manager Integration Setup
58The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
59Auditd 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.
60
61#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
62- Go to the Kibana home page and click “Add integrations”.
63- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
64- Click “Add Auditd Manager”.
65- Configure the integration name and optionally add a description.
66- Review optional and advanced settings accordingly.
67- 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.
68- Click “Save and Continue”.
69- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
70
71#### Rule Specific Setup Note
72Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
73However, 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.
74- For this detection rule no additional audit rules are required.
75
76### System Integration Setup
77The System integration allows you to collect system logs and metrics from your servers with Elastic Agent.
78
79#### The following steps should be executed in order to add the Elastic Agent System integration "system" to your system:
80- Go to the Kibana home page and click “Add integrations”.
81- In the query bar, search for “System” and select the integration to see more details about it.
82- Click “Add System”.
83- Configure the integration name and optionally add a description.
84- Review optional and advanced settings accordingly.
85- 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.
86- Click “Save and Continue”.
87- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/system).
88"""
89references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
90risk_score = 21
91rule_id = "d7d5c059-c19a-4a96-8ae3-41496ef3bcf9"
92severity = "low"
93tags = [
94 "Use Case: Identity and Access Audit",
95 "Use Case: Threat Detection",
96 "Rule Type: ML",
97 "Rule Type: Machine Learning",
98 "Tactic: Credential Access",
99 "Resources: Investigation Guide",
100]
101type = "machine_learning"
102note = """## Triage and analysis
103
104> **Disclaimer**:
105> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
106
107### Investigating Spike in Logon Events
108The 'Spike in Logon Events' detection leverages machine learning to identify anomalies in authentication patterns, signaling potential threats like password spraying or brute force attacks. Adversaries exploit these methods to gain unauthorized access by overwhelming systems with login attempts. This rule detects unusual surges in successful logins, indicating possible credential access tactics, and aids in preemptive threat mitigation.
109
110### Possible investigation steps
111
112- Review the timestamp and source of the spike in logon events to determine the time frame and systems affected.
113- Analyze the user accounts involved in the spike to identify any patterns or anomalies, such as accounts with multiple logins from different locations or IP addresses.
114- Check for any recent changes in user permissions or roles that could explain the increase in logon events.
115- Investigate the IP addresses associated with the logon events to identify any known malicious sources or unusual geographic locations.
116- Correlate the logon events with other security alerts or logs, such as failed login attempts, to identify potential password spraying or brute force activities.
117- Assess whether there are any concurrent alerts or indicators of compromise that could suggest a broader attack campaign.
118
119### False positive analysis
120
121- High-volume legitimate logins from automated systems or scripts can trigger false positives. Identify and whitelist these systems to prevent unnecessary alerts.
122- Scheduled batch processes or system maintenance activities may cause spikes in logon events. Exclude these known activities by setting up exceptions based on time and source.
123- Users with roles that require frequent logins, such as IT administrators or customer support agents, might be flagged. Create user-based exceptions for these roles to reduce false positives.
124- Integration with third-party services that authenticate frequently can lead to detection triggers. Review and exclude these services from the rule to avoid misclassification.
125- Consider adjusting the sensitivity of the machine learning model if certain patterns are consistently flagged as anomalies but are verified as legitimate.
126
127### Response and remediation
128
129- Immediately isolate the affected user accounts to prevent further unauthorized access. This can be done by disabling the accounts or resetting passwords.
130- Conduct a thorough review of recent authentication logs to identify any other accounts that may have been compromised or targeted.
131- Implement multi-factor authentication (MFA) for all user accounts to add an additional layer of security against unauthorized access.
132- Notify the security operations team to monitor for any further suspicious logon activities and to ensure that the threat is contained.
133- Escalate the incident to the incident response team if there is evidence of a broader attack or if sensitive data may have been accessed.
134- Review and update access controls and permissions to ensure that users have the minimum necessary access to perform their roles.
135- Enhance monitoring and alerting mechanisms to detect similar spikes in logon events in the future, ensuring rapid response to potential threats."""
136[[rule.threat]]
137framework = "MITRE ATT&CK"
138[[rule.threat.technique]]
139id = "T1110"
140name = "Brute Force"
141reference = "https://attack.mitre.org/techniques/T1110/"
142
143
144[rule.threat.tactic]
145id = "TA0006"
146name = "Credential Access"
147reference = "https://attack.mitre.org/tactics/TA0006/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Spike in Logon Events
The 'Spike in Logon Events' detection leverages machine learning to identify anomalies in authentication patterns, signaling potential threats like password spraying or brute force attacks. Adversaries exploit these methods to gain unauthorized access by overwhelming systems with login attempts. This rule detects unusual surges in successful logins, indicating possible credential access tactics, and aids in preemptive threat mitigation.
Possible investigation steps
- Review the timestamp and source of the spike in logon events to determine the time frame and systems affected.
- Analyze the user accounts involved in the spike to identify any patterns or anomalies, such as accounts with multiple logins from different locations or IP addresses.
- Check for any recent changes in user permissions or roles that could explain the increase in logon events.
- Investigate the IP addresses associated with the logon events to identify any known malicious sources or unusual geographic locations.
- Correlate the logon events with other security alerts or logs, such as failed login attempts, to identify potential password spraying or brute force activities.
- Assess whether there are any concurrent alerts or indicators of compromise that could suggest a broader attack campaign.
False positive analysis
- High-volume legitimate logins from automated systems or scripts can trigger false positives. Identify and whitelist these systems to prevent unnecessary alerts.
- Scheduled batch processes or system maintenance activities may cause spikes in logon events. Exclude these known activities by setting up exceptions based on time and source.
- Users with roles that require frequent logins, such as IT administrators or customer support agents, might be flagged. Create user-based exceptions for these roles to reduce false positives.
- Integration with third-party services that authenticate frequently can lead to detection triggers. Review and exclude these services from the rule to avoid misclassification.
- Consider adjusting the sensitivity of the machine learning model if certain patterns are consistently flagged as anomalies but are verified as legitimate.
Response and remediation
- Immediately isolate the affected user accounts to prevent further unauthorized access. This can be done by disabling the accounts or resetting passwords.
- Conduct a thorough review of recent authentication logs to identify any other accounts that may have been compromised or targeted.
- Implement multi-factor authentication (MFA) for all user accounts to add an additional layer of security against unauthorized access.
- Notify the security operations team to monitor for any further suspicious logon activities and to ensure that the threat is contained.
- Escalate the incident to the incident response team if there is evidence of a broader attack or if sensitive data may have been accessed.
- Review and update access controls and permissions to ensure that users have the minimum necessary access to perform their roles.
- Enhance monitoring and alerting mechanisms to detect similar spikes in logon events in the future, ensuring rapid response to potential threats.
References
Related rules
- Unusual Login Activity
- Spike in Failed Logon Events
- Spike in Successful Logon Events from a Source IP
- Unusual Linux Process Calling the Metadata Service
- Unusual Linux User Calling the Metadata Service