Potential Hidden Process via Mount Hidepid
Identifies the execution of mount process with hidepid parameter, which can make processes invisible to other users from the system. Adversaries using Linux kernel version 3.2+ (or RHEL/CentOS v6.5+ above) can hide the process from other users. When hidepid=2 option is executed to mount the /proc filesystem, only the root user can see all processes and the logged-in user can only see their own process. This provides a defense evasion mechanism for the adversaries to hide their process executions from all other commands such as ps, top, pgrep and more. With the Linux kernel hardening hidepid option all the user has to do is remount the /proc filesystem with the option, which can now be monitored and detected.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/04/11"
3integration = ["endpoint", "auditd_manager"]
4maturity = "production"
5updated_date = "2024/10/17"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies the execution of mount process with hidepid parameter, which can make processes invisible to other users from
11the system. Adversaries using Linux kernel version 3.2+ (or RHEL/CentOS v6.5+ above) can hide the process from other
12users. When hidepid=2 option is executed to mount the /proc filesystem, only the root user can see all processes and the
13logged-in user can only see their own process. This provides a defense evasion mechanism for the adversaries to hide
14their process executions from all other commands such as ps, top, pgrep and more. With the Linux kernel hardening
15hidepid option all the user has to do is remount the /proc filesystem with the option, which can now be monitored and
16detected.
17"""
18from = "now-9m"
19index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
20language = "eql"
21license = "Elastic License v2"
22name = "Potential Hidden Process via Mount Hidepid"
23references = ["https://www.cyberciti.biz/faq/linux-hide-processes-from-other-users/"]
24risk_score = 47
25rule_id = "dc71c186-9fe4-4437-a4d0-85ebb32b8204"
26setup = """## Setup
27
28This rule requires data coming in from Elastic Defend.
29
30### Elastic Defend Integration Setup
31Elastic 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.
32
33#### Prerequisite Requirements:
34- Fleet is required for Elastic Defend.
35- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
36
37#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
38- Go to the Kibana home page and click "Add integrations".
39- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
40- Click "Add Elastic Defend".
41- Configure the integration name and optionally add a description.
42- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
43- 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).
44- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
45- 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.
46For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
47- Click "Save and Continue".
48- 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.
49For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
50"""
51severity = "medium"
52tags = [
53 "Domain: Endpoint",
54 "OS: Linux",
55 "Use Case: Threat Detection",
56 "Tactic: Defense Evasion",
57 "Data Source: Elastic Endgame",
58 "Data Source: Elastic Defend",
59 "Data Source: Auditd Manager",
60]
61timestamp_override = "event.ingested"
62type = "eql"
63query = '''
64process where host.os.type == "linux" and event.type == "start" and
65event.action in ("exec", "exec_event", "executed", "process_started") and
66process.name == "mount" and process.args == "/proc" and process.args == "-o" and process.args : "*hidepid=2*" and
67not process.parent.command_line like "/opt/cloudlinux/*"
68'''
69
70[[rule.threat]]
71framework = "MITRE ATT&CK"
72
73[[rule.threat.technique]]
74id = "T1564"
75name = "Hide Artifacts"
76reference = "https://attack.mitre.org/techniques/T1564/"
77
78[rule.threat.tactic]
79id = "TA0005"
80name = "Defense Evasion"
81reference = "https://attack.mitre.org/tactics/TA0005/"
References
Related rules
- Tampering of Shell Command-Line History
- Potential Disabling of AppArmor
- Attempt to Clear Kernel Ring Buffer
- Base16 or Base32 Encoding/Decoding Activity
- ESXI Timestomping using Touch Command