Files
crowdsec-bouncer-traefik-pl…/examples/appsec-enabled
892909b9b8 🐛 fix start up config error for appsec and review doc for appsec tls (#300)
* 🐛 fix start up config error for appsec

* :doc: add documentation on appsec variables and missing conf parameter

* 🍱 fix lint

* 🍱 fix lint

* 🍱 fix lint

* 🍱 fix after lot of tests

* update exemple tls with new variables tested

* fix exemple appsec with release and not localplugin

---------

Co-authored-by: mhx <mathieu@hanotaux.fr>
2025-12-21 21:52:19 +01:00
..

Example

Enabling AppSec WAF feature from crowdsec

You mostly need to configure Crowdsec for this to work by enabling virtual patching and configuring some custom rules. In the example we use a whoami container protected by crowdsec with virtual patching enabled.

The Traefik instance just needs to know where appsec engine is located

  labels:
      
      - "traefik.http.middlewares.crowdsec-bar.plugin.bouncer.crowdsecappsecenabled=true"
      - "traefik.http.middlewares.crowdsec-bar.plugin.bouncer.crowdsecappsechost=crowdsec:7422"

We can try to query normally the whoami server:

curl http://localhost:8000/foo

And then we verify that a malicious request will be blocked:

curl http://localhost:8000/foo/rpc2

You should get a 403 on http://localhost:8000/foo/rpc2

To play the demo environment run:

make run_appsec