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

References

Related rules

to-top