RousselTMLEARNING

TP · CrowdSec: From Discovery to Expertise

Lab 3: Protect Traefik with the CrowdSec bouncer

What you will learn in this TP
  • Declare the plugin
  • Wire the middleware
  • Block an address
  • Trust the right proxy
Mode :

All steps and instructions are shown. Recommended for this lab: guided

Introduction #

Context. Your site goes through Traefik. You want to return a 403 error to banned addresses.

Prerequisites: lab 1, Internet access to download the plugin  ·  Estimated time: 50 min

Setup #

Guided steps, with their solution.

  1. 1. The files

    Why? The key is shared: CrowdSec declares it (BOUNCER_KEY_traefik), Traefik uses it.

    In a new folder:
  2. 2. The middleware

    Generate the dynamic configuration and start.

  3. 3. Block

    Ban your own address as seen by Traefik, then lift the ban.

  4. 4. The real IP trap

    Simulate a client behind a proxy with X-Forwarded-For.

Validate your work

Check that each goal above is reached and that you get the result described in the introduction.

Difficulty level : ●●○○○ (2/5)

My progress

  • ⏱ Estimated time : ≈ 50 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

4.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

CrowdSec bouncers: principles and firewall bouncer

Understanding CrowdSec bouncers: where to block, live and stream modes, API keys, decisions API, ...

Protecting Traefik with CrowdSec: the bouncer plugin

Setting up the CrowdSec bouncer in Traefik: plugin, middleware, stream and live modes, real IP be...

CrowdSec bouncers: Cloudflare, network devices, Kubernetes and custom bouncer

Block at the CDN with Cloudflare Workers, feed pfSense or MikroTik with Blocklist Mirror, protect...

Traefik plugins: the example of CrowdSec to block attacks

Extend Traefik with plugins (official catalog, Yaegi interpreter), then protect your applications...

CrowdSec bouncers for Nginx, Apache and HAProxy

Setting up CrowdSec bouncers for Nginx, OpenResty, Apache and HAProxy SPOA: configuration, block ...

CrowdSec: understanding the collaborative firewall

What CrowdSec is, how it detects and blocks attacks: Security Engine, parsers, scenarios, Local A...

Installing and configuring CrowdSec: packages, Docker, acquisition

Install CrowdSec with packages or Docker, understand its files, declare the logs to read, enroll ...

CrowdSec observability: banned IPs, blocked attacks, Prometheus and Grafana

Monitoring CrowdSec: cscli metrics, banned IPs, detected attacks, volume blocked by bouncers, Pro...

Decisions, profiles, allowlists and AppSec in CrowdSec

Manage decisions with cscli, adapt block duration and type with profiles, avoid false positives w...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!