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/unversioned/getting_started/post_installation/whitelists.mdx
+79-5Lines changed: 79 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,10 @@ We use "event" as a term to describe a log line that is currently being processe
21
21
22
22
## Whitelist Types
23
23
24
-
There are two different types of whitelists in CrowdSec:
24
+
There are three different types of whitelists in CrowdSec:
25
25
- Parser (at enrich stage)
26
26
- Postoverflow
27
+
- AllowLists
27
28
28
29
Its important to note where these whitelists are applied in the pipeline, as this will affect the behavior and the context of the whitelists.
29
30
@@ -51,11 +52,30 @@ typically these files are located in the following locations depending on your O
51
52
52
53
*Postoverflow whitelist folders do not exist by default so you **MUST** manually create them*
53
54
55
+
### AllowLists
56
+
57
+
:::info
58
+
Allowlist were added in version `1.6.8` please ensure you are on this version to follow these Steps
59
+
:::
60
+
61
+
AllowLists are a new feature that lets you centrally manage whitelisted IP addresses and CIDR ranges using `cscli`. This is the preferred method for allowlisting, as AllowLists are integrated with all major components of CrowdSec, including:
62
+
63
+
- AppSec component
64
+
-`cscli`
65
+
- Scenario overflows
66
+
- Console Blocklists
67
+
68
+
54
69
### Which one should I use?
55
70
56
-
If you know which IP or event pattern you want to whitelist (for example a URI), then you should use a Parser whitelist. If you want to do a more complex whitelist, such as a DNS/rDNS lookup, then you should use the Postoverflow Whitelist.
71
+
If you already know the IP address or CIDR range you want to whitelist, use the `cscli` AllowLists feature. This ensures the IP is excluded across all CrowdSec components.
72
+
73
+
If you're looking to whitelist based on a specific event pattern (such as a URI), use a **Parser whitelist**. For more advanced logic—like DNS or reverse DNS lookups—use a **Postoverflow whitelist**.
57
74
58
-
In short, enricher whitelists are applied to **every** event (log line), whereas postoverflow whitelists are only applied to **triggered** scenarios.
75
+
To summarize:
76
+
- Use **AllowLists** for IP and CIDR ranges.
77
+
-**Enricher whitelists** apply to **every** event (each log line).
78
+
-**Postoverflow whitelists** apply only to **triggered** scenarios.
59
79
60
80
## Should I create a whitelist?
61
81
@@ -85,6 +105,62 @@ The example location shown is for Linux, you will need to adjust the path based
85
105
86
106
### Static IP address
87
107
108
+
#### AllowLists
109
+
110
+
You can create a new AllowList using `cscli`:
111
+
112
+
```bash
113
+
cscli allowlist create my_allowlist -d 'created from the docs'
114
+
```
115
+
116
+
This command creates an empty AllowList named `my_allowlist`. You can then add IP addresses and CIDR ranges to it. There's no need to specify the type—AllowLists support both. The `-d` flag lets you add a description, which is useful when managing multiple AllowLists to help identify their purpose.
117
+
118
+
To add entries to the AllowList, provide the name and the value you want to allow:
119
+
120
+
Single IP:
121
+
122
+
```bash
123
+
cscli allowlist add my_allowlist 192.168.1.1
124
+
```
125
+
126
+
CIDR range:
127
+
128
+
```bash
129
+
cscli allowlist add my_allowlist 192.168.1.0/24
130
+
```
131
+
132
+
A key benefit of using AllowLists is that changes take effect immediately—no need to restart CrowdSec.
@@ -102,8 +178,6 @@ Once you have created the file you will need to restart the CrowdSec service for
102
178
sudo systemctl restart crowdsec
103
179
```
104
180
105
-
### IP Range
106
-
107
181
If you want to whitelist a range of IP addresses, for example `192.168.1.0/24` you can create a file in the Enricher folder with the following content:
0 commit comments