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
Due to limitations in the underlying library used by the remediation component, by default, the body of any HTTP2/HTTP3 request without a Content-Length will not be analyzed.
314
+
To avoid potential bypasses of the WAF, you can set the option `APPSEC_DROP_UNREADABLE_BODY` to `true` to drop any request whose body cannot be inspected.
315
+
316
+
:::
317
+
314
318
### Setup captcha
315
319
316
320
> Currently, we have support for 3 providers: recaptcha, hcaptcha or turnstile
@@ -357,6 +361,7 @@ Here is a config example, but you can change values:
@@ -371,7 +376,8 @@ You have a few options to resolve this issue:
371
376
The `lua` module is included again in newer Ubuntu releases.
372
377
373
378
- **Use OpenResty instead of NGINX**
374
-
OpenResty is a drop-in replacement for NGINX that includes the `lua` module by default.
379
+
OpenResty is a drop-in replacement for NGINX that includes the `lua` module by default.
380
+
375
381
> Note: OpenResty uses slightly different service names and paths, but configuration remains compatible with standard NGINX.
376
382
377
383
- **Manually compile the lua module**
@@ -380,6 +386,7 @@ You have a few options to resolve this issue:
380
386
## Configuration Reference
381
387
382
388
### `API_KEY`
389
+
383
390
> string
384
391
385
392
```bash
@@ -391,6 +398,7 @@ CrowdSec Local API key.
391
398
Generated with [`sudo cscli bouncers add`](/u/getting_started/installation/linux) command.
392
399
393
400
### `API_URL`
401
+
394
402
> string
395
403
396
404
```bash
@@ -430,6 +438,7 @@ TLS_CLIENT_KEY=<path_to_key>
430
438
Path to the client certificate's private key file for mTLS authentication. This option is only used when `USE_TLS_AUTH` is set to `true`.
431
439
432
440
### `BOUNCING_ON_TYPE`
441
+
433
442
> all | ban | captcha
434
443
435
444
```bash
@@ -440,6 +449,7 @@ Type of remediation we want to bounce.
440
449
If you choose `ban` only and receive a decision with `captcha` as remediation, the component will skip the decision.
441
450
442
451
### `FALLBACK_REMEDIATION`
452
+
443
453
> ban | captcha
444
454
445
455
```bash
@@ -449,6 +459,7 @@ FALLBACK_REMEDIATION=ban
449
459
The fallback remediation is applied if the component receives a decision with an unknown remediation.
450
460
451
461
### `MODE`
462
+
452
463
> stream | live
453
464
454
465
```bash
@@ -458,14 +469,16 @@ MODE=stream
458
469
The default mode is `live`.
459
470
460
471
The component mode:
461
-
- stream: The component will pull new/old decisions from the local API every X seconds (`UPDATE_FREQUENCY` parameter).
462
-
- live: The component will query the local API for each requests (if IP is not in cache) and will store the IP in cache for X seconds (`CACHE_EXPIRATION` parameter).
472
+
473
+
- stream: The component will pull new/old decisions from the local API every X seconds (`UPDATE_FREQUENCY` parameter).
474
+
- live: The component will query the local API for each requests (if IP is not in cache) and will store the IP in cache for X seconds (`CACHE_EXPIRATION` parameter).
463
475
464
476
:::note
465
477
The timer that pull the local API will be triggered after the first request.
466
478
:::
467
479
468
480
### `REQUEST_TIMEOUT`
481
+
469
482
> int
470
483
471
484
```bash
@@ -475,6 +488,7 @@ REQUEST_TIMEOUT=1000
475
488
Timeout in milliseconds for the HTTP requests done by the component to query CrowdSec local API or captcha provider (for the captcha verification).
476
489
477
490
### `EXCLUDE_LOCATION`
491
+
478
492
> string (comma separated)
479
493
480
494
```bash
@@ -486,6 +500,7 @@ The locations to exclude while bouncing. It is a list of location, separated by
486
500
:warning: It is not recommended to put `EXCLUDE_LOCATION=/`.
487
501
488
502
### `ENABLE_INTERNAL`
503
+
489
504
> bool
490
505
491
506
```bash
@@ -496,8 +511,8 @@ Whether to process internal requests or not (after a rewrite for example).
496
511
497
512
Disabled by default.
498
513
499
-
500
514
### `CACHE_EXPIRATION`
515
+
501
516
> int
502
517
503
518
> This option is only for the `live` mode.
@@ -509,6 +524,7 @@ CACHE_EXPIRATION=1
509
524
The cache expiration, in second, for IPs that the remediation store in cache in `live` mode.
510
525
511
526
### `UPDATE_FREQUENCY`
527
+
512
528
> int
513
529
514
530
> This option is only for the `stream` mode.
@@ -520,6 +536,7 @@ UPDATE_FREQUENCY=10
520
536
The frequency of update, in second, to pull new/old IPs from the CrowdSec local API.
521
537
522
538
### `REDIRECT_LOCATION`
539
+
523
540
> string
524
541
525
542
> This option is only for the `ban` remediation.
@@ -533,6 +550,7 @@ The location to redirect the user when there is a ban.
533
550
If it is not set, the component will return the page defined in the `BAN_TEMPLATE_PATH` with the `RET_CODE` (403 by default).
534
551
535
552
### `BAN_TEMPLATE_PATH`
553
+
536
554
> string (path to file)
537
555
538
556
> This option is only for the `ban` remediation.
@@ -546,6 +564,7 @@ The path to a HTML page to return to IPs that trigger `ban` remediation.
546
564
By default, the HTML template is located in `/var/lib/crowdsec/lua/templates/ban.html`.
547
565
548
566
### `RET_CODE`
567
+
549
568
> int
550
569
551
570
> This option is only for the `ban` remediation.
@@ -558,6 +577,7 @@ The HTTP code to return for IPs that trigger a `ban` remediation.
558
577
If nothing specified, it will return a 403.
559
578
560
579
### `CAPTCHA_PROVIDER`
580
+
561
581
> recaptcha | hcaptcha | turnstile
562
582
563
583
> This option is only for the `captcha` remediation.
@@ -571,6 +591,7 @@ For backwards compatibility reasons `recaptcha` is the default if no value is se
571
591
:::
572
592
573
593
### `SECRET_KEY`
594
+
574
595
> string
575
596
576
597
> This option is only for the `captcha` remediation.
> This option is only for the `captcha` remediation.
@@ -593,6 +615,7 @@ SITE_KEY=<captcha_site_key>
593
615
The captcha site key.
594
616
595
617
### `CAPTCHA_TEMPLATE_PATH`
618
+
596
619
> string (path to file)
597
620
598
621
> This option is only for the `captcha` remediation.
@@ -608,6 +631,7 @@ The component will try to replace `{{captcha_site_key}}` in the template with `S
608
631
By default, the HTML template is located in `/var/lib/crowdsec/lua/templates/captcha.html`.
609
632
610
633
### `CAPTCHA_EXPIRATION`
634
+
611
635
> int
612
636
613
637
> This option is only for the `captcha` remediation.
@@ -619,6 +643,7 @@ CAPTCHA_EXPIRATION=3600
619
643
The time for which the captcha will be validated. After this duration, if the decision is still present in CrowdSec local API, the IPs address will get a captcha again.
620
644
621
645
### `CAPTCHA_RET_CODE`
646
+
622
647
> int
623
648
624
649
> This option is only for the `captcha` remediation.
@@ -630,6 +655,7 @@ CAPTCHA_RET_CODE=200
630
655
Specifies the HTTP status code that should be returned to the client when a CAPTCHA challenge is required. This is especially useful when your traffic is routed through a CDN (like Cloudflare), where you may want to avoid triggering caching based on non-200 status codes. By default if no value is provided it will use 200 status code.
0 commit comments