Execution (TA0002)(external, opens in a new tab or window)
Privilege Escalation (TA0004)(external, opens in a new tab or window)
text code block:process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "executed") and ( ( process.name in ("ctr", "crictl", "nerdctl") and ( (process.args == "tasks" and process.args == "exec") or (process.args == "run" and process.args in ("--privileged", "--rm", "--mount", "--net-host", "--pid-host")) or (process.args == "snapshots" and process.args == "mount") ) ) or ( (process.executable like ("/dev/shm/*", "/tmp/*", "/var/tmp/*") or process.name : ".*") and process.args like ("*containerd.sock*", "k8s.io") ) ) and not process.parent.executable in ( "/usr/bin/kubelet", "/usr/local/bin/kubelet", "/usr/bin/containerd", "/usr/sbin/containerd", "/lib/systemd/systemd", "/usr/lib/systemd/systemd", "/sbin/init" )
Install detection rules in Elastic Security
Detect Container Runtime CLI Execution with Suspicious Arguments 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).