diff --git a/rules/linux/defense_evasion_user_or_group_deletion.toml b/rules/linux/defense_evasion_user_or_group_deletion.toml new file mode 100644 index 00000000000..cdab23f1cdc --- /dev/null +++ b/rules/linux/defense_evasion_user_or_group_deletion.toml @@ -0,0 +1,64 @@ +[metadata] +creation_date = "2025/06/30" +integration = ["system"] +maturity = "production" +updated_date = "2025/06/30" + +[rule] +author = ["Elastic"] +description = """ +This rule detects the deletion of user or group accounts on Linux systems. Adversaries may use these +commands to remove accounts to cover their tracks or disrupt operations. +""" +from = "now-9m" +index = ["filebeat-*", "logs-system.auth-*"] +language = "eql" +license = "Elastic License v2" +name = "Linux User or Group Deletion" +risk_score = 21 +rule_id = "8f8004e1-0783-485f-a3da-aca4362f74a7" +setup = """## Setup + +This rule requires data coming in from Filebeat. + +### Filebeat Setup +Filebeat is a lightweight shipper for forwarding and centralizing log data. Installed as an agent on your servers, Filebeat monitors the log files or locations that you specify, collects log events, and forwards them either to Elasticsearch or Logstash for indexing. + +#### The following steps should be executed in order to add the Filebeat on a Linux System: +- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages. +- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/setup-repositories.html). +- To run Filebeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html). +- To run Filebeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html). +- For quick start information for Filebeat refer to the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/8.11/filebeat-installation-configuration.html). +- For complete “Setup and Run Filebeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/setting-up-and-running.html). + +#### Rule Specific Setup Note +- This rule requires the “Filebeat System Module” to be enabled. +- The system module collects and parses logs created by the system logging service of common Unix/Linux based distributions. +- To run the system module of Filebeat on Linux follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-system.html). +""" +severity = "low" +tags = [ + "Domain: Endpoint", + "OS: Linux", + "Use Case: Threat Detection", + "Tactic: Defense Evasion", +] +timestamp_override = "event.ingested" +type = "eql" +query = ''' +iam where host.os.type == "linux" and event.type in ("group", "user") and event.type == "deletion" and event.outcome == "success" +''' + +[[rule.threat]] +framework = "MITRE ATT&CK" + +[[rule.threat.technique]] +id = "T1070" +name = "Indicator Removal" +reference = "https://attack.mitre.org/techniques/T1070/" + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" diff --git a/rules/linux/persistence_linux_group_creation.toml b/rules/linux/persistence_linux_group_creation.toml index f2f16eec49c..1e244794354 100644 --- a/rules/linux/persistence_linux_group_creation.toml +++ b/rules/linux/persistence_linux_group_creation.toml @@ -2,7 +2,7 @@ creation_date = "2023/02/13" integration = ["system"] maturity = "production" -updated_date = "2025/02/03" +updated_date = "2025/06/30" [transform] [[transform.osquery]] @@ -110,28 +110,24 @@ tags = [ ] timestamp_override = "event.ingested" type = "eql" - query = ''' -iam where host.os.type == "linux" and (event.type == "group" and event.type == "creation") and -process.name in ("groupadd", "addgroup") and group.name != null +iam where host.os.type == "linux" and event.type == "group" and event.type == "creation" and event.outcome == "success" ''' - [[rule.threat]] framework = "MITRE ATT&CK" + [[rule.threat.technique]] id = "T1136" name = "Create Account" reference = "https://attack.mitre.org/techniques/T1136/" + [[rule.threat.technique.subtechnique]] id = "T1136.001" name = "Local Account" reference = "https://attack.mitre.org/techniques/T1136/001/" - - [rule.threat.tactic] id = "TA0003" name = "Persistence" reference = "https://attack.mitre.org/tactics/TA0003/" - diff --git a/rules/linux/persistence_linux_user_account_creation.toml b/rules/linux/persistence_linux_user_account_creation.toml index 4079c03faa7..7acc486bf8b 100644 --- a/rules/linux/persistence_linux_user_account_creation.toml +++ b/rules/linux/persistence_linux_user_account_creation.toml @@ -2,7 +2,7 @@ creation_date = "2023/02/13" integration = ["system"] maturity = "production" -updated_date = "2025/02/03" +updated_date = "2025/06/30" [transform] [[transform.osquery]] @@ -109,26 +109,23 @@ tags = [ ] timestamp_override = "event.ingested" type = "eql" - query = ''' -iam where host.os.type == "linux" and (event.type == "user" and event.type == "creation") and -process.name in ("useradd", "adduser") and user.name != null +iam where host.os.type == "linux" and event.type == "user" and event.type == "creation" and event.outcome == "success" ''' - [[rule.threat]] framework = "MITRE ATT&CK" + [[rule.threat.technique]] id = "T1136" name = "Create Account" reference = "https://attack.mitre.org/techniques/T1136/" + [[rule.threat.technique.subtechnique]] id = "T1136.001" name = "Local Account" reference = "https://attack.mitre.org/techniques/T1136/001/" - - [rule.threat.tactic] id = "TA0003" name = "Persistence"