text code block:process where host.os.type == "macos" and event.type in ("start", "process_started") and ( process.name in ("ldapsearch", "dsmemberutil") or (process.name == "dscl" and process.args in ("read", "-read", "list", "-list", "ls", "search", "-search") and process.args like ("/Active Directory/*", "/Users*", "/Groups*")) ) and ((process.Ext.effective_parent.executable like "/Volumes/*" or process.parent.executable like "/Volumes/*") or (process.Ext.effective_parent.name : ".*" or process.parent.name : ".*") or (process.parent.code_signature.trusted == false or process.parent.code_signature.exists == false))
Install detection rules in Elastic Security
Detect Enumeration of Users or Groups via Built-in Commands 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).