SkillsApr 16, 2026·3 min read

SafeLine — Self-Hosted Web Application Firewall

SafeLine is a self-hosted WAF and reverse proxy that protects web applications from attacks using semantic analysis. It detects SQL injection, XSS, and other threats with near-zero false positives through AI-powered traffic inspection.

Agent ready

Review-first install path

This asset needs a review step. The copied prompt tells the agent to dry-run, show the writes, then proceed only after confirmation.

Needs Confirmation · 64/100Policy: confirm
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
SafeLine Overview
Review-first command
npx -y tokrepo@latest install 84b25adf-39db-11f1-9bc6-00163e2b0d79 --target codex

Dry-run first, confirm the writes, then run this command.

TL;DR
SafeLine is a self-hosted WAF that uses semantic analysis instead of regex rules to block SQL injection, XSS, and other web attacks.
§01

What it is

SafeLine is a self-hosted Web Application Firewall by Chaitin Technology. Unlike traditional WAFs that rely on regex pattern matching, SafeLine uses semantic analysis to understand the intent of HTTP requests. This approach catches sophisticated attacks that rule-based systems miss while dramatically reducing false positives.

It targets DevOps engineers, security teams, and small-to-medium organizations that want WAF protection without paying for commercial cloud WAF services. SafeLine runs as a reverse proxy in front of your web applications.

§02

How it saves time or tokens

Traditional regex-based WAFs require constant rule tuning to balance detection accuracy against false positives. SafeLine's semantic engine understands the structure of SQL, JavaScript, and shell commands, so it distinguishes between legitimate user input containing SQL-like syntax and actual injection attempts. This eliminates the hours spent writing and maintaining custom WAF rules.

One-line installation means you go from zero to protected in minutes rather than the hours or days required for configuring ModSecurity or AWS WAF rule sets.

§03

How to use

  1. Install SafeLine with the official one-liner:
bash -c "$(curl -fsSLk https://waf.chaitin.com/release/latest/setup.sh)"
  1. Open the dashboard at https://your-ip:9443 and complete the setup wizard.
  1. Configure upstream servers -- point SafeLine at your web application backends and it begins inspecting traffic immediately.
§04

Example

After installation, SafeLine exposes a management API for automation:

# Check SafeLine status
curl -k https://localhost:9443/api/v1/health

# List protected sites
curl -k -H 'Authorization: Bearer YOUR_TOKEN' \
  https://localhost:9443/api/v1/sites

The dashboard provides real-time attack visualization, blocked request logs, and traffic analytics without additional tooling.

§05

Related on TokRepo

  • Security Tools -- Security scanners and vulnerability detection tools for your infrastructure
  • Self-Hosted Tools -- Run security and monitoring tools on your own servers
§06

Common pitfalls

  • SafeLine acts as a reverse proxy, so your application sees SafeLine's IP rather than the client IP. Configure X-Forwarded-For header forwarding to preserve original client addresses.
  • The default admin credentials should be changed immediately after installation. The setup wizard prompts for this, but scripted installations may skip it.
  • Resource sizing matters: semantic analysis is more CPU-intensive than regex matching. For high-traffic sites (10K+ requests per second), allocate at least 4 CPU cores and 8GB RAM.

Frequently Asked Questions

What attacks does SafeLine detect?+

SafeLine detects SQL injection, cross-site scripting (XSS), command injection, code injection, SSRF, path traversal, and other OWASP Top 10 attack vectors. Its semantic engine analyzes the structure of payloads rather than matching fixed patterns.

How does semantic analysis differ from regex-based WAF?+

Regex WAFs match known attack strings, which attackers can bypass with encoding tricks or novel syntax. Semantic analysis parses the actual language structure (SQL grammar, JavaScript AST) to detect malicious intent regardless of obfuscation, resulting in fewer false positives and better detection of zero-day payloads.

Can SafeLine protect multiple upstream applications?+

Yes. SafeLine supports multiple site configurations, each pointing to a different upstream server. You define listener ports, upstream addresses, and per-site security policies through the dashboard or API.

Does SafeLine support HTTPS termination?+

Yes. SafeLine can terminate TLS connections and forward decrypted traffic to upstream servers. You upload your SSL certificates through the dashboard. It also supports Let's Encrypt auto-renewal for managed certificates.

What are the system requirements?+

SafeLine requires Docker and Docker Compose. Minimum specs are 2 CPU cores and 4GB RAM for light traffic. For production workloads with high request volumes, 4+ cores and 8GB+ RAM are recommended due to the computational cost of semantic analysis.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets