RousselTMLEARNING

TP · CrowdSec: From Discovery to Expertise

Lab 2: Write a scenario and test it in simulation

What you will learn in this TP
  • Understand a line with explain
  • Write a leaky scenario
  • Use simulation
  • Protect a trusted IP

Introduction #

What you will learn in this section
  • Understand a line with explain
  • Write a leaky scenario
  • Use simulation
  • Protect a trusted IP

Context. Your application returns 401 on /login on failure. You want a custom rule, tested before blocking.

Prerequisites: lab 1  ·  Estimated time: 40 min

Setup #

Guided steps, with their solution.

  1. 1. Understand a line

    Follow the path of an Nginx line.

  2. 2. Write the scenario

    Why? Four failures in a burst is an attack; an occasional failure is human error.

    Add the file to the container, then restart.
  3. 3. Switch to simulation

    Trigger the scenario in simulation.

  4. 4. Protect a trusted IP

    Add the range to an allowlist and see decisions removed.

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

My progress

  • ⏱ Estimated time : ≈ 40 min

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

💬 Ask a question

Recommended Articles

CrowdSec collections, parsers and scenarios

The Hub, collections, the parser pipeline and scenarios: install, understand with cscli explain, ...

Decisions, profiles, allowlists and AppSec in CrowdSec

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

CrowdSec: understanding the collaborative firewall

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

CrowdSec in production: best practices

Good habits for running CrowdSec in production: LAPI, keys, false positives, database, upgrades a...

Application Protection

Learn how to secure your backends against abuse and common attacks. A practical guide to Rate Lim...

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

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

Installing and configuring CrowdSec: packages, Docker, acquisition

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

CrowdSec or Fail2ban: what are the differences?

Comparing CrowdSec and Fail2ban: detection, blocking, sharing, performance, multi-server, and how...

CrowdSec bouncers: principles and firewall bouncer

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

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!