First Time Python Created a LaunchAgent or LaunchDaemon

Last updated 23 days ago on 2026-02-23
Created 23 days ago on 2026-02-23

About

Detects the first time a Python process creates or modifies a LaunchAgent or LaunchDaemon plist file on a given host. Malicious Python scripts, compromised dependencies, or model file deserialization can establish persistence on macOS by writing plist files to LaunchAgent or LaunchDaemon directories. Legitimate Python processes do not typically create persistence mechanisms, so a first occurrence is a strong indicator of compromise.
Tags
Domain: EndpointOS: macOSUse Case: Threat DetectionTactic: PersistenceData Source: Elastic DefendDomain: LLMLanguage: kuery
Severity
medium
Risk Score
47
MITRE ATT&CK™

Persistence (TA0003)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
New Terms Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.persistence-*
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
host.os.type:macos and event.action:"launch_daemon" and process.name:python*

Install detection rules in Elastic Security

Detect First Time Python Created a LaunchAgent or LaunchDaemon in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).