Persistence (TA0003)(external, opens in a new tab or window)
Defense Evasion (TA0005)(external, opens in a new tab or window)
text code block:file where host.os.type == "macos" and event.type != "deletion" and file.path like~ ( "/System/Library/LaunchAgents/.*.plist", "/Library/LaunchAgents/.*.plist", "/Users/*/Library/LaunchAgents/.*.plist", "/System/Library/LaunchDaemons/.*.plist", "/Library/LaunchDaemons/.*.plist" ) and not (file.name like ".chef-com*.plist" and process.executable like "/opt/chef/embedded/bin/ruby") and not (process.executable in ("/usr/bin/sed", "/bin/bash") and file.name like ".!*!*.plist")
Install detection rules in Elastic Security
Detect Persistence via a Hidden Plist Filename 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).