Skip to content

Commit a3477e4

Browse files
committed
per integrations team guidance use data_stream.dataset instead of event.dataset
1 parent e51208c commit a3477e4

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

detection_rules/beats.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,21 @@ def get_datasets_and_modules(tree: eql.ast.BaseNode | kql.ast.BaseNode) -> tuple
267267
modules.add(node.right.render()) # type: ignore[reportUnknownMemberType]
268268
elif node.left == eql.ast.Field("event", ["dataset"]):
269269
datasets.add(node.right.render()) # type: ignore[reportUnknownMemberType]
270+
elif node.left == eql.ast.Field("data_stream", ["dataset"]):
271+
datasets.add(node.right.render()) # type: ignore[reportUnknownMemberType]
270272
elif isinstance(node, eql.ast.InSet):
271273
if node.expression == eql.ast.Field("event", ["module"]):
272274
modules.update(node.get_literals()) # type: ignore[reportUnknownMemberType]
273275
elif node.expression == eql.ast.Field("event", ["dataset"]):
274276
datasets.update(node.get_literals()) # type: ignore[reportUnknownMemberType]
277+
elif node.expression == eql.ast.Field("data_stream", ["dataset"]):
278+
datasets.update(node.get_literals()). # type: ignore[reportUnknownMemberType]
275279
elif isinstance(node, kql.ast.FieldComparison) and node.field == kql.ast.Field("event.module"): # type: ignore[reportUnknownMemberType]
276280
modules.update(child.value for child in node.value if isinstance(child, kql.ast.String)) # type: ignore[reportUnknownMemberType, reportUnknownVariableType]
277281
elif isinstance(node, kql.ast.FieldComparison) and node.field == kql.ast.Field("event.dataset"): # type: ignore[reportUnknownMemberType]
278282
datasets.update(child.value for child in node.value if isinstance(child, kql.ast.String)) # type: ignore[reportUnknownMemberType, reportUnknownVariableType]
283+
elif isinstance(node, kql.ast.FieldComparison) and node.field == kql.ast.Field("data_stream.dataset"): # type: ignore[reportUnknownMemberType]
284+
datasets.update(child.value for child in node.value if isinstance(child, kql.ast.String)) # type: ignore[reportUnknownMemberType]
279285

280286
return datasets, modules
281287

rules/promotions/crowdstrike_external_alerts.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ This rule is designed to capture alert events generated by the CrowdStrike integ
6161
6262
To capture CrowdStrike alerts, install and configure the CrowdStrike integration to ingest alert events into the `logs-crowdstrike.alert-*` index pattern.
6363
64-
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same CrowdStrike events. Consider adding a rule exception for the External Alert rule to exclude event.dataset:crowdstrike.alert to avoid receiving duplicate alerts.
64+
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same CrowdStrike events. Consider adding a rule exception for the External Alert rule to exclude data_stream.dataset:crowdstrike.alert to avoid receiving duplicate alerts.
6565
6666
### Additional notes
6767
@@ -73,7 +73,7 @@ timestamp_override = "event.ingested"
7373
type = "query"
7474

7575
query = '''
76-
event.kind: alert and event.dataset: crowdstrike.alert
76+
event.kind: alert and data_stream.dataset: crowdstrike.alert
7777
'''
7878

7979
[[rule.risk_score_mapping]]

rules/promotions/elastic_security_external_alerts.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This rule is designed to capture alert events generated by the Elastic Security
6464
6565
To capture Elastic Security alerts, install and configure the Elastic Security integration to ingest alert events into the `logs-elastic_security.alert-*` index pattern.
6666
67-
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same Elastic Security events. Consider adding a rule exception for the External Alert rule to exclude event.dataset:elastic_security.alert to avoid receiving duplicate alerts.
67+
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same Elastic Security events. Consider adding a rule exception for the External Alert rule to exclude data_stream.dataset:elastic_security.alert to avoid receiving duplicate alerts.
6868
6969
### Additional notes
7070
@@ -76,7 +76,7 @@ timestamp_override = "event.ingested"
7676
type = "query"
7777

7878
query = '''
79-
event.kind: alert and event.dataset: elastic_security.alert
79+
event.kind: alert and data_stream.dataset: elastic_security.alert
8080
'''
8181

