Whitelists
Whitelists tell CrowdSec to ignore certain events or IP addresses. This is useful if you have a static IP you trust, or a service that could generate false triggers (for example, a site that loads many thumbnails, images, or fonts).
By default, CrowdSec whitelists private LAN IP addresses via this parser. You can add additional IPs or events.
This guide covers how to create whitelists and apply them to your CrowdSec instance.
We cannot cover every use case. For advanced scenarios, see the detailed whitelist documentation.
Whitelist Typesβ
There are three whitelist types in CrowdSec:
- Parser (at enrich stage)
- Postoverflow
- AllowLists
It is important to know where these are applied in the pipeline, as it affects behavior and context.
Parserβ
Parser-based whitelists are applied while the event is being enriched. They prevent the log line from reaching the scenario stage, which saves resources.
Typically these files are located here, depending on your OS:
- Linux:
/etc/crowdsec/parsers/s02-enrich/ - Freebsd:
/usr/local/etc/crowdsec/parsers/s02-enrich/ - Windows:
c:/programdata/crowdsec/config/parsers/s02-enrich/
Postoverflowβ
Postoverflow whitelists are applied after a scenario triggers. Use this stage for expensive checks, such as DNS lookups.
Typically these files are located here, depending on your OS:
- Linux:
/etc/crowdsec/postoverflows/s01-whitelist/ - Freebsd:
/usr/local/etc/crowdsec/postoverflows/s01-whitelist/ - Windows:
c:/programdata/crowdsec/config/postoverflows/s01-whitelist/
Postoverflow whitelist folders do not exist by default, so you must create them manually.
AllowListsβ
AllowLists let you centrally manage whitelisted IP addresses and CIDR ranges using cscli. This is the preferred method because AllowLists integrate with major components, including:
- AppSec component
cscli- Scenario overflows
- Console Blocklists
Which one should I use?β
If you already know the IP or CIDR range to whitelist, use cscli AllowLists. This excludes the IP across all CrowdSec components.
If you need to whitelist a specific event pattern (such as a URI), use a Parser whitelist. For advanced logic like DNS or reverse DNS lookups, use a Postoverflow whitelist.
To summarize:
- Use AllowLists for IP and CIDR ranges.
- Enricher whitelists apply to every event (each log line).
- Postoverflow whitelists apply only to triggered scenarios.
Should I create a whitelist?β
When configuring CrowdSec for the first time, you may want to create a whitelist for the following reasons:
- You have a static IP address that you want to ensure is never banned.
- You have a service that could generate a lot of false triggers.
If you are unsure if you need a whitelist, you can monitor the logs and see if there are any false positives that you want to prevent.
If a decision is made against your IP and you use remediation components like iptables or nftables, you may be blocked from all services on that server.
In our enterprise offering, Decision Management lets you manage decisions via the Console.
Creating your first whitelistβ
Depending on your criteria, you may want to create a whitelist for a specific IP address, a range of IP addresses, or a specific event pattern.
We provide examples for each scenario.
Static IP addressβ
AllowListsβ
You can create a new AllowList using cscli:
cscli allowlist create my_allowlist -d 'created from the docs'
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.
To add entries to the AllowList, provide the name and the value you want to allow:
Single IP:
cscli allowlist add my_allowlist 192.168.1.1
CIDR range:
cscli allowlist add my_allowlist 192.168.1.0/24
A key benefit of using AllowLists is that changes take effect immediatelyβno need to restart CrowdSec.
To view the contents of an AllowList, run:
cscli allowlist inspect my_allowlist
Example output:
ββββββββββββββββββββββββββββββββββββββββββββββ
Allowlist: my_allowlist
ββββββββββββββββββββββββββββββββββββββββββββββ
Name my_allowlist
Description created from the docs
Created at 2025-05-13T14:10:12.668Z
Updated at 2025-05-13T14:12:30.177Z
Managed by Console no
ββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Value Comment Expiration Created at
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
192.168.1.0/24 never 2025-05-13T14:10:12.668Z
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
You can see the full list of allowlist command via cscli here.
Enricher fileβ
If you want to whitelist a specific IP address for example 192.168.1.1, you can create a file in the Enricher folder with the following content:
name: my/whitelist ## Must be unique
description: "Whitelist events from my IP"
whitelist:
reason: "My IP"
ip:
- "192.168.1.1"
Once you have created the file you will need to restart the CrowdSec service for the changes to take effect.
sudo systemctl restart crowdsec
If you want to whitelist a range of IP addresses, for example 192.168.1.0/24, create a file in the Enricher folder with the following content:
name: my/whitelist ## Must be unqiue
description: "Whitelist events from my IP range"
whitelist:
reason: "My IP range"
cidr:
- "192.168.1.0/24"
Once you have created the file you will need to restart the CrowdSec service for the changes to take effect.
sudo systemctl restart crowdsec
Expression patternβ
If you want to whitelist a specific event pattern, for example http log line that is a healthcheck so typically a GET request to /health you can create a file in the Enricher folder with the following content:
name: my/whitelist ## Must be unqiue
description: "Whitelist events with GET /health"
filter: "evt.Meta.service == 'http' && evt.Meta.log_type in ['http_access-log', 'http_error-log']"
whitelist:
reason: "GET /health"
expression:
- "evt.Meta.http_verb == 'GET' && evt.Meta.http_path == '/health'"
Once you have created the file you will need to restart the CrowdSec service for the changes to take effect.
sudo systemctl restart crowdsec
Expression whitelists are very powerful and can be used to whitelist based on any field in the event. You can find a more detailed version of the expression guide here which will showcase how you can find which fields are available to you based on the log line you are processing.
Dynamic IP addressβ
If you want to whitelist an IP address that is not static, you need to use a external DDNS service to resolve the IP address and then use the Postoverflow whitelist to whitelist the resolved IP address.
name: my/whitelist ## Must be unqiue
description: "Whitelist events from my dynamic IP"
whitelist:
reason: "My dynamic IP"
expression:
- evt.Overflow.Alert.Source.IP in LookupHost("foo.com")
Testing your whitelistβ
Once you have created your whitelist, you can test it by running a log line through the parser and checking the output.
grep 192.168.1.1 /var/log/nginx/access.log | tail -n 1 | sudo cscli explain -f- --type nginx
grep /health /var/log/nginx/access.log | tail -n 1 | sudo cscli explain -f- --type nginx
line: 192.168.1.1 - - [05/Sep/2024:18:07:25 +0000] "GET /health? HTTP/2.0" 200 42 "-" "curl/7.68.0"
β s00-raw
| β π’ crowdsecurity/non-syslog (+5 ~8)
β s01-parse
| β π’ crowdsecurity/nginx-logs (+23 ~2)
β s02-enrich
| β π’ crowdsecurity/dateparse-enrich (+2 ~2)
| β π’ crowdsecurity/geoip-enrich (+13)
| β π’ crowdsecurity/http-logs (+8 ~1)
| β π’ my/whitelist (~2 [whitelisted])
β-------- parser success, ignored by whitelist (<Reason will vary here>) π’
Example logs line you will see:
time="07-07-2020 17:11:09" level=info msg="Ban for 192.168.1.1 whitelisted, reason [My dynamic IP]" id=cold-sunset name=my/whitelist stage=s01
Whitelisted but there still a decision?β
Whitelisting an IP address or event will prevent the events from triggering new decisions, however, any existing decisions will still be applied.
You must manually remove the decisions by running:
sudo cscli decisions delete --ip 192.168.1.1
Next stepsβ
If you are still looking for examples on how to create a whitelist, you can find more detailed documentation here.
If you have created your first whitelist, tested it and happy to continue then click here.