Unusual Sudo Activity
Looks for sudo activity from an unusual user context. An unusual sudo user could be due to troubleshooting activity or it could be a sign of credentialed access via compromised accounts.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/09/03"
3integration = ["auditd_manager", "endpoint"]
4maturity = "production"
5updated_date = "2024/06/18"
6
7[rule]
8anomaly_threshold = 75
9author = ["Elastic"]
10description = """
11Looks for sudo activity from an unusual user context. An unusual sudo user could be due to troubleshooting activity or
12it could be a sign of credentialed access via compromised accounts.
13"""
14false_positives = [
15 """
16 Uncommon sudo activity can be due to an engineer logging onto a server instance in order to perform manual
17 troubleshooting or reconfiguration.
18 """,
19]
20from = "now-45m"
21interval = "15m"
22license = "Elastic License v2"
23machine_learning_job_id = ["v3_linux_rare_sudo_user"]
24name = "Unusual Sudo Activity"
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
31### Anomaly Detection Setup
32
33Once 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).
34
35### Elastic Defend Integration Setup
36Elastic 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.
37
38#### Prerequisite Requirements:
39- Fleet is required for Elastic Defend.
40- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
41
42#### The following steps should be executed in order to add the Elastic Defend integration to your system:
43- Go to the Kibana home page and click "Add integrations".
44- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
45- Click "Add Elastic Defend".
46- Configure the integration name and optionally add a description.
47- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
48- 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).
49- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
50- 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.
51For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
52- Click "Save and Continue".
53- 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.
54For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
55
56### Auditd Manager Integration Setup
57The Auditd Manager Integration receives audit events from the Linux Audit Framework which is a part of the Linux kernel.
58Auditd 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.
59
60#### The following steps should be executed in order to add the Elastic Agent System integration "auditd_manager" to your system:
61- Go to the Kibana home page and click “Add integrations”.
62- In the query bar, search for “Auditd Manager” and select the integration to see more details about it.
63- Click “Add Auditd Manager”.
64- Configure the integration name and optionally add a description.
65- Review optional and advanced settings accordingly.
66- 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.
67- Click “Save and Continue”.
68- For more details on the integration refer to the [helper guide](https://docs.elastic.co/integrations/auditd_manager).
69
70#### Rule Specific Setup Note
71Auditd Manager subscribes to the kernel and receives events as they occur without any additional configuration.
72However, 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.
73- For this detection rule no additional audit rules are required.
74"""
75risk_score = 21
76rule_id = "1e9fc667-9ff1-4b33-9f40-fefca8537eb0"
77severity = "low"
78tags = [
79 "Domain: Endpoint",
80 "OS: Linux",
81 "Use Case: Threat Detection",
82 "Rule Type: ML",
83 "Rule Type: Machine Learning",
84 "Tactic: Privilege Escalation",
85]
86type = "machine_learning"
87[[rule.threat]]
88framework = "MITRE ATT&CK"
89[[rule.threat.technique]]
90id = "T1548"
91name = "Abuse Elevation Control Mechanism"
92reference = "https://attack.mitre.org/techniques/T1548/"
93
94
95[rule.threat.tactic]
96id = "TA0005"
97name = "Defense Evasion"
98reference = "https://attack.mitre.org/tactics/TA0005/"
99[[rule.threat]]
100framework = "MITRE ATT&CK"
101[[rule.threat.technique]]
102id = "T1548"
103name = "Abuse Elevation Control Mechanism"
104reference = "https://attack.mitre.org/techniques/T1548/"
105
106
107[rule.threat.tactic]
108id = "TA0004"
109name = "Privilege Escalation"
110reference = "https://attack.mitre.org/tactics/TA0004/"
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