DPKG Package Installed by Unusual Parent Process

This rule detects the installation of a Debian package (dpkg) by an unusual parent process. The dpkg command is used to install, remove, and manage Debian packages on a Linux system. Attackers can abuse the dpkg command to install malicious packages on a system.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2024/07/09"
  3integration = ["endpoint"]
  4maturity = "production"
  5min_stack_comments = "The New Term rule type used in this rule was added in Elastic 8.4"
  6min_stack_version = "8.4.0"
  7updated_date = "2024/07/09"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12This rule detects the installation of a Debian package (dpkg) by an unusual parent process. The dpkg command is used to
 13install, remove, and manage Debian packages on a Linux system. Attackers can abuse the dpkg command to install malicious
 14packages on a system.
 15"""
 16from = "now-9m"
 17index = ["logs-endpoint.events.*"]
 18language = "kuery"
 19license = "Elastic License v2"
 20name = "DPKG Package Installed by Unusual Parent Process"
 21references = ["https://www.makeuseof.com/how-deb-packages-are-backdoored-how-to-detect-it/"]
 22risk_score = 21
 23rule_id = "f4d1c0ac-aedb-4063-9fa6-cc651eb5e6ee"
 24setup = """## Setup
 25
 26This rule requires data coming in from Elastic Defend.
 27
 28### Elastic Defend Integration Setup
 29Elastic 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.
 30
 31#### Prerequisite Requirements:
 32- Fleet is required for Elastic Defend.
 33- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 34
 35#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
 36- Go to the Kibana home page and click "Add integrations".
 37- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
 38- Click "Add Elastic Defend".
 39- Configure the integration name and optionally add a description.
 40- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
 41- 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).
 42- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
 43- 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.
 44For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
 45- Click "Save and Continue".
 46- 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.
 47For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
 48"""
 49severity = "low"
 50tags = [
 51        "Domain: Endpoint",
 52        "OS: Linux",
 53        "Use Case: Threat Detection",
 54        "Tactic: Persistence",
 55        "Data Source: Elastic Defend"
 56        ]
 57timestamp_override = "event.ingested"
 58type = "new_terms"
 59query = '''
 60host.os.type:linux and event.category:process and event.type:start and event.action:exec and process.name:dpkg and
 61process.args:("-i" or "--install")
 62'''
 63
 64[[rule.threat]]
 65framework = "MITRE ATT&CK"
 66
 67[[rule.threat.technique]]
 68id = "T1546"
 69name = "Event Triggered Execution"
 70reference = "https://attack.mitre.org/techniques/T1546/"
 71
 72[[rule.threat.technique.subtechnique]]
 73id = "T1546.016"
 74name = "Installer Packages"
 75reference = "https://attack.mitre.org/techniques/T1546/016/"
 76
 77[[rule.threat.technique]]
 78id = "T1543"
 79name = "Create or Modify System Process"
 80reference = "https://attack.mitre.org/techniques/T1543/"
 81
 82[[rule.threat.technique]]
 83id = "T1574"
 84name = "Hijack Execution Flow"
 85reference = "https://attack.mitre.org/techniques/T1574/"
 86
 87[rule.threat.tactic]
 88id = "TA0003"
 89name = "Persistence"
 90reference = "https://attack.mitre.org/tactics/TA0003/"
 91
 92[[rule.threat]]
 93framework = "MITRE ATT&CK"
 94
 95[[rule.threat.technique]]
 96id = "T1195"
 97name = "Supply Chain Compromise"
 98reference = "https://attack.mitre.org/techniques/T1195/"
 99
100[[rule.threat.technique.subtechnique]]
101id = "T1195.002"
102name = "Compromise Software Supply Chain"
103reference = "https://attack.mitre.org/techniques/T1195/002/"
104
105[rule.threat.tactic]
106name = "Initial Access"
107id = "TA0001"
108reference = "https://attack.mitre.org/tactics/TA0001/"
109
110[rule.new_terms]
111field = "new_terms_fields"
112value = ["process.parent.executable"]
113
114[[rule.new_terms.history_window_start]]
115field = "history_window_start"
116value = "now-7d"

References

Related rules

to-top