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"] 4maturity = "production" 5min_stack_comments = "New fields added: required_fields, related_integrations, setup" 6min_stack_version = "8.3.0" 7updated_date = "2023/11/02" 8 9[rule] 10author = ["Elastic"] 11description = """ 12Identifies potential attempts to disable Security-Enhanced Linux (SELinux), which is a Linux kernel security feature to 13support access control policies. Adversaries may disable security tools to avoid possible detection of their tools and 14activities. 15""" 16from = "now-9m" 17index = ["auditbeat-*", "logs-endpoint.events.*", "endgame-*"] 18language = "kuery" 19license = "Elastic License v2" 20name = "Potential Disabling of SELinux" 21risk_score = 47 22rule_id = "eb9eb8ba-a983-41d9-9c93-a1c05112ca5e" 23setup = """ 24 25This rule requires data coming in from one of the following integrations: 26- Elastic Defend 27- Auditbeat 28 29### Elastic Defend Integration Setup 30Elastic 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. 31 32#### Prerequisite Requirements: 33- Fleet is required for Elastic Defend. 34- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html). 35 36#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System: 37- Go to the Kibana home page and click "Add integrations". 38- In the query bar, search for "Elastic Defend" and select the integration to see more details about it. 39- Click "Add Elastic Defend". 40- Configure the integration name and optionally add a description. 41- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads". 42- 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). 43- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions" 44- 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. 45For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html). 46- Click "Save and Continue". 47- 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. 48For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html). 49 50### Auditbeat Setup 51Auditbeat 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. 52 53#### The following steps should be executed in order to add the Auditbeat on a Linux System: 54- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages. 55- 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). 56- 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). 57- 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). 58- 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). 59 60""" 61severity = "medium" 62tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Defense Evasion", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"] 63timestamp_override = "event.ingested" 64type = "query" 65 66query = ''' 67event.category:process and host.os.type:linux and event.type:(start or process_started) and process.name:setenforce and process.args:0 68''' 69 70 71[[rule.threat]] 72framework = "MITRE ATT&CK" 73[[rule.threat.technique]] 74id = "T1562" 75name = "Impair Defenses" 76reference = "https://attack.mitre.org/techniques/T1562/" 77[[rule.threat.technique.subtechnique]] 78id = "T1562.001" 79name = "Disable or Modify Tools" 80reference = "https://attack.mitre.org/techniques/T1562/001/" 81 82 83 84[rule.threat.tactic] 85id = "TA0005" 86name = "Defense Evasion" 87reference = "https://attack.mitre.org/tactics/TA0005/"
- Attempt to Disable Syslog Service
- Base16 or Base32 Encoding/Decoding Activity
- Creation of Hidden Shared Object File
- File made Immutable by Chattr
- Kernel Module Removal