# Crowdsec add request whitelist

**URL:** https://discourse.crowdsec.net/t/crowdsec-add-request-whitelist/2187
**Category:** crowdsec
**Created:** [December 16, 2024, 10:00am UTC](https://discourse.crowdsec.net/t/crowdsec-add-request-whitelist/2187 "2024-12-16T10:00:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![garrkiss](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@garrkiss](https://discourse.crowdsec.net/u/garrkiss)
#### Post date: [December 16, 2024, 10:00am UTC](https://discourse.crowdsec.net/t/crowdsec-add-request-whitelist/2187/1 "2024-12-16T10:00:14Z")

</div>

Hello everyone,  
Could you please tell me how to add a specific request to the CrowdSec whitelist? I couldn’t quite figure out from the documentation if this is possible.

Example request:  
`POST /api/v4/protocol/create HTTP/2.0`

---

<div class="post-metadata">

### Author: ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)
#### Post date: [December 16, 2024, 10:57am UTC](https://discourse.crowdsec.net/t/crowdsec-add-request-whitelist/2187/2 "2024-12-16T10:57:09Z")

</div>

Yes this is possible but you want to whitelist all IP’s that match this specific pattern?

for example:

```auto
#/etc/crowdsec/parsers/s02-enrich/mywhitelist.yaml
name: my/api-whitelist
description: "Whitelist events for my api"
filter: "evt.Meta.service == 'http' && evt.Meta.log_type in ['http_access-log', 'http_error-log']"
whitelist:
  reason: "My API whitelist"
  expression:
   - evt.Meta.http_status == '200' && evt.Meta.http_verb == 'POST' && evt.Parsed.request contains '/api/v4/protocol/create'

```

Change the `http_status` if 200 is not correct.

---

<div class="post-metadata">

### Author: ![garrkiss](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@garrkiss](https://discourse.crowdsec.net/u/garrkiss)
#### Post date: [December 16, 2024, 12:58pm UTC](https://discourse.crowdsec.net/t/crowdsec-add-request-whitelist/2187/4 "2024-12-16T12:58:27Z")

</div>

I want to allow all IP addresses in the whitelist. Also, could you recommend the best practice if I need to add another rule in the future? Should I update this configuration or create a new one? Could you also provide an example of how it would look? Thank you in advance.
