CodeNewbie Community ๐ŸŒฑ

Sharon428931
Sharon428931

Posted on

Why SafeLine Might Be the Best Open Source WAF You Havenโ€™t Tried Yet

Image description

SafeLine is a free and open source Web Application Firewall (WAF) developed by Chaitin Tech. Itโ€™s lightweight, powerful, and offers enterprise-grade protection against a wide range of attacks โ€” SQLi, XSS, RCE, SSRF, Path Traversal, and more.


๐Ÿš€ Quick Deployment with Docker

mkdir -p "/data/safeline"
cd "/data/safeline"
wget "https://waf-ce.chaitin.cn/release/latest/compose.yaml"

# Edit environment variables
vi .env
Enter fullscreen mode Exit fullscreen mode

.env sample:

SAFELINE_DIR=/data/safeline
IMAGE_TAG=latest
MGT_PORT=9443
POSTGRES_PASSWORD=yourpassword
SUBNET_PREFIX=172.22.222
IMAGE_PREFIX=swr.cn-east-3.myhuaweicloud.com/chaitin-safeline
ARCH_SUFFIX=
RELEASE=
REGION=
Enter fullscreen mode Exit fullscreen mode

Start SafeLine:

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”’ How It Works

Without SafeLine:

User โ†’ Web Server
Enter fullscreen mode Exit fullscreen mode

Image description
With SafeLine:

User โ†’ SafeLine (reverse proxy) โ†’ Web Server
Enter fullscreen mode Exit fullscreen mode

Image description

Just like Nginx, it sits in front of your app and inspects every request.

Image description


๐Ÿง‘โ€๐Ÿ’ป Admin Console

# Reset admin password
docker exec safeline-mgt resetadmin
Enter fullscreen mode Exit fullscreen mode

Access the console at:

https://<your-ip>:9443

Image description


๐ŸŒ Add Sites & Free HTTPS Certificates

  • Go to Applications โ†’ Add Application
  • Forward port 80 and 443 to your backend service
  • Works like a transparent reverse proxy
  • Supports Let's Encrypt with auto-renew โ€” just enter the domain!

Bonus: Enable Auto HTTP to HTTPS redirect under Global Config.


๐Ÿ›ก๏ธ Protection Modes

Image description

Choose your site's defense level:

  • Defense: Block all attacks
  • Audited: Only log suspicious behavior
  • Offline: Show a maintenance page

A session ID sl-session is injected for tracking.


๐ŸŒ Join the Community


Stay tuned for Part 2, where we test SafeLine with real attack payloads and benchmark it against Cloudflare, ModSecurity, and others.

Top comments (0)