Root Certificate Installation

This rule detects the installation of root certificates on a Linux system. Adversaries may install a root certificate on a compromised system to avoid warnings when connecting to their command and control servers. Root certificates are used in public key cryptography to identify a root certificate authority (CA). When a root certificate is installed, the system or application will trust certificates in the root's chain of trust that have been signed by the root certificate.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2024/08/28"
  3integration = ["endpoint", "sentinel_one_cloud_funnel"]
  4maturity = "production"
  5min_stack_version = "8.13.0"
  6min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
  7updated_date = "2025/01/24"
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12This rule detects the installation of root certificates on a Linux system. Adversaries may install a root certificate on
 13a compromised system to avoid warnings when connecting to their command and control servers. Root certificates are used
 14in public key cryptography to identify a root certificate authority (CA). When a root certificate is installed, the
 15system or application will trust certificates in the root's chain of trust that have been signed by the root certificate.
 16"""
 17from = "now-9m"
 18index = ["logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
 19language = "eql"
 20license = "Elastic License v2"
 21name = "Root Certificate Installation"
 22references = ["https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1553.004/T1553.004.md"]
 23risk_score = 47
 24rule_id = "6ded0996-7d4b-40f2-bf4a-6913e7591795"
 25setup = """## Setup
 26
 27This rule requires data coming in from Elastic Defend.
 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"""
 50severity = "medium"
 51tags = [
 52    "Domain: Endpoint",
 53    "OS: Linux",
 54    "Use Case: Threat Detection",
 55    "Tactic: Defense Evasion",
 56    "Data Source: Elastic Defend",
 57    "Data Source: SentinelOne",
 58    "Data Source: Elastic Endgame",
 59    "Resources: Investigation Guide",
 60]
 61timestamp_override = "event.ingested"
 62type = "eql"
 63query = '''
 64process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start") and
 65process.name in ("update-ca-trust", "update-ca-certificates") and not (
 66  process.parent.name like (
 67    "ca-certificates.postinst", "ca-certificates-*.trigger", "pacman", "pamac-daemon", "autofirma.postinst",
 68    "ipa-client-install", "su", "platform-python", "python*", "kesl", "execd", "systemd", "flock"
 69  ) or
 70  process.parent.args like "/var/tmp/rpm*" or
 71  (process.parent.name in ("sh", "bash", "zsh") and process.args == "-e")
 72)
 73'''
 74note = """## Triage and analysis
 75
 76> **Disclaimer**:
 77> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
 78
 79### Investigating Root Certificate Installation
 80
 81Root certificates are pivotal in establishing trust within public key infrastructures, enabling secure communications by verifying the authenticity of entities. Adversaries exploit this by installing rogue root certificates on compromised Linux systems, thus bypassing security warnings and facilitating undetected command and control communications. The detection rule identifies suspicious certificate installations by monitoring specific processes and excluding legitimate parent processes, thereby highlighting potential unauthorized activities.
 82
 83### Possible investigation steps
 84
 85- Review the process details to confirm the execution of "update-ca-trust" or "update-ca-certificates" on the Linux host, focusing on the event type "start" and action "exec" or "exec_event".
 86- Examine the parent process name and arguments to ensure they do not match any of the legitimate exclusions such as "ca-certificates.postinst", "pacman", or "/var/tmp/rpm*".
 87- Investigate the user account associated with the process to determine if it is a known or expected user for such operations.
 88- Check the system logs and recent changes to identify any unauthorized modifications or installations that coincide with the alert.
 89- Correlate the alert with other security events or logs to identify any potential command and control communications or other suspicious activities on the host.
 90- Assess the network connections from the host around the time of the alert to detect any unusual or unauthorized outbound traffic.
 91
 92### False positive analysis
 93
 94- Legitimate system updates or package installations may trigger the rule when processes like "update-ca-trust" or "update-ca-certificates" are executed by trusted package managers such as "pacman" or "pamac-daemon". To mitigate this, ensure these parent processes are included in the exclusion list.
 95- Automated scripts or system maintenance tasks that use shell scripts (e.g., "sh", "bash", "zsh") to update certificates might be flagged. If these scripts are verified as safe, consider adding specific script names or paths to the exclusion criteria.
 96- Custom applications or services that require certificate updates and are known to be safe can be excluded by adding their parent process names to the exclusion list, ensuring they do not trigger false alerts.
 97- Security tools or agents like "kesl" or "execd" that manage certificates as part of their operations may cause false positives. Verify their activities and include them in the exclusion list if they are part of legitimate security operations.
 98- Temporary files or scripts located in directories like "/var/tmp/rpm*" used during legitimate installations should be reviewed and excluded if they are part of routine system operations.
 99
