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

Introduction #

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

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.

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

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

CrowdSec: understanding the collaborative firewall

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

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

CrowdSec bouncers for Nginx, Apache and HAProxy

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

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

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

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!