CodeNewbie Community 🌱

Sharon428931
Sharon428931

Posted on

I Compared SafeLine WAF with Cloudflare and ModSecurity—Here’s What I Found

SafeLine vs Others

In Part 1, we covered how to deploy and configure SafeLine WAF, a free and open-source web application firewall developed by Chaitin Tech.

Now, it's time to put it to the test.


Smart Detection with Semantic Analysis

Unlike traditional WAFs that rely purely on rule matching, SafeLine features a built-in semantic analysis engine that interprets the intent behind requests—resulting in more accurate detection and fewer false positives.


Advanced Protection Features

Web Attack Defense

  • Protects against: SQL Injection, XSS, RCE, CRLF, XXE, SSRF, etc.

Bot Management

  • CAPTCHA, rate limiting, anti-crawling mechanisms

Bot Protection

HTTP Flood Protection

  • Automatically throttles IPs that exceed request thresholds

Flood Defense

Authentication Enforcement

  • Supports login protection for sensitive API endpoints

Login Protection

Threat Intelligence

  • Auto-blocks IPs from known malicious actors

Simulate Real Attacks

Try these examples to test SafeLine’s blocking capabilities:

# SQL Injection
https://your-site.com/?id=1+and+1=2+union+select+1

# XSS
https://your-site.com/?id=<img+src=x+onerror=alert()>

# Path Traversal
https://your-site.com/?id=../../../../etc/passwd

# Code Injection
https://your-site.com/?id=phpinfo();system('id')

# XXE
https://your-site.com/?id=<?xml+version="1.0"?><!DOCTYPE+foo+SYSTEM+"">
Enter fullscreen mode Exit fullscreen mode

Attack Blocked

Rule Triggered


Benchmark with BlazeHTTP

Use this Docker command to benchmark SafeLine WAF using BlazeHTTP, an open-source WAF testing tool:

docker run --rm --net=host chaitin/blazehttp:latest /app/blazehttp -t "http://127.0.0.1:8888"
Enter fullscreen mode Exit fullscreen mode

Detection Performance (Real Test Results)

WAF Accuracy Detection Rate Miss Rate False Positives
SafeLine (Personal - Balanced) 99.45% 71.65% 28.35% 0.07%
SafeLine (Personal - Strict) 99.38% 76.17% 23.83% 0.22%
SafeLine (Pro - Strict) 99.66% 90.68% 9.32% 0.07%
Cloudflare WAF 98.40% 10.70% 89.30% 0.07%
ModSecurity (Level 1) 82.39% 82.26% 17.74% 17.61%
ModSecurity (Level 4) 48.32% 96.77% 3.23% 52.49%

Metric Definitions

  • Accuracy = (Correct Blocks + Correct Passes) / Total Samples
  • Detection Rate = Correct Blocks / Attack Samples
  • Miss Rate = Missed Attacks / Attack Samples
  • False Positive Rate = Incorrect Blocks / Normal Samples

Performance & Resource Usage

Editions & Throughput

  • Personal Edition: Lightweight, runs on 1 core CPU + 1 GB RAM, handles ~800 QPS
  • Lite Edition: Optimized for low-resource scenarios
  • Pro Edition: High-performance, scalable with full feature set

Minimum Requirements

  • CPU: 1 core
  • RAM: 2 GB
  • Disk: 60 GB (2000 IOPS recommended)

To scale: Add +1 core, +2 GB RAM, and +40 GB disk for every 1000 QPS needed.


Join the Community


SafeLine is open source, battle-tested, and ready for production.

Give it a try, join the community, and help us shape the future of open-source WAFs.

Top comments (0)