[GH-ISSUE #6059] Crowdsec bouncer not blocking on self-hosted combined container setup #11557

Open
opened 2026-08-05 01:30:01 -04:00 by saavagebueno · 4 comments
Owner

Originally created by @pernetz on GitHub (May 4, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/6059

Describe the problem

The crowdsec integration into an existing combined server is not working as expected, following the official guide Enable CrowdSec IP reputation

To Reproduce

Steps to reproduce the behavior:

  1. Running my self-hosted netbird instance on public VPS
  2. Edit of docker-compose.yml, start crowdsec, register bouncer, configure proxy and enable service works fine (installation steps 7a to 7d).
  3. Setting CS IP reputation to Enforce on proxied domain
  4. Added my public IP to decisions list sudo docker compose exec crowdsec cscli decisions add --ip 1.2.3.4 --duration 1h --reason "manual test"
  5. Proxied domain still accessable, also with incognito browser mode
  6. Rolled back the entire server and retried installation
  7. Still no blocking

Expected behavior

Access to the proxied domain should have been blocked after setting the access control rule.

Are you using NetBird Cloud?

Self-host NetBird's control plane on public VPS (Hetzner)

NetBird version

v0.70.4

Is any other VPN software installed?

None

Have you tried these troubleshooting steps?

  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird server
Originally created by @pernetz on GitHub (May 4, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/6059 **Describe the problem** The crowdsec integration into an existing combined server is not working as expected, following the official guide [Enable CrowdSec IP reputation](https://docs.netbird.io/selfhosted/migration/enable-reverse-proxy#step-7-optional-enable-crowd-sec-ip-reputation) **To Reproduce** Steps to reproduce the behavior: 1. Running my self-hosted netbird instance on public VPS 2. Edit of `docker-compose.yml`, start crowdsec, register bouncer, configure proxy and enable service works fine (installation steps 7a to 7d). 3. Setting CS IP reputation to Enforce on proxied domain 4. Added my public IP to decisions list `sudo docker compose exec crowdsec cscli decisions add --ip 1.2.3.4 --duration 1h --reason "manual test"` 5. Proxied domain still accessable, also with incognito browser mode 6. Rolled back the entire server and retried installation 7. Still no blocking **Expected behavior** Access to the proxied domain should have been blocked after setting the access control rule. **Are you using NetBird Cloud?** Self-host NetBird's control plane on public VPS (Hetzner) **NetBird version** `v0.70.4` **Is any other VPN software installed?** None **Have you tried these troubleshooting steps?** - [x] Checked for newer NetBird versions - [x] Searched for similar issues on GitHub (including closed ones) - [x] Restarted the NetBird server
saavagebueno added the triage-needed label 2026-08-05 01:30:01 -04:00
Author
Owner

@pernetz commented on GitHub (May 4, 2026):

! ! UPDATE - got it working ! !

Finally I got Crowdsec bouncer to work as intended. Checking carefully the netbird proxy logs docker compose logs -f proxy I recognized it only sees the internal docker network IP from traefik reverse proxy for incoming traffic, which is 172.30.0.10 as per default configuration.
That is why Crowdsec could not read the desired source IP address and was not able to trigger the bouncer accordingly. Most likely the manual blocking test did apply correctly, however the bouncer was not aware of the traffics origin.

@mlsmaycon That being said, I must admit the guide Enable CrowdSec IP reputation is wrong or at least lagging some key info.

Here are my suggestions to be added to the guide for those folks, who want to add the Crowdsec security layer to their existing, self-hosted netbird instance.

  1. First, complete steps 7a to 7d of the guide. (Order can be changed when merged)
  2. Edit proxy.env and add three entries
  • NB_PROXY_FORWARDED_PROTO=https
  • NB_PROXY_PROXY_PROTOCOL=true
  • NB_PROXY_TRUSTED_PROXIES=172.30.0.10
  1. Edit config.yaml and insert this code to the server: Image
  2. Create a new file in the compose root directory touch traefik-dynamic.yaml
  3. Edit traefik-dynamic.yaml and insert this code: Image
  4. Edit docker-compose.yml file and add following lines to their services:
  • traefik: add to command: section
    - "--providers.file.filename=/etc/traefik/dynamic.yaml"
  • traefik: add to volumes: section
    - ./traefik-dynamic.yaml:/etc/traefik/dynamic.yaml:ro
  • proxy: add to labels: section
    - traefik.tcp.services.proxy-tls.loadbalancer.serverstransport=pp-v2@file
  1. Restart traefik and proxy container docker compose up -d traefik proxy
  2. Check if source IPs are reported correctly now docker compose logs -f proxy

Hope I have not missed any of the fixing steps. Try out and report back.

Cheers to the awesome Netbird team 💯

<!-- gh-comment-id:4371982603 --> @pernetz commented on GitHub (May 4, 2026): **! ! UPDATE - got it working ! !** Finally I got Crowdsec bouncer to work as intended. Checking carefully the netbird proxy logs `docker compose logs -f proxy` I recognized it only sees the internal docker network IP from traefik reverse proxy for incoming traffic, which is `172.30.0.10` as per default configuration. That is why Crowdsec could not read the desired source IP address and was not able to trigger the bouncer accordingly. Most likely the manual blocking test did apply correctly, however the bouncer was not aware of the traffics origin. @mlsmaycon That being said, I must admit the guide [Enable CrowdSec IP reputation](https://docs.netbird.io/selfhosted/migration/enable-reverse-proxy#step-7-optional-enable-crowd-sec-ip-reputation) is wrong or at least lagging some key info. Here are my suggestions to be added to the guide for those folks, who want to add the Crowdsec security layer to their existing, self-hosted netbird instance. 1. First, complete steps 7a to 7d of the guide. (Order can be changed when merged) 2. Edit `proxy.env` and add three entries - `NB_PROXY_FORWARDED_PROTO=https` - `NB_PROXY_PROXY_PROTOCOL=true` - `NB_PROXY_TRUSTED_PROXIES=172.30.0.10` 3. Edit `config.yaml` and insert this code to the `server`: <img width="186" height="62" alt="Image" src="https://github.com/user-attachments/assets/291809a2-a4fe-4835-a6f4-aac15907686e" /> 4. Create a new file in the compose root directory `touch traefik-dynamic.yaml` 5. Edit `traefik-dynamic.yaml` and insert this code: <img width="179" height="96" alt="Image" src="https://github.com/user-attachments/assets/24d1b6ff-01f6-4268-9964-3f22d1a40604" /> 6. Edit `docker-compose.yml` file and add following lines to their _services_: - **traefik:** add to `command:` section `- "--providers.file.filename=/etc/traefik/dynamic.yaml"` - **traefik:** add to `volumes:` section `- ./traefik-dynamic.yaml:/etc/traefik/dynamic.yaml:ro` - **proxy:** add to `labels:` section `- traefik.tcp.services.proxy-tls.loadbalancer.serverstransport=pp-v2@file` 7. Restart traefik and proxy container `docker compose up -d traefik proxy` 8. Check if source IPs are reported correctly now `docker compose logs -f proxy` Hope I have not missed any of the fixing steps. Try out and report back. Cheers to the awesome Netbird team 💯
Author
Owner

@PizzaLovingNerd commented on GitHub (Jun 3, 2026):

Hello, I am trying to document your solution, however I cannot reproduce your initial setup with the bug. When running the getting-started.sh script, did you enable the proxy and disable crowdsec? Thanks!

<!-- gh-comment-id:4618469611 --> @PizzaLovingNerd commented on GitHub (Jun 3, 2026): Hello, I am trying to document your solution, however I cannot reproduce your initial setup with the bug. When running the getting-started.sh script, did you enable the proxy and disable crowdsec? Thanks!
Author
Owner

@pernetz commented on GitHub (Jun 5, 2026):

Hi, my install was performed with the "getting-started-with-zitadel" script around version 0.28.0. At that time none of the modern features was available. I used the migration guide to move over to the combine server and activate the proxy feature.
Since I had issues with the proxy service, I digged inside the docker logs and also installed a brand new netbird server in parallel using the getting-started script at version 0.70.4. So I compared both installs and found some missing files/entries.

<!-- gh-comment-id:4635185471 --> @pernetz commented on GitHub (Jun 5, 2026): Hi, my install was performed with the "getting-started-with-zitadel" script around version 0.28.0. At that time none of the modern features was available. I used the migration guide to move over to the combine server and activate the proxy feature. Since I had issues with the proxy service, I digged inside the docker logs and also installed a brand new netbird server in parallel using the getting-started script at version 0.70.4. So I compared both installs and found some missing files/entries.
Author
Owner

@websheriff commented on GitHub (Jul 19, 2026):

Hello, I am trying to document your solution, however I cannot reproduce your initial setup with the bug. When running the getting-started.sh script, did you enable the proxy and disable crowdsec? Thanks!

It seems to be a recent change, I moved VPS providers and reinstalled netbird, I can't remember the exact version before but maybe about 1 month ago, but running the install script crowdsec worked. I recently did the script which is 0.74.4 and it seems it does not work with the install script.

EDIT: It looks like #5892 is related to this

<!-- gh-comment-id:5017266005 --> @websheriff commented on GitHub (Jul 19, 2026): > Hello, I am trying to document your solution, however I cannot reproduce your initial setup with the bug. When running the getting-started.sh script, did you enable the proxy and disable crowdsec? Thanks! It seems to be a recent change, I moved VPS providers and reinstalled netbird, I can't remember the exact version before but maybe about 1 month ago, but running the install script crowdsec worked. I recently did the script which is 0.74.4 and it seems it does not work with the install script. EDIT: It looks like #5892 is related to this
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#11557