8282

rules/promotions/google_secops_external_alerts.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This rule is designed to capture alert events generated by the Google SecOps int
6363
6464
To capture Google SecOps alerts, install and configure the Google SecOps integration to ingest alert events into the `logs-google_secops.alert-*` index pattern.
6565
66-
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same SecOps events. Consider adding a rule exception for the External Alert rule to exclude event.dataset:google_secops.alert to avoid receiving duplicate alerts.
66+
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same SecOps events. Consider adding a rule exception for the External Alert rule to exclude data_stream.dataset:google_secops.alert to avoid receiving duplicate alerts.
6767
6868
### Additional notes
6969
@@ -75,7 +75,7 @@ timestamp_override = "event.ingested"
7575
type = "query"
7676

7777
query = '''
78-
event.kind: alert and event.dataset: google_secops.alert
78+
event.kind: alert and data_stream.dataset: google_secops.alert
7979
'''
8080

8181
[[rule.risk_score_mapping]]

rules/promotions/microsoft_sentinel_external_alerts.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This rule is designed to capture alert events generated by the Microsoft Sentine
6262
6363
To capture Microsoft Sentinel alerts, install and configure the Microsoft Sentinel integration to ingest alert events into the `logs-microsoft_sentinel.alert-*` index pattern.
6464
65-
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same Sentinel events. Consider adding a rule exception for the External Alert rule to exclude event.dataset:(sentinel_one.alert or sentinel_one.threat) to avoid receiving duplicate alerts.
65+
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same Sentinel events. Consider adding a rule exception for the External Alert rule to exclude data_stream.dataset:microsoft_sentinel.alert to avoid receiving duplicate alerts.
6666
6767
### Additional notes
6868
@@ -74,7 +74,7 @@ timestamp_override = "event.ingested"
7474
type = "query"
7575

7676
query = '''
77-
event.kind: alert and event.dataset: microsoft_sentinel.alert
77+
event.kind: alert and data_stream.dataset: microsoft_sentinel.alert
7878
'''
7979

8080
[[rule.risk_score_mapping]]

rules/promotions/sentinelone_external_alerts.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This rule is designed to capture alert events generated by the SentinelOne integ
6363
6464
To capture SentinelOne alerts, install and configure the SentinelOne integration to ingest alert events into the `logs-sentinel_one.alert-*` index pattern.
6565
66-
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same SentinelOne events. Consider adding a rule exception for the External Alert rule to exclude event.dataset:microsoft_sentinel.alert to avoid receiving duplicate alerts.
66+
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same SentinelOne events. Consider adding a rule exception for the External Alert rule to exclude datastream.dataset: (sentinel_one.alert or sentinel_one.threat) to avoid receiving duplicate alerts.
6767
6868
### Additional notes
6969
@@ -75,7 +75,7 @@ timestamp_override = "event.ingested"
7575
type = "query"
7676

7777
query = '''
78-
event.kind: alert and event.dataset: (sentinel_one.alert or sentinel_one.threat)
78+
event.kind: alert and data_stream.dataset: sentinel_one.threat or event.kind: event and data_stream.dataset: sentinel_one.alert
7979
'''
8080

8181

rules/promotions/splunk_external_alerts.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This rule is designed to capture alert events generated by the Splunk integratio
6363
6464
To capture Splunk alerts, install and configure the Splunk integration to ingest alert events into the `logs-splunk.alert-*` index pattern.
6565
66-
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same Splunk events. Consider adding a rule exception for the External Alert rule to exclude event.module:splunk to avoid receiving duplicate alerts.
66+
If this rule is enabled alongside the External Alerts promotion rule (UUID: eb079c62-4481-4d6e-9643-3ca499df7aaa), you may receive duplicate alerts for the same Splunk events. Consider adding a rule exception for the External Alert rule to exclude data_stream.dataset:splunk.alert to avoid receiving duplicate alerts.
6767
6868
### Additional notes
6969
@@ -75,7 +75,7 @@ timestamp_override = "event.ingested"
7575
type = "query"
7676

7777
query = '''
78-
event.kind: alert and event.module: splunk
78+
event.kind: alert and data_stream.dataset: splunk.alert
7979
'''
8080

8181

0 commit comments

Comments
 (0)