100### Response and remediation
101
102- Immediately isolate the affected Linux system from the network to prevent further unauthorized communications with potential command and control servers.
103- Revoke any unauthorized root certificates installed on the system by removing them from the trusted certificate store to restore the integrity of the system's trust chain.
104- Conduct a thorough review of system logs and process execution history to identify any additional unauthorized activities or changes made by the adversary.
105- Restore the system from a known good backup if unauthorized changes or persistent threats are detected that cannot be easily remediated.
106- Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited by the adversary.
107- Implement enhanced monitoring and alerting for similar suspicious activities, focusing on process executions related to certificate management.
108- Escalate the incident to the security operations center (SOC) or relevant incident response team for further investigation and to assess the potential impact on other systems within the network."""
109
110[[rule.threat]]
111framework = "MITRE ATT&CK"
112
113[[rule.threat.technique]]
114id = "T1553"
115name = "Subvert Trust Controls"
116reference = "https://attack.mitre.org/techniques/T1553/"
117
118[[rule.threat.technique.subtechnique]]
119id = "T1553.004"
120name = "Install Root Certificate"
121reference = "https://attack.mitre.org/techniques/T1553/004/"
122
123[rule.threat.tactic]
124id = "TA0005"
125name = "Defense Evasion"
126reference = "https://attack.mitre.org/tactics/TA0005/"

Triage and analysis

Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

Investigating Root Certificate Installation

Root certificates are pivotal in establishing trust within public key infrastructures, enabling secure communications by verifying the authenticity of entities. Adversaries exploit this by installing rogue root certificates on compromised Linux systems, thus bypassing security warnings and facilitating undetected command and control communications. The detection rule identifies suspicious certificate installations by monitoring specific processes and excluding legitimate parent processes, thereby highlighting potential unauthorized activities.

Possible investigation steps

  • Review the process details to confirm the execution of "update-ca-trust" or "update-ca-certificates" on the Linux host, focusing on the event type "start" and action "exec" or "exec_event".
  • Examine the parent process name and arguments to ensure they do not match any of the legitimate exclusions such as "ca-certificates.postinst", "pacman", or "/var/tmp/rpm*".
  • Investigate the user account associated with the process to determine if it is a known or expected user for such operations.
  • Check the system logs and recent changes to identify any unauthorized modifications or installations that coincide with the alert.
  • Correlate the alert with other security events or logs to identify any potential command and control communications or other suspicious activities on the host.
  • Assess the network connections from the host around the time of the alert to detect any unusual or unauthorized outbound traffic.

False positive analysis

  • Legitimate system updates or package installations may trigger the rule when processes like "update-ca-trust" or "update-ca-certificates" are executed by trusted package managers such as "pacman" or "pamac-daemon". To mitigate this, ensure these parent processes are included in the exclusion list.
  • Automated scripts or system maintenance tasks that use shell scripts (e.g., "sh", "bash", "zsh") to update certificates might be flagged. If these scripts are verified as safe, consider adding specific script names or paths to the exclusion criteria.
  • Custom applications or services that require certificate updates and are known to be safe can be excluded by adding their parent process names to the exclusion list, ensuring they do not trigger false alerts.
  • Security tools or agents like "kesl" or "execd" that manage certificates as part of their operations may cause false positives. Verify their activities and include them in the exclusion list if they are part of legitimate security operations.
  • Temporary files or scripts located in directories like "/var/tmp/rpm*" used during legitimate installations should be reviewed and excluded if they are part of routine system operations.

Response and remediation

  • Immediately isolate the affected Linux system from the network to prevent further unauthorized communications with potential command and control servers.
  • Revoke any unauthorized root certificates installed on the system by removing them from the trusted certificate store to restore the integrity of the system's trust chain.
  • Conduct a thorough review of system logs and process execution history to identify any additional unauthorized activities or changes made by the adversary.
  • Restore the system from a known good backup if unauthorized changes or persistent threats are detected that cannot be easily remediated.
  • Update and patch the system to the latest security standards to close any vulnerabilities that may have been exploited by the adversary.
  • Implement enhanced monitoring and alerting for similar suspicious activities, focusing on process executions related to certificate management.
  • Escalate the incident to the security operations center (SOC) or relevant incident response team for further investigation and to assess the potential impact on other systems within the network.

References

Related rules

to-top