Skip to content

Commit b3167d6

Browse files
author
Khanh Nguyen
committed
Updated detection rule template to use enhancement module
1 parent cb0b294 commit b3167d6

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

rule_templates/detection_template.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,28 @@ include:
2424
- context.http.userAgent
2525
- context.ip
2626
- context.php.session.sessionId
27-
- detections.type
28-
- detections.name
27+
- detections
2928
- meta.user
3029

31-
alert_subject: "Detection on {}"
30+
31+
# Enhancement for converting 'detections' array into object, ex. get merged detection type by
32+
# 'detections_parsed.type' or get first detection type by 'detection_parsed.0.type'
33+
match_enhancements:
34+
- "elastalert_modules.bitsensor_enhancement.AlertTextEnhancement"
35+
run_enhancements_first: true
36+
37+
38+
alert_subject: ":exclamation: Detection on {}"
3239
alert_subject_args:
3340
- endpoint.name
3441

3542
alert_text_type: alert_text_only
36-
alert_text: "Detection triggered at {}\n\nAttacker:\nIP: {} \nUser-Agent: {}\n\n:Id: {}\nUser: {}"
43+
alert_text: "Triggered at _{}_\n\n*Attacker:*\nIP: {} \nUser-Agent: {}\nDetection: `{}`\n\n:Id: {}\nUser: {}"
3744
alert_text_args:
3845
- endpoint.localtime
3946
- context.ip
4047
- context.http.userAgent
48+
- detections_parsed.type
4149
- _id
4250
- meta.user
4351

0 commit comments

Comments
 (0)