DEV Community

Arina Cholee
Arina Cholee

Posted on

19,400+ GitHub Stars: This Free WAF Is on Fire

Tired of constantly maintaining endless regex rules in traditional WAFs? Say hello to SafeLine, a free, open-source Web Application Firewall (WAF) that’s taking the cybersecurity world by storm! With over 19,400 stars on GitHub, SafeLine offers dynamic protection and semantic detection, making it perfect for defending against real-world attacks. Let’s dive into why it’s a must-have tool for developers and sysadmins.

Key Features

Dynamic Protection: Scramble Your Frontend Every Time

Gone are the days of static code that’s easy to target by bots. SafeLine dynamically obfuscates your HTML and JavaScript on every page load, making your source code unreadable to crawlers and bots.

  • /admin/login becomes a random encrypted path like /a8c9f1, and it changes with every refresh.
  • Real users see no difference, but crawlers are left in the dark.
  • Minimal impact: ~1ms extra latency, tested with BurpSuite, making it effective without compromising performance.

Bot Blocking That Actually Works

SafeLine doesn’t rely on outdated methods like checking User-Agent headers. Instead, it uses advanced behavioral analysis to identify bots based on:

  • JavaScript execution
  • Fingerprinting
  • Mouse movement

With SafeLine, bots fail and real users pass—once. After that, they can continue browsing without any interruptions.

  • No CAPTCHA needed, tested on Python scripts: blocked after 3 requests, IP locked for 30 minutes.
  • Customizable lock screens and thresholds for even finer control.

Semantic Detection: Not Just Rule Matching

Forget the old ways of static rule matching. SafeLine leverages semantic detection, which understands the intent behind malicious payloads. It can block attacks like:

  • SQL injection: Detects even obfuscated attempts like 1 AND 1=1.
  • XSS (Cross-Site Scripting): Blocks attacks using DOM-aware context, not just patterns.

Benchmark:

  • 33,669 requests tested
  • 575 malicious payloads blocked
  • Detection rate: 71.65%
  • False positives: 0.07%
  • Avg Latency: 1ms

Admin Panel Protection

SafeLine also provides robust security for your admin panel:

  • Role-Based Access Control (RBAC): Assign read-only access to ops, full control to engineers.
  • Two-Factor Authentication (2FA): TOTP-based, integrates with Microsoft Authenticator.
  • CLI Fallback: In case you lose 2FA access, use a simple docker exec command to reset.

Setup and Troubleshooting

Setting up SafeLine is straightforward, but here are some tips for common issues:

Issue Fix
502 Bad Gateway Check upstream config and container networking
Broken UI Whitelist static JS/CSS from encryption
Wrong IP in Logs Set CDN IPs as trusted to log the real attacker IPs

Recommended hardware:

  • 2 cores, 4GB RAM for less than 1ms latency.

Why Choose SafeLine?

  • No signature maintenance: Traditional WAFs require constant updates to rule sets. SafeLine’s semantic detection removes this burden, so you can focus on building.
  • Handles 2000+ TPS per core: SafeLine is built for performance, handling large amounts of traffic without breaking a sweat.
  • Free & open source: It’s available for everyone, so you can deploy it on your self-hosted app or even a CTF challenge.

Resources

If you're running a self-hosted app or need to protect your web assets from malicious traffic, SafeLine is definitely worth trying. With its innovative features, dynamic protection, and semantic detection, it’s a WAF that meets modern security needs.

🚀 Try SafeLine today and experience the future of WAF protection!

Top comments (0)