Skip to content

Commit 703b4e6

Browse files
Merge branch '4517-bug-dac-detection_rules-help-texts-are-cut-off' of github.com:elastic/detection-rules into 4517-bug-dac-detection_rules-help-texts-are-cut-off
2 parents 39cd627 + c0e9653 commit 703b4e6

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[metadata]
2+
creation_date = "2025/02/25"
3+
maturity = "production"
4+
updated_date = "2025/02/25"
5+
min_stack_comments = "ES|QL rule type is still in technical preview as of 8.13, however this rule was tested successfully; integration in tech preview"
6+
min_stack_version = "8.13.0"
7+
8+
[rule]
9+
author = ["Elastic"]
10+
description = """
11+
Detects patterns indicative of Denial-of-Service (DoS) attacks on machine learning (ML) models, focusing on unusually high volume and frequency
12+
of requests or patterns of requests that are known to cause performance degradation or service disruption, such as
13+
large input sizes or rapid API calls.
14+
"""
15+
false_positives = ["Unexpected system errors", "Legitimate spikes in usage due to business processes"]
16+
from = "now-60m"
17+
interval = "10m"
18+
language = "esql"
19+
license = "Elastic License v2"
20+
name = "Potential Denial of Azure OpenAI ML Service"
21+
references = [
22+
"https://genai.owasp.org/llmrisk/llm04-model-denial-of-service",
23+
"https://atlas.mitre.org/techniques/AML.T0029"
24+
]
25+
risk_score = 47
26+
rule_id = "b0450411-46e5-46d2-9b35-8b5dd9ba763e"
27+
setup = """## Setup
28+
29+
For more information on streaming events, see the Azure OpenAI documentation:
30+
31+
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/stream-monitoring-data-event-hubs
32+
"""
33+
severity = "medium"
34+
tags = [
35+
"Domain: LLM",
36+
"Data Source: Azure OpenAI",
37+
"Data Source: Azure Event Hubs",
38+
"Use Case: Denial of Service",
39+
"Mitre Atlas: T0029"
40+
]
41+
timestamp_override = "event.ingested"
42+
type = "esql"
43+
44+
query = '''
45+
from logs-azure_openai.logs-*
46+
// truncate the timestamp to a 1-minute window
47+
| eval target_time_window = DATE_TRUNC(1 minutes, @timestamp)
48+
| where azure.open_ai.operation_name == "ChatCompletions_Create"
49+
| keep azure.open_ai.properties.request_length, azure.resource.name, cloud.account.id,target_time_window
50+
| stats count = count(), avg_request_size = avg(azure.open_ai.properties.request_length) by target_time_window, azure.resource.name
51+
| where count >= 10 and avg_request_size >= 5000
52+
| sort count desc
53+
'''
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[metadata]
2+
creation_date = "2025/02/25"
3+
maturity = "production"
4+
updated_date = "2025/02/25"
5+
min_stack_comments = "ES|QL rule type is still in experimental as of 8.13, however this rule was tested successfully; integration in experimental"
6+
min_stack_version = "8.13.0"
7+
8+
[rule]
9+
author = ["Elastic"]
10+
description = """
11+
Detects when Azure OpenAI requests result in zero response length, potentially indicating issues in output handling
12+
that might lead to security exploits such as data leaks or code execution. This can occur in cases where the API fails
13+
to handle outputs correctly under certain input conditions.
14+
"""
15+
false_positives = ["Queries that are designed to expect empty responses or benign system errors"]
16+
from = "now-60m"
17+
interval = "10m"
18+
language = "esql"
19+
license = "Elastic License v2"
20+
name = "Azure OpenAI Insecure Output Handling"
21+
references = [
22+
"https://genai.owasp.org/llmrisk/llm02-insecure-output-handling"
23+
]
24+
risk_score = 21
25+
rule_id = "fb16f9ef-cb03-4234-adc2-44641f3b71ee"
26+
setup = """## Setup
27+
28+
For more information on streaming events, see the Azure OpenAI documentation:
29+
30+
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/stream-monitoring-data-event-hubs
31+
"""
32+
severity = "low"
33+
tags = [
34+
"Domain: LLM",
35+
"Data Source: Azure OpenAI",
36+
"Data Source: Azure Event Hubs",
37+
"Use Case: Insecure Output Handling"
38+
]
39+
timestamp_override = "event.ingested"
40+
type = "esql"
41+
42+
query = '''
43+
from logs-azure_openai.logs-*
44+
| where azure.open_ai.properties.response_length == 0 and azure.open_ai.result_signature == "200" and azure.open_ai.operation_name == "ChatCompletions_Create"
45+
| keep azure.open_ai.properties.request_length, azure.open_ai.result_signature, cloud.account.id, azure.resource.name
46+
| stats count = count() by azure.resource.name
47+
| where count >= 10
48+
| sort count desc
49+
'''
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[metadata]
2+
creation_date = "2025/02/25"
3+
maturity = "production"
4+
updated_date = "2025/02/25"
5+
min_stack_comments = "ES|QL rule type is still in technical preview as of 8.13, however this rule was tested successfully; integration in tech preview"
6+
min_stack_version = "8.13.0"
7+
8+
[rule]
9+
author = ["Elastic"]
10+
description = """
11+
Monitors for suspicious activities that may indicate theft or unauthorized duplication of machine learning (ML) models, such as
12+
unauthorized API calls, atypical access patterns, or large data transfers that are unusual during model interactions.
13+
"""
14+
false_positives = ["Authorized model training", "Legitimate high volume data exchanges during scheduled updates"]
15+
from = "now-60m"
16+
interval = "10m"
17+
language = "esql"
18+
license = "Elastic License v2"
19+
name = "Potential Azure OpenAI Model Theft"
20+
references = [
21+
"https://genai.owasp.org/llmrisk/llm10-model-theft",
22+
"https://atlas.mitre.org/techniques/AML.T0044"
23+
]
24+
risk_score = 47
25+
rule_id = "4021e78d-5293-48d3-adee-a70fa4c18fab"
26+
setup = """## Setup
27+
28+
For more information on
29+
streaming events, see the Azure OpenAI documentation:
30+
31+
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/stream-monitoring-data-event-hubs
32+
"""
33+
severity = "medium"
34+
tags = [
35+
"Domain: LLM",
36+
"Data Source: Azure OpenAI",
37+
"Data Source: Azure Event Hubs",
38+
"Use Case: Model Theft",
39+
"Mitre Atlas: T0044"
40+
]
41+
timestamp_override = "event.ingested"
42+
type = "esql"
43+
44+
query = '''
45+
from logs-azure_openai.logs-*
46+
| where azure.open_ai.operation_name == "ListKey" and azure.open_ai.category == "Audit"
47+
| KEEP @timestamp, azure.open_ai.operation_name , azure.open_ai.category, azure.resource.group, azure.resource.name, azure.open_ai.properties.response_length
48+
| stats count = count(), max_data_transferred = max(azure.open_ai.properties.response_length) by azure.resource.group , azure.resource.name
49+
| where count >= 100 or max_data_transferred >= 1000000
50+
| sort count desc
51+
'''

0 commit comments

Comments
 (0)