RousselTMLEARNING

TP · CrowdSec: From Discovery to Expertise

Lab 4: Track banned IPs and attacks with Prometheus

What you will learn in this TP
  • Answer with cscli
  • Expose metrics
  • Query Prometheus
  • Alert on health
Mode :

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

Introduction #

Context. Your manager wants to know each week how many addresses are blocked and which attacks recur.

Prerequisites: lab 1  ·  Estimated time: 40 min

Setup #

Guided steps, with their solution.

  1. 1. Immediate answers

    With cscli, in the lab from lab 1.

  2. 2. Add Prometheus

    Add this service to the lab 1 Compose file.

  3. 3. Open and query

    Why? Metrics listen on 127.0.0.1 by default: Prometheus, in another container, would not see them.

  4. 4. Alert

    Write two health rules and validate them.

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 : ≈ 40 min

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

⭐ Rate this lesson

5.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 observability: banned IPs, blocked attacks, Prometheus and Grafana

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

Traefik plugins: the example of CrowdSec to block attacks

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

Traefik: metrics with Prometheus and OpenTelemetry

Expose Traefik metrics (Prometheus or OTLP), understand the series per entrypoint, router and ser...

CrowdSec: understanding the collaborative firewall

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

Metric types in Prometheus

Discover in detail the four metric types supported by Prometheus (Counter, Gauge, Histogram, Summ...

CrowdSec or Fail2ban: what are the differences?

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

Installing and configuring CrowdSec: packages, Docker, acquisition

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

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...

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!