You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crowdsec-docs/docs/notification_plugins/elasticsearch.md
+65-4Lines changed: 65 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,20 @@ id: elastic
3
3
title: Elasticsearch
4
4
---
5
5
6
-
Elasticsearch can be integrated with CrowdSec by using the HTTP plugin. Enable it by following these [instructions](/notification_plugins/http.md) .
6
+
CrowdSec can forward Alerts to Elasticsearch using the HTTP plugin. This guide will show you how to configure the plugin to send alerts to your Elasticsearch instance.
7
+
8
+
## Configuring the plugin
9
+
10
+
By default the configuration for HTTP plugin is located at these default location per OS:
The default configuration for the email plugin is located at `/etc/crowdsec/notifications/email.yaml`.
22
-
You need to provide the credentials for the SMTP server here.
23
-
24
-
### Example configuration for Gmail
25
-
26
-
Here's an example configuration that sends alerts to `receiver@gmail.com`:
18
+
Here is the base configuration for the Email plugin:
27
19
28
20
```yaml
29
21
type: email # Don't change
@@ -84,12 +76,77 @@ encryption_type: "ssltls"
84
76
85
77
The `format` configuration directive is a [go template](https://pkg.go.dev/text/template), which receives a list of [Alert](https://pkg.go.dev/github.com/crowdsecurity/crowdsec@master/pkg/models#Alert) objects.
86
78
79
+
Typical port and TLS/SSL settings
80
+
81
+
| Port | Encryption Type |
82
+
|------|-----------------|
83
+
| 25 | none |
84
+
| 465 | ssltls |
85
+
| 587 | starttls |
86
+
87
+
:::warning
88
+
Port 25 should be avoided at all costs as it is commonly blocked by ISPs and email providers and is insecure as it sends in plain text.
89
+
:::
90
+
91
+
:::info
92
+
Port settings above are common, but may vary depending on your email provider. Please refer to your email provider's documentation for the correct settings.
93
+
:::
94
+
95
+
## Testing the plugin
96
+
97
+
Before enabling the plugin it is best to test the configuration so the configuration is validated and you can see the output of the plugin.
98
+
99
+
```bash
100
+
cscli notifications test email_default
101
+
```
102
+
103
+
:::note
104
+
If you have changed the `name` property in the configuration file, you should replace `email_default` with the new name.
105
+
:::
106
+
107
+
## Enabling the plugin
108
+
109
+
In your profiles you will need to uncomment the `notifications` key and the `email_default` plugin list item.
110
+
111
+
```
112
+
#notifications:
113
+
# - email_default
114
+
```
115
+
116
+
:::note
117
+
If you have changed the `name` property in the configuration file, you should replace `email_default` with the new name.
118
+
:::
119
+
120
+
:::warning
121
+
Ensure your YAML is properly formatted the `notifications` key should be at the top level of the profile.
122
+
:::
123
+
124
+
<details>
125
+
126
+
<summary>Example profile with email plugin enabled</summary>
Copy file name to clipboardExpand all lines: crowdsec-docs/docs/notification_plugins/file.md
+61-19Lines changed: 61 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,26 +3,19 @@ id: file
3
3
title: File Plugin
4
4
---
5
5
6
-
The File plugin is by default shipped with your CrowdSec installation. The following guide shows how to enable it.
6
+
The File plugin is by default shipped with your CrowdSec installation and allows you to write Alerts to an external file that can be monitored by external applications. The following guide shows how to configure, test and enable it.
7
7
8
-
## Enabling the plugin:
8
+
## Configuring the plugin
9
9
10
-
In your profile file (by default `/etc/crowdsec/profiles.yaml`) , uncomment the section
10
+
By default the configuration for Email plugin is located at these default location per OS:
11
11
12
-
```
13
-
#notifications:
14
-
# - file_default
15
-
```
16
-
17
-
Every alert which would pass the profile's filter would be dispatched to `file_default` plugin.
By default the configuration for File plugin is located at `/etc/crowdsec/notifications/file.yaml`.
22
-
23
-
### Adding the plugin configuration
24
-
25
-
Example config which writes a ndjson file to `/tmp/crowdsec_alerts.json`.
18
+
Example config which writes Alerts to a file using NDJson (**N**ewline **D**elimiter **J**ava**S**cript **O**bject **N**otation) format to `/tmp/crowdsec_alerts.json`.
26
19
27
20
```yaml
28
21
# Don't change this
@@ -56,9 +49,9 @@ rotate:
56
49
Some SIEM agents may not support some top level keys we define in the default ndjson format. Please make sure to adjust the format to match your SIEM agent's requirements.
57
50
:::
58
51
59
-
## SIEM Integration
52
+
### SIEM Integration
60
53
61
-
### Filebeat
54
+
#### Filebeat
62
55
63
56
Filebeat has a set of reserved top level keys and should not be used in the ndjson format. The following format can be used to be compatible with Filebeat:
64
57
@@ -69,12 +62,61 @@ format: |
69
62
{{ end -}}
70
63
```
71
64
65
+
## Testing the plugin
66
+
67
+
Before enabling the plugin it is best to test the configuration so the configuration is validated and you can see the output of the plugin.
68
+
69
+
```bash
70
+
cscli notifications test file_default
71
+
```
72
+
73
+
:::note
74
+
If you have changed the `name` property in the configuration file, you should replace `file_default` with the new name.
75
+
:::
76
+
77
+
## Enabling the plugin
78
+
79
+
In your profiles you will need to uncomment the `notifications` key and the `file_default` plugin list item.
80
+
81
+
```
82
+
#notifications:
83
+
# - file_default
84
+
```
85
+
86
+
:::note
87
+
If you have changed the `name` property in the configuration file, you should replace `file_default` with the new name.
88
+
:::
89
+
90
+
:::warning
91
+
Ensure your YAML is properly formatted the `notifications` key should be at the top level of the profile.
92
+
:::
93
+
94
+
<details>
95
+
96
+
<summary>Example profile with file plugin enabled</summary>
0 commit comments