Sensitive Files Compression
Identifies the use of a compression utility to collect known files containing sensitive information, such as credentials and system configurations.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/12/22"
3integration = ["endpoint"]
4maturity = "production"
5min_stack_comments = "Multiple field support in the New Terms rule type was added in Elastic 8.6"
6min_stack_version = "8.6.0"
7updated_date = "2023/11/02"
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies the use of a compression utility to collect known files containing sensitive information, such as credentials
13and system configurations.
14"""
15from = "now-9m"
16index = ["auditbeat-*", "logs-endpoint.events.*", "endgame-*"]
17language = "kuery"
18license = "Elastic License v2"
19name = "Sensitive Files Compression"
20references = [
21 "https://www.trendmicro.com/en_ca/research/20/l/teamtnt-now-deploying-ddos-capable-irc-bot-tntbotinger.html",
22]
23risk_score = 47
24rule_id = "6b84d470-9036-4cc0-a27c-6d90bbfe81ab"
25setup = """## Setup
26
27This rule requires data coming in from one of the following integrations:
28- Elastic Defend
29- Auditbeat
30
31
32### Elastic Defend Integration Setup
33Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows
34the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
35
36#### Prerequisite Requirements:
37- Fleet is required for Elastic Defend.
38- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
39
40#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
41- Go to the Kibana home page and click "Add integrations".
42- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
43- Click "Add Elastic Defend".
44- Configure the integration name and optionally add a description.
45- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
46- 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).
47- We suggest to select "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
48- 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.
49For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
50- Click "Save and Continue".
51- 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.
52For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
53
54### Auditbeat Setup
55Auditbeat 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.
56
57#### The following steps should be executed in order to add the Auditbeat on a Linux System:
58- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
59- 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).
60- 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).
61- 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).
62- 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).
63"""
64severity = "medium"
65tags = [
66 "Domain: Endpoint",
67 "OS: Linux",
68 "Use Case: Threat Detection",
69 "Tactic: Collection",
70 "Tactic: Credential Access",
71 "Data Source: Elastic Endgame",
72 "Data Source: Elastic Defend"
73 ]
74timestamp_override = "event.ingested"
75type = "new_terms"
76
77query = '''
78event.category:process and host.os.type:linux and event.type:start and
79 process.name:(zip or tar or gzip or hdiutil or 7z) and
80 process.args:
81 (
82 /root/.ssh/id_rsa or
83 /root/.ssh/id_rsa.pub or
84 /root/.ssh/id_ed25519 or
85 /root/.ssh/id_ed25519.pub or
86 /root/.ssh/authorized_keys or
87 /root/.ssh/authorized_keys2 or
88 /root/.ssh/known_hosts or
89 /root/.bash_history or
90 /etc/hosts or
91 /home/*/.ssh/id_rsa or
92 /home/*/.ssh/id_rsa.pub or
93 /home/*/.ssh/id_ed25519 or
94 /home/*/.ssh/id_ed25519.pub or
95 /home/*/.ssh/authorized_keys or
96 /home/*/.ssh/authorized_keys2 or
97 /home/*/.ssh/known_hosts or
98 /home/*/.bash_history or
99 /root/.aws/credentials or
100 /root/.aws/config or
101 /home/*/.aws/credentials or
102 /home/*/.aws/config or
103 /root/.docker/config.json or
104 /home/*/.docker/config.json or
105 /etc/group or
106 /etc/passwd or
107 /etc/shadow or
108 /etc/gshadow
109 )
110'''
111
112[[rule.threat]]
113framework = "MITRE ATT&CK"
114
115[[rule.threat.technique]]
116id = "T1552"
117name = "Unsecured Credentials"
118reference = "https://attack.mitre.org/techniques/T1552/"
119
120[[rule.threat.technique.subtechnique]]
121id = "T1552.001"
122name = "Credentials In Files"
123reference = "https://attack.mitre.org/techniques/T1552/001/"
124
125[rule.threat.tactic]
126id = "TA0006"
127name = "Credential Access"
128reference = "https://attack.mitre.org/tactics/TA0006/"
129
130[[rule.threat]]
131framework = "MITRE ATT&CK"
132
133[[rule.threat.technique]]
134id = "T1560"
135name = "Archive Collected Data"
136reference = "https://attack.mitre.org/techniques/T1560/"
137
138[[rule.threat.technique.subtechnique]]
139id = "T1560.001"
140name = "Archive via Utility"
141reference = "https://attack.mitre.org/techniques/T1560/001/"
142
143[rule.threat.tactic]
144id = "TA0009"
145name = "Collection"
146reference = "https://attack.mitre.org/tactics/TA0009/"
147
148[rule.new_terms]
149field = "new_terms_fields"
150value = ["host.id", "process.command_line", "process.parent.executable"]
151
152[[rule.new_terms.history_window_start]]
153field = "history_window_start"
154value = "now-10d"
References
Related rules
- Modification of OpenSSH Binaries
- Potential Linux Credential Dumping via Unshadow
- Potential OpenSSH Backdoor Logging Activity
- Potential Shadow File Read via Command Line Utilities
- Abnormal Process ID or Lock File Created