Unusual Hour for a User to Logon

A machine learning job detected a user logging in at a time of day 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 time zones. In addition, unauthorized user activity often takes place during non-business hours.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2021/06/10"
 3integration = ["auditd_manager", "endpoint", "system"]
 4maturity = "production"
 5updated_date = "2023/07/27"
 6min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 7min_stack_version = "8.3.0"
 8
 9[rule]
10anomaly_threshold = 75
11author = ["Elastic"]
12description = """
13A machine learning job detected a user logging in at a time of day that is unusual for the user. This can be due to
14credentialed access via a compromised account when the user and the threat actor are in different time zones. In
15addition, unauthorized user activity often takes place during non-business hours.
16"""
17false_positives = ["Users working late, or logging in from unusual time zones while traveling, may trigger this rule."]
18from = "now-30m"
19interval = "15m"
20license = "Elastic License v2"
21machine_learning_job_id = "auth_rare_hour_for_a_user"
22name = "Unusual Hour for a User to Logon"
23note = """## Triage and analysis
24
25### Investigating Unusual Hour for a User to Logon
26
27This rule uses a machine learning job to detect a user logging in at a time of day 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 time zones. It can also indicate unauthorized user activity, as it often occurs during non-business hours.
28
29#### Possible investigation steps
30
31- Identify the user account that performed the action and whether it should perform this kind of action.
32- Contact the account owner and confirm whether they are aware of this activity.
33- Investigate any abnormal account behavior, such as command executions, file creations or modifications, network connections, data access, and logon events.
34- Investigate other alerts associated with the involved users during the past 48 hours.
35
36### False positive analysis
37
38- Users may need to log in during non-business hours to perform work-related tasks. Examine whether the company policies authorize this or if the activity is done under change management.
39
40### Response and remediation
41
42- Initiate the incident response process based on the outcome of the triage.
43- 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.
44- 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).
45"""
46references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
47risk_score = 21
48rule_id = "745b0119-0560-43ba-860a-7235dd8cee8d"
49severity = "low"
50tags = ["Use Case: Identity and Access Audit", "Use Case: Threat Detection", "Rule Type: ML", "Rule Type: Machine Learning", "Tactic: Initial Access", "Resources: Investigation Guide"]
51type = "machine_learning"
52
53[[rule.threat]]
54framework = "MITRE ATT&CK"
55[[rule.threat.technique]]
56id = "T1078"
57name = "Valid Accounts"
58reference = "https://attack.mitre.org/techniques/T1078/"
59
60
61[rule.threat.tactic]
62id = "TA0001"
63name = "Initial Access"
64reference = "https://attack.mitre.org/tactics/TA0001/"

Triage and analysis

Investigating Unusual Hour for a User to Logon

This rule uses a machine learning job to detect a user logging in at a time of day 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 time zones. It can also indicate unauthorized user activity, as it often occurs during non-business hours.

Possible investigation steps

  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Investigate any abnormal account behavior, such as command executions, file creations or modifications, network connections, data access, and logon events.
  • Investigate other alerts associated with the involved users during the past 48 hours.

False positive analysis

  • Users may need to log in during non-business hours to perform work-related tasks. Examine whether the company policies authorize this or if the activity is done under change management.

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.
  • 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