Skip to content

Commit da5d4cb

Browse files
author
Ruben van Vreeland
committed
Reformat volumetric and relevant template
Signed-off-by: Ruben van Vreeland <[email protected]>
1 parent 5c3656b commit da5d4cb

File tree

2 files changed

+84
-60
lines changed

2 files changed

+84
-60
lines changed
Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,74 @@
11
# Index to search, wildcard supported
2-
name: New attacker
2+
name: Known Attacks
33

4-
# Type of alert.
4+
# Alert on each event
55
type: any
66

7-
query_key:
8-
- "context.ip"
9-
- "context.http.userAgent"
10-
11-
realert:
12-
hours: 1
13-
14-
# (Optional, new_term specific)
15-
# This means that we will query 10 days worth of data when ElastAlert starts to find which values of ip_address already exist
16-
# If they existed in the last 10 days, no alerts will be triggered for them when they appear
17-
terms_window_size:
18-
days: 10
19-
20-
alert_on_missing_field: true
21-
22-
# Index to search, wildcard supported
23-
index: bitsensor
24-
timestamp_field: endpoint.localtime
25-
7+
# A list of elasticsearch filters used for find events
8+
# These filters are joined with AND and nested in a filtered query
9+
# For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
2610
filter:
2711
- query:
2812
query_string:
29-
query: "_exists_:detections AND detections.relevant:true"
13+
query: "detections.reason:KNOWN_ATTACK"
14+
15+
index: bitsensor-detections-*
16+
timestamp_field: endpoint.localtime
3017

18+
# When the attacker continues, send a new alert after x minutes
19+
realert:
20+
minutes: 10
21+
22+
# Index to search, wildcard supported
3123
include:
3224
- endpoint.location
3325
- endpoint.name
3426
- context.http.userAgent
3527
- context.ip
3628
- context.php.session.sessionId
37-
- detections.type
38-
- detections.name
29+
- detections
3930

40-
alert_subject: "Relevant attack on {}"
31+
alert_subject: "Attack on <{}> of type {} | <{}|Show Dashboard>"
4132
alert_subject_args:
4233
- endpoint.name
34+
- detections_parsed.type
35+
- kibana_link
36+
37+
alert_text: |-
38+
An attack on {} is detected.
39+
Detection name: {}
40+
Detection type: {}
41+
42+
The attacker looks like:
43+
IP: {}
44+
User-Agent: {}
4345
44-
alert_text_type: alert_text_only
45-
alert_text: "New relevant attacker at {}\nIP: {} \nUser-Agent: {}\nDetection name: {}\nDetection type: {}\n\nID: {}\nUser: {}"
4646
alert_text_args:
47-
- endpoint.localtime
47+
- endpoint.name
48+
- detections_parsed.name
49+
- detections_parsed.type
4850
- context.ip
4951
- context.http.userAgent
50-
- detections.name
51-
- detections.type
52-
- _id
53-
- meta.user
54-
5552

56-
# The alert is use when a match is found
53+
# Specify your services here
5754
alert:
5855
- slack
56+
57+
# How To Generate your API:
58+
# Click on your Workspace name (upper left corner)
59+
# Go to "Manage Apps", then "Custom Integrations", "Incoming Webhooks"
60+
# Press "Add Configuration", and choose your channel. Now paste it here:
5961
slack_webhook_url: "https://hooks.slack.com/services/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"
60-
slack_username_override: "ElastAlert"
62+
slack_username_override: "BitSensor Alerting"
63+
64+
# Alert body only cointains a title and text
65+
alert_text_type: alert_text_only
66+
67+
# Link to BitSensor Kibana Dashboard
68+
use_kibana4_dashboard: "https://dev.bitsensor.io/app/kibana#/dashboard/Live-Hacking"
69+
70+
# Enhancement for converting 'detections' array into object, ex. get merged detection type by
71+
# 'detections_parsed.type' or get first detection type by 'detection_parsed.0.type'
72+
match_enhancements:
73+
- "elastalert_modules.bitsensor_enhancement.AlertTextEnhancement"
74+
run_enhancements_first: true
Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,70 @@
1-
# Alert when there are 500 discovery detection events coming from the same ip, userAgent within 30 seconds.
2-
31
# Rule name, must be unique
4-
name: Behaviour is suspicious
2+
name: Bad/Bot Behaviour
53

6-
# Type of alert.
4+
# Alert on x events in y seconds
75
type: frequency
86

97
# Alert when this many documents matching the query occur within a timeframe
10-
num_events: 100
8+
num_events: 20
119

1210
# num_events must occur within this amount of time to trigger an alert
1311
timeframe:
14-
seconds: 60
15-
16-
# Index to search, wildcard supported
17-
index: bitsensor
18-
timestamp_field: endpoint.localtime
19-
20-
query_key:
21-
- context.ip
22-
- context.http.userAgent
12+
seconds: 30
2313

2414
# A list of elasticsearch filters used for find events
2515
# These filters are joined with AND and nested in a filtered query
2616
# For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
2717
filter:
2818
- query:
2919
query_string:
30-
query: "_exists_:detections AND detections.reason:BEHAVIOUR"
20+
query: "detections.reason:BEHAVIOUR"
21+
22+
# Index to search, wildcard supported
23+
index: bitsensor-detections-*
24+
timestamp_field: endpoint.localtime
25+
doc_type: datapoint
26+
27+
# When the attacker continues, send a new alert after x minutes
28+
realert:
29+
minutes: 1
3130

31+
query_key:
32+
- context.ip
33+
- context.http.userAgent
34+
3235
include:
3336
- endpoint.location
3437
- endpoint.name
3538
- context.http.userAgent
3639
- context.ip
3740
- context.php.session.sessionId
38-
- detections.type
39-
- detections.name
40-
- meta.user
41-
- errors
4241

43-
alert_subject: "Frequent attack on {}"
42+
alert_subject: "Bad/Bot behaviour on <{}> | <{}|Show Dashboard>"
4443
alert_subject_args:
4544
- endpoint.name
45+
- kibana_link
46+
47+
alert_text: |-
48+
An attack on {} is detected.
49+
50+
The attacker looks like:
51+
IP: {}
52+
Tool: {}
4653
47-
alert_text_type: alert_text_only
48-
alert_text: "Time: {}\nIP: {} \nUser-Agent: {}\n\nID: {}\nUser: {}"
4954
alert_text_args:
50-
- endpoint.localtime
55+
- endpoint.name
5156
- context.ip
5257
- context.http.userAgent
53-
- _id
54-
- meta.user
5558

5659
# The alert is use when a match is found
5760
alert:
5861
- slack
62+
5963
slack_webhook_url: "https://hooks.slack.com/services/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"
6064
slack_username_override: "ElastAlert"
65+
66+
# Alert body only cointains a title and text
67+
alert_text_type: alert_text_only
68+
69+
# Link to BitSensor Kibana Dashboard
70+
use_kibana4_dashboard: "https://dev.bitsensor.io/app/kibana#/dashboard/Live-Hacking"

0 commit comments

Comments
 (0)