Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

SafeLine + CrowdSec: Building a Two-Layer Defense for Your Server

Description and use

SafeLine and CrowdSec together provide a two‑layer defense for a web application: CrowdSec blocks malicious IPs at the network level, while SafeLine filters dangerous HTTP requests at the application level.

Problem

Defending a web application requires protection at both the network perimeter and the application layer, but using separate tools can double effort and cause conflicts.

Outcome

Deploying both tools together creates a two-layer defense: CrowdSec blocks host-level threats before they reach the server, while SafeLine filters malicious HTTP payloads, ensuring comprehensive protection without workload duplication.

Workflow

  • Install SafeLine via the provided shell script and configure it as a reverse proxy in front of the app.
  • Point SafeLine to the application using the console at https://<your-server-ip>:9443.
  • Install CrowdSec as an agent and bouncer, enabling firewall integration (iptables/nftables).
  • Add relevant collections for the services running on the host to allow CrowdSec to learn behavior.
  • Verify that CrowdSec bans malicious IPs at the network level and SafeLine blocks malicious HTTP requests at the application level.
  • Monitor both tools to ensure no conflicts and that each layer functions as intended.

Evidence

CrowdSec watches your whole server and bans IPs that misbehave. SafeLine sits in front of your web app and filters malicious HTTP requests before they reach your code.

Source

SafeLine installs in one command and runs as a reverse proxy in front of your app: bash -c "$(curl -fsSLk https://waf.chaitin.com/release/latest/manager.sh)" -- --en

Source

CrowdSec installs as an agent plus a "bouncer" that enforces bans in your firewall (iptables/nftables). Add the collections for the services you actually run, and it starts learning behavior immediately.

Source

  • Record date: 2026-10-09T07:55:59.577Z