Unusual Linux Username
A machine learning job detected activity for a username that is not normally active, which can indicate unauthorized changes, activity by unauthorized users, lateral movement, or compromised credentials. In many organizations, new usernames are not often created apart from specific types of system activities, such as creating new accounts for new employees. These user accounts quickly become active and routine. Events from rarely used usernames can point to suspicious activity. Additionally, automated Linux fleets tend to see activity from rarely used usernames only when personnel log in to make authorized or unauthorized changes, or threat actors have acquired credentials and log in for malicious purposes. Unusual usernames can also indicate pivoting, where compromised credentials are used to try and move laterally from one host to another.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/03/25"
3integration = ["auditd_manager", "endpoint"]
4maturity = "production"
5updated_date = "2024/06/18"
6
7[rule]
8anomaly_threshold = 50
9author = ["Elastic"]
10description = """
11A machine learning job detected activity for a username that is not normally active, which can indicate unauthorized
12changes, activity by unauthorized users, lateral movement, or compromised credentials. In many organizations, new
13usernames are not often created apart from specific types of system activities, such as creating new accounts for new
14employees. These user accounts quickly become active and routine. Events from rarely used usernames can point to
15suspicious activity. Additionally, automated Linux fleets tend to see activity from rarely used usernames only when
16personnel log in to make authorized or unauthorized changes, or threat actors have acquired credentials and log in for
17malicious purposes. Unusual usernames can also indicate pivoting, where compromised credentials are used to try and move
18laterally from one host to another.
19"""
20false_positives = [
21 """
22 Uncommon user activity can be due to an engineer logging onto a server instance in order to perform manual
23 troubleshooting or reconfiguration.
24 """,
25]
26from = "now-45m"
27interval = "15m"
28license = "Elastic License v2"
29machine_learning_job_id = ["v3_linux_anomalous_user_name"]
30name = "Unusual Linux Username"
31setup = """## Setup
32
33This rule requires the installation of associated Machine Learning jobs, as well as data coming in from one of the following integrations:
34- Elastic Defend
35- Auditd Manager
36
37### Anomaly Detection Setup
38
39Once 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).
40
41### Elastic Defend Integration Setup
42Elastic 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.
43
44#### Prerequisite Requirements:
45- Fleet is required for Elastic Defend.
46- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
47
48#### The following steps should be executed in order to add the Elastic Defend integration to your system:
49- Go to the Kibana home page and click "Add integrations".
50- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
51- Click "Add Elastic Defend".
52- Configure the integration name and optionally add a description.
53- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
54- 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).
55- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
56- 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.
57For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
58- Click "Save and Continue".
59- 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.
60For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
61
62### Auditd Manager Integration Setup
63The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
64Auditd 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.
65
66#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
67- Go to the Kibana home page and click “Add integrations”.
68- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
69- Click “Add Auditd Manager”.
70- Configure the integration name and optionally add a description.
71- Review optional and advanced settings accordingly.
72- 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.
73- Click “Save and Continue”.
74- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
75
76#### Rule Specific Setup Note
77Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
78However, 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.
79- For this detection rule no additional audit rules are required.
80"""
81note = """## Triage and analysis
82
83### Investigating an Unusual Linux User
84Detection alerts from this rule indicate activity for a Linux user name that is rare and unusual. Here are some possible avenues of investigation:
85- Consider the user as identified by the username field. Is this program part of an expected workflow for the user who ran this program on this host? Could this be related to troubleshooting or debugging activity by a developer or site reliability engineer?
86- Examine the history of user activity. If this user only manifested recently, it might be a service account for a new software package. If it has a consistent cadence (for example if it runs monthly or quarterly), it might be part of a monthly or quarterly business process.
87- Examine the process arguments, title and working directory. These may provide indications as to the source of the program or the nature of the tasks that the user is performing."""
88references = ["https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html"]
89risk_score = 21
90rule_id = "b347b919-665f-4aac-b9e8-68369bf2340c"
91severity = "low"
92tags = [
93 "Domain: Endpoint",
94 "OS: Linux",
95 "Use Case: Threat Detection",
96 "Rule Type: ML",
97 "Rule Type: Machine Learning",
98 "Tactic: Initial Access",
99]
100type = "machine_learning"
101[[rule.threat]]
102framework = "MITRE ATT&CK"
103[[rule.threat.technique]]
104id = "T1078"
105name = "Valid Accounts"
106reference = "https://attack.mitre.org/techniques/T1078/"
107
108
109[rule.threat.tactic]
110id = "TA0001"
111name = "Initial Access"
112reference = "https://attack.mitre.org/tactics/TA0001/"
Triage and analysis
Investigating an Unusual Linux User
Detection alerts from this rule indicate activity for a Linux user name that is rare and unusual. Here are some possible avenues of investigation:
- Consider the user as identified by the username field. Is this program part of an expected workflow for the user who ran this program on this host? Could this be related to troubleshooting or debugging activity by a developer or site reliability engineer?
- Examine the history of user activity. If this user only manifested recently, it might be a service account for a new software package. If it has a consistent cadence (for example if it runs monthly or quarterly), it might be part of a monthly or quarterly business process.
- Examine the process arguments, title and working directory. These may provide indications as to the source of the program or the nature of the tasks that the user is performing.
References
Related rules
- Anomalous Linux Compiler Activity
- Anomalous Process For a Linux Population
- Unusual Linux Network Activity
- Unusual Linux Network Configuration Discovery
- Unusual Linux Network Connection Discovery