sequence by host.id with maxspan=1m
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
process.name in ("gcc", "g++", "cc")] by process.args
[file where host.os.type == "linux" and event.action == "creation" and process.name == "ld"] by file.name
[process where host.os.type == "linux" and event.type == "start" and event.action == "exec"] by process.name
[network where host.os.type == "linux" and event.action == "connection_attempted" and destination.ip != null and not (
cidrmatch(destination.ip, "127.0.0.0/8", "169.254.0.0/16", "224.0.0.0/4", "::1") or
process.name in ("simpleX", "conftest", "ssh", "python", "ispnull", "pvtui", "npreal2d", "ruby", "source", "ssh")
)] by process.name
Install detection rules in Elastic Security
Detect Network Connection via Recently Compiled Executable 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(opens in a new tab or window).