text code block:event.category:process and host.os.type:(linux or macos) and event.action:exec and ( (process.name:"dscl" and process.args:(/Active*Directory/* or /Users* or /Groups*)) or (process.name:"dscacheutil" and process.args:("user" or "group")) or (process.name:"getent" and process.args:("passwd" or "group") and process.args_count >= 3) ) and not ( process.parent.executable:( "/usr/lib/ocf/resource.d/cyanconnode/mysql" or /snap/* or "/usr/bin/check_mk_agent" or "/usr/bin/cloudflared" or /opt/puppetlabs/* or /var/lib/snapd/* or "/usr/lib/google/guest_agent/core_plugin" or "/opt/rudder/bin/cf-agent" or "/opt/NinjaRMMAgent/programfiles/ninjarmm-linagent" ) or process.working_directory:( /var/snap/* or "/Applications/NinjaRMMAgent/programfiles/ninjarmm-macagent" or "/var/lib/nanitor/agent" or "/var/ossec" or /opt/rapid7/* or "/opt/Tanium/TaniumClient" ) )
Install detection rules in Elastic Security
Detect Account or Group Discovery via Built-In Tools 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).