@@ -13,7 +13,8 @@ This rule detects a high number of egress network connections from an unusual ex
1313This could indicate a command and control (C2) communication attempt, a brute force attack via a malware
1414infection or other malicious activity.
1515"""
16- from = " now-9m"
16+ from = " now-61m"
17+ interval = " 1h"
1718language = " esql"
1819license = " Elastic License v2"
1920name = " High Number of Egress Network Connections from Unusual Executable"
@@ -56,7 +57,8 @@ timestamp_override = "event.ingested"
5657type = " esql"
5758query = '''
5859from logs-endpoint.events.network-*
59- | keep @timestamp, host.os.type, event.type, event.action, process.name, process.executable, destination.ip, process.entity_id, agent.id
60+ | keep @timestamp, host.os.type, event.type, event.action, process.name, process.executable, destination.ip, agent.id
61+ | where @timestamp > now() - 1 hours
6062| where host.os.type == "linux" and event.type == "start" and event.action == "connection_attempted" and (
6163 (
6264 process.executable like "/tmp/*" or
@@ -76,7 +78,7 @@ from logs-endpoint.events.network-*
7678 process.executable like "/tmp/.mount*" or
7779 process.executable like "/tmp/go-build*"
7880 )
79- | stats cc = count(), agent_count = count_distinct(agent.id) by process.executable, process.entity_id
81+ | stats cc = count(), agent_count = count_distinct(agent.id) by process.executable
8082| where agent_count == 1 and cc > 15
8183| sort cc asc
8284| limit 100
0 commit comments