Skip to content

Commit a315cf1

Browse files
author
Ruben van Vreeland
committed
Update template rules
Volumetric is called suspicious Place index bitsensor before filter Make realert interval sane
1 parent 33e656a commit a315cf1

File tree

4 files changed

+26
-31
lines changed

4 files changed

+26
-31
lines changed

rule_templates/detection_template.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# Alert when there is new detection event in the last 5 seconds
1+
# Rule name, must be unique
2+
name: Alert on any detection
23

34
# Index to search, wildcard supported
45
index: bitsensor
56
timestamp_field: endpoint.localtime
67

7-
# Rule name, must be unique
8-
name: Alert on All detection
9-
108
# Type of alert.
119
type: any
1210
realert:

rule_templates/relevant_attack_template.yaml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
# Alert when a new combination of attacker ip, userAgent and detection type comes up during the period of 10 days.
2-
31
# Index to search, wildcard supported
4-
name: Relevant attack alert
5-
timestamp_field: endpoint.localtime
2+
name: New attacker
63

74
# Type of alert.
8-
type: new_term
9-
10-
# Index to search, wildcard supported
11-
index: bitsensor
5+
type: any
126

13-
# (Required, new_term specific)
14-
# Monitor the fields. NOTE: include unique application name.
15-
fields:
7+
query_key:
168
- "context.ip"
179
- "context.http.userAgent"
18-
- "detections.type"
10+
11+
realert:
12+
hours: 1
1913

2014
# (Optional, new_term specific)
2115
# This means that we will query 10 days worth of data when ElastAlert starts to find which values of ip_address already exist
@@ -25,10 +19,14 @@ terms_window_size:
2519

2620
alert_on_missing_field: true
2721

22+
# Index to search, wildcard supported
23+
index: bitsensor
24+
timestamp_field: endpoint.localtime
25+
2826
filter:
2927
- query:
3028
query_string:
31-
query: "_exists_:detections"
29+
query: "_exists_:detections AND detections.relevant:true"
3230

3331
include:
3432
- endpoint.location

rule_templates/successful_attack_template.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# Alert when there is a succesful attack
2-
3-
# Index to search, wildcard supported
4-
index: bitsensor
5-
timestamp_field: endpoint.localtime
6-
71
# Rule name, must be unique
82
name: Alert on Successful Attack
93

104
# Type of alert.
115
type: any
6+
127
realert:
138
seconds: 0
149

10+
# Index to search, wildcard supported
11+
index: bitsensor
12+
timestamp_field: endpoint.localtime
13+
1514
# A list of elasticsearch filters used for find events
1615
# These filters are joined with AND and nested in a filtered query
1716
# For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html

rule_templates/volumetric_alert.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Alert when there are 500 discovery detection events coming from the same ip, userAgent within 30 seconds.
22

3-
# Index to search, wildcard supported
4-
index: bitsensor
5-
timestamp_field: endpoint.localtime
6-
73
# Rule name, must be unique
8-
name: Alert on high frequency
4+
name: Behaviour is suspicious
95

106
# Type of alert.
117
type: frequency
128

139
# Alert when this many documents matching the query occur within a timeframe
14-
num_events: 500
10+
num_events: 100
1511

1612
# num_events must occur within this amount of time to trigger an alert
1713
timeframe:
18-
seconds: 30
14+
seconds: 60
15+
16+
# Index to search, wildcard supported
17+
index: bitsensor
18+
timestamp_field: endpoint.localtime
1919

2020
query_key:
2121
- context.ip
@@ -27,7 +27,7 @@ query_key:
2727
filter:
2828
- query:
2929
query_string:
30-
query: "detections.type:discovery"
30+
query: "_exists_:detections AND detections.reason:BEHAVIOUR"
3131

3232
include:
3333
- endpoint.location

0 commit comments

Comments
 (0)