Skip to content

Commit 5c482a0

Browse files
committed
docs(notification integration): 📝 Add discord Console integration documentation
1 parent 2821006 commit 5c482a0

File tree

7 files changed

+61
-26
lines changed

7 files changed

+61
-26
lines changed

crowdsec-docs/sidebarsUnversioned.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,17 @@ const sidebarsUnversionedConfig: SidebarConfig = {
317317
tag: "premium",
318318
},
319319
},
320+
{
321+
type: "doc",
322+
label: "Discord",
323+
id: "console/notification_integrations/discord",
324+
},
320325
{
321326
type: "doc",
322327
label: "Slack",
323328
id: "console/notification_integrations/slack",
324329
},
330+
325331
{
326332
type: "doc",
327333
label: "Webhook",

crowdsec-docs/src/css/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ html[data-theme="dark"] {
5656
--docusaurus-highlighted-code-line-bg: rgba(255, 255, 255, 0.1);
5757
}
5858

59+
/* IMAGE STYLES FOR PAGES*/
60+
.container img {
61+
@apply border border-solid border-gray-300/80 dark:border-gray-300/80 rounded-lg p-2;
62+
}
63+
5964
.docusaurus-highlight-code-line {
6065
@apply bg-background block;
6166
margin: 0 calc(-1 * var(--ifm-pre-padding));
104 KB
Loading
46.3 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
id: discord
3+
title: Discord
4+
---
5+
6+
Connecting an integration will create a configuration specific to your Discord server.
7+
You can then define rules to control which events trigger notifications and which Discord channel they’re sent to.
8+
9+
## Link your server
10+
11+
1. In the [CrowdSec Console](https://app.crowdsec.net), navigate to **Settings > Integrations** and then select **Configure** in the Discord row.
12+
13+
![](/img/console/notification_integrations/configure-discord.png)
14+
15+
2. Select the Discord server you want to link to your CrowdSec Console using the dropdown menu on top-tight of the page. Then select **Allow**. Repeat the process if you want to link more servers.
16+
17+
3. You should be redirected to the Discord integration page. You can now create a notification rule by navigating to the **Rules** tab.
18+
19+
![](/img/console/notification_integrations/discord-configuration-tab.png)
20+
21+
Your Discord integration is now linked to your CrowdSec Console.
22+
23+
## Create a notification rule
24+
25+
1. In the [CrowdSec Console](https://app.crowdsec.net), navigate to **Settings > Integrations > Discord** go to the Rules tab and click on **Add rule**.
26+
27+
2. Follow the steps in the [Create a notification rule](/u/console/notification_integrations/rule) documentation to create your rule.

crowdsec-docs/unversioned/console/notification_integrations/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Discover all the available notification integrations in CrowdSec. Each integrati
1616
1717
## Available Integrations
1818

19+
- [Discord](/u/console/notification_integrations/discord)
1920
- [Slack](/u/console/notification_integrations/slack)
2021
- [Webhook](/u/console/notification_integrations/webhook)
21-
- Coming soon: Discord
2222
- Coming soon: Microsoft Teams
2323

2424
## How to use notification integrations

crowdsec-docs/versioned_docs/version-v1.6.0/appsec/quickstart.md

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ title: Quickstart
44
sidebar_position: 2
55
---
66

7-
## Objectives
8-
97
The goal of this quickstart is to set up the [AppSec Component](appsec/intro.md#introduction) to safeguard web applications running on [Nginx](https://nginx.com). We'll deploy a [set of rules](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-virtual-patching) designed to block [well-known attacks](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-generic-rules) and [currently exploited vulnerabilities](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-virtual-patching). Additionally, we'll show how to monitor these alerts through the [console](https://app.crowdsec.net/).
108

119
## Pre-requisites
@@ -36,16 +34,16 @@ sudo cscli collections install crowdsecurity/appsec-generic-rules
3634

3735
Executing this command will install the following items:
3836

39-
- The [*AppSec Rules*](/appsec/rules_syntax.md) contain the definition of malevolent requests to be matched and stopped
40-
- The [*AppSec configuration*](/appsec/configuration.md#appsec-configuration) links together a set of rules to provide a coherent set
41-
- The [*CrowdSec Parser*](/concepts.md#parsers) and [*CrowdSec Scenario(s)*](/concepts.md#scenarios) bans for a longer duration repeating offenders
37+
- The [_AppSec Rules_](/appsec/rules_syntax.md) contain the definition of malevolent requests to be matched and stopped
38+
- The [_AppSec configuration_](/appsec/configuration.md#appsec-configuration) links together a set of rules to provide a coherent set
39+
- The [_CrowdSec Parser_](/concepts.md#parsers) and [_CrowdSec Scenario(s)_](/concepts.md#scenarios) bans for a longer duration repeating offenders
4240

4341
### Setup the acquisition
4442

4543
Having installed the required components, it's time to configure the CrowdSec [Acquisition](/concepts.md#acquisition) to connect the Application Security Component with our Nginx web server. This configuration allows our Nginx server to send requests to the AppSec Component for evaluation and decision-making.
4644

47-
- Create the `/etc/crowdsec/acquis.d/` directory with `mkdir -p /etc/crowdsec/acquis.d/` (if it doesn't exist on your machine)
48-
- Put the following content in `/etc/crowdsec/acquis.d/appsec.yaml` :
45+
- Create the `/etc/crowdsec/acquis.d/` directory with `mkdir -p /etc/crowdsec/acquis.d/` (if it doesn't exist on your machine)
46+
- Put the following content in `/etc/crowdsec/acquis.d/appsec.yaml` :
4947

5048
```yaml title="/etc/crowdsec/acquis.d/appsec.yaml"
5149
appsec_config: crowdsecurity/appsec-default
@@ -57,8 +55,8 @@ source: appsec
5755
5856
The two important directives in this configuration file are:
5957
60-
- `appsec_config` is the name of the [*AppSec configuration*](/appsec/configuration.md#appsec-configuration) that was included in the [collection](/concepts.md#collections) we just installed.
61-
- the `listen_addr` is the IP and port the AppSec Component will listen to.
58+
- `appsec_config` is the name of the [_AppSec configuration_](/appsec/configuration.md#appsec-configuration) that was included in the [collection](/concepts.md#collections) we just installed.
59+
- the `listen_addr` is the IP and port the AppSec Component will listen to.
6260

6361
:::info
6462
You can find more about the [supported options for the acquisition here](/data_sources/appsec.md)
@@ -133,7 +131,6 @@ sudo cscli bouncers delete test_waf
133131

134132
</details>
135133

136-
137134
## Remediation Component Setup
138135

139136
With our AppSec Component active within CrowdSec, it's time to configure the remediation component to forward requests to it.
@@ -148,8 +145,6 @@ To setup forwarding of requests in the Nginx remediation component, we'll modify
148145
APPSEC_URL=http://127.0.0.1:7422
149146
```
150147

151-
152-
153148
This instructs our Nginx plugin (the remediation component) to communicate with the AppSec Component at `http://127.0.0.1:7422`. Once configured, all incoming HTTP requests will be sent there for analysis. The snippet above assumes that the AppSec Component is running on the same machine.
154149

155150
We can now restart the service:
@@ -169,8 +164,9 @@ if now try to access `http://localhost/.env` from a browser, our If you now atte
169164
![appsec-denied](/img/appsec_denied.png)
170165

171166
We can also look at the metrics from `cscli metrics`. Amongst other things, it will show:
172-
- the number of requests processed by the AppSec Component
173-
- Individual rule matches
167+
168+
- the number of requests processed by the AppSec Component
169+
- Individual rule matches
174170

175171
<details>
176172
<summary>cscli metrics output example</summary>
@@ -194,35 +190,36 @@ Appsec '127.0.0.1:7422/' Rules Metrics:
194190
╰─────────────────────────────────┴───────────╯
195191
196192
```
197-
</details>
198193

194+
</details>
199195

200196
### Explanation
201197

202198
What happened in the test that we just did is:
203199

204-
1. We did a request (`localhost/.env`) to our local nginx webserver
205-
2. Nginx, thanks to the Remediation Component configuration, forwarded the request to `http://127.0.0.1:7422`
206-
3. Our AppSec Component, listening on `http://127.0.0.1:7422` analyzed the request
207-
4. The request matches the [AppSec rule to detect .env access](https://app.crowdsec.net/hub/author/crowdsecurity/appsec-rules/vpatch-env-access)
208-
5. The AppSec Component thus answered with [HTTP 403](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403) to Nginx, indicating that the request must be blocked
209-
6. Nginx presented us with the default "request blocked" page provided by the Remediation Component
200+
1. We did a request (`localhost/.env`) to our local nginx webserver
201+
2. Nginx, thanks to the Remediation Component configuration, forwarded the request to `http://127.0.0.1:7422`
202+
3. Our AppSec Component, listening on `http://127.0.0.1:7422` analyzed the request
203+
4. The request matches the [AppSec rule to detect .env access](https://app.crowdsec.net/hub/author/crowdsecurity/appsec-rules/vpatch-env-access)
204+
5. The AppSec Component thus answered with [HTTP 403](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403) to Nginx, indicating that the request must be blocked
205+
6. Nginx presented us with the default "request blocked" page provided by the Remediation Component
210206

211207
## Integration with the console
212208

213209
<!-- fix link to this guide once done -->
210+
214211
If you haven't yet, follow the guide about [how to enroll your Security Engine in the console](/docs/getting_started/install_crowdsec).
215212

216213
Once done, all your alerts, including the ones generated by the AppSec Component, are going to appear in the console:
217214

218215
![appsec-console](/img/appsec_console.png)
219216

220-
221217
## Next steps
222218

223219
You are now running the AppSec Component on your Crowdsec Security Engine, congrats!
224220

225221
As the next steps, you can:
226-
- [Explore the hub](https://hub.crowdsec.net) to find more rules for your use case
227-
- Look at the [Rules syntax](/appsec/rules_syntax.md) and [creation process](/appsec/create_rules.md) to create your own and contribute
228-
- Take a look at [the benchmarks](/appsec/benchmark.md)
222+
223+
- [Explore the hub](https://hub.crowdsec.net) to find more rules for your use case
224+
- Look at the [Rules syntax](/appsec/rules_syntax.md) and [creation process](/appsec/create_rules.md) to create your own and contribute
225+
- Take a look at [the benchmarks](/appsec/benchmark.md)

0 commit comments

Comments
 (0)