Potential Disabling of SELinux
Identifies potential attempts to disable Security-Enhanced Linux (SELinux), which is a Linux kernel security feature to support access control policies. Adversaries may disable security tools to avoid possible detection of their tools and activities.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/04/22"
3integration = ["endpoint", "auditd_manager"]
4maturity = "production"
5updated_date = "2024/05/21"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies potential attempts to disable Security-Enhanced Linux (SELinux), which is a Linux kernel security feature to
11support access control policies. Adversaries may disable security tools to avoid possible detection of their tools and
12activities.
13"""
14from = "now-9m"
15index = ["logs-endpoint.events.*", "endgame-*", "auditbeat-*", "logs-auditd_manager.auditd-*"]
16language = "eql"
17license = "Elastic License v2"
18name = "Potential Disabling of SELinux"
19risk_score = 47
20rule_id = "eb9eb8ba-a983-41d9-9c93-a1c05112ca5e"
21setup = """## Setup
22
23This rule requires data coming in from one of the following integrations:
24- Elastic Defend
25- Auditbeat
26
27### Elastic Defend Integration Setup
28Elastic 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.
29
30#### Prerequisite Requirements:
31- Fleet is required for Elastic Defend.
32- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
33
34#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
35- Go to the Kibana home page and click "Add integrations".
36- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
37- Click "Add Elastic Defend".
38- Configure the integration name and optionally add a description.
39- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
40- 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).
41- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
42- 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.
43For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
44- Click "Save and Continue".
45- 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.
46For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
47
48### Auditbeat Setup
49Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.
50
51#### The following steps should be executed in order to add the Auditbeat on a Linux System:
52- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
53- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
54- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
55- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
56- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
57"""
58severity = "medium"
59tags = [
60 "Domain: Endpoint",
61 "OS: Linux",
62 "Use Case: Threat Detection",
63 "Tactic: Defense Evasion",
64 "Data Source: Elastic Endgame",
65 "Data Source: Elastic Defend",
66 "Data Source: Auditd Manager",
67]
68timestamp_override = "event.ingested"
69type = "eql"
70
71query = '''
72process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "executed", "process_started")
73 and process.name == "setenforce" and process.args == "0"
74'''
75
76
77[[rule.threat]]
78framework = "MITRE ATT&CK"
79[[rule.threat.technique]]
80id = "T1562"
81name = "Impair Defenses"
82reference = "https://attack.mitre.org/techniques/T1562/"
83[[rule.threat.technique.subtechnique]]
84id = "T1562.001"
85name = "Disable or Modify Tools"
86reference = "https://attack.mitre.org/techniques/T1562/001/"
87
88
89
90[rule.threat.tactic]
91id = "TA0005"
92name = "Defense Evasion"
93reference = "https://attack.mitre.org/tactics/TA0005/"
Related rules
- Attempt to Clear Kernel Ring Buffer
- Base16 or Base32 Encoding/Decoding Activity
- ESXI Timestomping using Touch Command
- Creation of Hidden Shared Object File
- Executable Masquerading as Kernel Process