Skip to content

Commit 72a2b44

Browse files
authored
[Rule Tuning] Interval fix + Datastream values to ESQL Rules (#5413)
* [Rule Tuning] Interval fix + Datastream values to ESQL Rules * Update persistence_web_server_potential_command_injection.toml
1 parent b8aedcd commit 72a2b44

5 files changed

+32
-19
lines changed

rules/cross-platform/persistence_web_server_potential_command_injection.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/11/19"
33
integration = ["nginx", "apache", "apache_tomcat", "iis"]
44
maturity = "production"
5-
updated_date = "2025/12/01"
5+
updated_date = "2025/12/05"
66

77
[rule]
88
author = ["Elastic"]
@@ -13,7 +13,7 @@ applications to inject and execute arbitrary commands on the server, often using
1313
PHP, or shell commands. By monitoring for these indicators in web traffic, security teams can identify and respond to
1414
potential threats early.
1515
"""
16-
from = "now-9m"
16+
from = "now-11m"
1717
interval = "10m"
1818
language = "esql"
1919
license = "Elastic License v2"
@@ -115,7 +115,8 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
115115
http.response.status_code,
116116
user_agent.original,
117117
host.name,
118-
event.dataset
118+
event.dataset,
119+
data_stream.namespace
119120
120121
| stats
121122
Esql.event_count = count(),
@@ -129,6 +130,7 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
129130
Esql.http.response.status_code_values = values(http.response.status_code),
130131
Esql.user_agent_original_values = values(user_agent.original),
131132
Esql.event_dataset_values = values(event.dataset),
133+
Esql.data_stream_namespace_values = values(data_stream.namespace),
132134
133135
// Rule Specific fields
134136
Esql.any_payload_keyword_max = max(Esql.any_payload_keyword),

rules/cross-platform/reconnaissance_web_server_discovery_or_fuzzing_activity.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/11/19"
33
integration = ["nginx", "apache", "apache_tomcat", "iis"]
44
maturity = "production"
5-
updated_date = "2025/12/01"
5+
updated_date = "2025/12/05"
66

77
[rule]
88
author = ["Elastic"]
@@ -11,7 +11,7 @@ This rule detects potential web server discovery or fuzzing activity by identify
1111
in 404 or 403 status codes from a single source IP address within a short timeframe. Such patterns may indicate that an attacker
1212
is attempting to discover hidden or unlinked resources on a web server, which can be a precursor to more targeted attacks.
1313
"""
14-
from = "now-9m"
14+
from = "now-11m"
1515
interval = "10m"
1616
language = "esql"
1717
license = "Elastic License v2"
@@ -78,7 +78,9 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
7878
source.ip,
7979
agent.id,
8080
host.name,
81-
Esql.url_original_to_lower
81+
Esql.url_original_to_lower,
82+
data_stream.namespace
83+
8284
| stats
8385
Esql.event_count = count(),
8486
Esql.url_original_count_distinct = count_distinct(Esql.url_original_to_lower),
@@ -87,7 +89,8 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
8789
Esql.http_request_method_values = values(http.request.method),
8890
Esql.http_response_status_code_values = values(http.response.status_code),
8991
Esql.url_original_values = values(Esql.url_original_to_lower),
90-
Esql.event_dataset_values = values(event.dataset)
92+
Esql.event_dataset_values = values(event.dataset),
93+
Esql.data_stream_namespace_values = values(data_stream.namespace)
9194
by source.ip
9295
| where
9396
Esql.event_count > 500 and Esql.url_original_count_distinct > 250

rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_logs.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/11/19"
33
integration = ["nginx", "apache", "apache_tomcat", "iis"]
44
maturity = "production"
5-
updated_date = "2025/12/01"
5+
updated_date = "2025/12/05"
66

77
[rule]
88
author = ["Elastic"]
@@ -12,7 +12,7 @@ as vulnerability scanning or fuzzing attempts by adversaries. These activities o
1212
responses as they probe for weaknesses in web applications. Error response codes may potentially indicate server-side
1313
issues that could be exploited.
1414
"""
15-
from = "now-9m"
15+
from = "now-11m"
1616
interval = "10m"
1717
language = "esql"
1818
license = "Elastic License v2"
@@ -71,13 +71,16 @@ from logs-nginx.error-*, logs-apache_tomcat.error-*, logs-apache.error-*, logs-i
7171
event.dataset,
7272
source.ip,
7373
agent.id,
74-
host.name
74+
host.name,
75+
data_stream.namespace
76+
7577
| where source.ip is not null
7678
| stats
7779
Esql.event_count = count(),
7880
Esql.host_name_values = values(host.name),
7981
Esql.agent_id_values = values(agent.id),
80-
Esql.event_dataset_values = values(event.dataset)
82+
Esql.event_dataset_values = values(event.dataset),
83+
Esql.data_stream_namespace_values = values(data_stream.namespace)
8184
by source.ip, agent.id
8285
| where
8386
Esql.event_count > 50

rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_response_codes.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/11/19"
33
integration = ["nginx", "apache", "apache_tomcat", "iis"]
44
maturity = "production"
5-
updated_date = "2025/12/01"
5+
updated_date = "2025/12/05"
66

77
[rule]
88
author = ["Elastic"]
@@ -12,7 +12,7 @@ reconnaissance activities such as vulnerability scanning or fuzzing attempts by
1212
generate a high volume of error responses as they probe for weaknesses in web applications. Error response codes
1313
may potentially indicate server-side issues that could be exploited.
1414
"""
15-
from = "now-9m"
15+
from = "now-11m"
1616
interval = "10m"
1717
language = "esql"
1818
license = "Elastic License v2"
@@ -84,7 +84,9 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
8484
source.ip,
8585
agent.id,
8686
host.name,
87-
Esql.url_original_to_lower
87+
Esql.url_original_to_lower,
88+
data_stream.namespace
89+
8890
| stats
8991
Esql.event_count = count(),
9092
Esql.http_response_status_code_count = count(http.response.status_code),
@@ -94,7 +96,8 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
9496
Esql.http_request_method_values = values(http.request.method),
9597
Esql.http_response_status_code_values = values(http.response.status_code),
9698
Esql.url_path_values = values(Esql.url_original_to_lower),
97-
Esql.event_dataset_values = values(event.dataset)
99+
Esql.event_dataset_values = values(event.dataset),
100+
Esql.data_stream_namespace_values = values(data_stream.namespace)
98101
by source.ip, agent.id
99102
| where
100103
Esql.http_response_status_code_count > 10

rules/cross-platform/reconnaissance_web_server_unusual_user_agents.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/11/19"
33
integration = ["nginx", "apache", "apache_tomcat", "iis"]
44
maturity = "production"
5-
updated_date = "2025/12/01"
5+
updated_date = "2025/12/05"
66

77
[rule]
88
author = ["Elastic"]
@@ -11,7 +11,7 @@ This rule detects unusual spikes in web server requests with uncommon or suspici
1111
indicate reconnaissance attempts by attackers trying to identify vulnerabilities in web applications or servers. These
1212
user-agents are often associated with automated tools used for scanning, vulnerability assessment, or brute-force attacks.
1313
"""
14-
from = "now-9m"
14+
from = "now-11m"
1515
interval = "10m"
1616
language = "esql"
1717
license = "Elastic License v2"
@@ -101,15 +101,17 @@ from logs-nginx.access-*, logs-apache.access-*, logs-apache_tomcat.access-*, log
101101
agent.id,
102102
host.name,
103103
Esql.url_original_to_lower,
104-
Esql.user_agent_original_to_lower
104+
Esql.user_agent_original_to_lower,
105+
data_stream.namespace
105106
| stats
106107
Esql.event_count = count(),
107108
Esql.url_original_count_distinct = count_distinct(Esql.url_original_to_lower),
108109
Esql.host_name_values = values(host.name),
109110
Esql.agent_id_values = values(agent.id),
110111
Esql.url_original_values = values(Esql.url_original_to_lower),
111112
Esql.user_agent_original_values = values(Esql.user_agent_original_to_lower),
112-
Esql.event_dataset_values = values(event.dataset)
113+
Esql.event_dataset_values = values(event.dataset),
114+
Esql.data_stream_namespace_values = values(data_stream.namespace)
113115
by source.ip, agent.id
114116
| where
115117
Esql.event_count > 50 and Esql.url_original_count_distinct > 10

0 commit comments

Comments
 (0)