chaitin /SafeLine
SafeLine is a self-hosted WAF(Web Application Firewall) / reverse proxy to protect your web apps from attacks and exploits.
★ 23,293⑂ 1,610👁 108⑃ 211● 1,068▤ 127
+7
日增长
23,293
stars
1,610
forks
108
watchers
211
prs
1,068
issues
127
releases
README
SafeLine - 雷池 - 不让黑客越过半步
🏠 官网 |
📖 文档 |
🔍 演示环境 |
🙋♂️ 社区微信群 |
国际版
🏆 项目荣誉
👋 项目介绍
SafeLine,中文名 "雷池",是一款简单好用, 效果突出的 Web 应用防火墙(WAF),可以保护 Web 服务不受黑客攻击。
雷池通过过滤和监控 Web 应用与互联网之间的 HTTP 流量来保护 Web 服务。可以保护 Web 服务免受 SQL 注入、XSS、 代码注入、命令注入、CRLF 注入、ldap 注入、xpath 注入、RCE、XXE、SSRF、路径遍历、后门、暴力破解、CC、爬虫 等攻击。
💡 工作原理
雷池通过阻断流向 Web 服务的恶意 HTTP 流量来保护 Web 服务。雷池作为反向代理接入网络,通过在 Web 服务前部署雷池,可在 Web 服务和互联网之间设置一道屏障。
雷池的核心功能如下:
- 防护 Web 攻击
- 防爬虫, 防扫描
- 前端代码动态加密
- 基于源 IP 的访问速率限制
- HTTP 访问控制
⚡️ 项目截图
| | |
| ------------------------------------------------- | ------------------------------------------------- |
| | |
查看 演示环境
🔥 核心能力
对于你的网站而言, 雷池可以实现如下效果:
- 阻断 Web 攻击
- 可以防御所有的 Web 攻击,例如 SQL 注入、XSS、代码注入、操作系统命令注入、CRLF 注入、XXE、SSRF、路径遍历 等等。
- 限制访问频率
- 限制用户的访问速率,让 Web 服务免遭 CC 攻击、暴力破解、流量激增 和其他类型的滥用。
- 人机验证
- 互联网上有来自真人用户的流量,但更多的是由爬虫, 漏洞扫描器, 蠕虫病毒, 漏洞利用程序等自动化程序发起的流量,开启雷池的人机验证功能后真人用户会被放行,恶意爬虫将会被阻断。
- 身份认证
- 雷池的 "身份认证" 功能可以很好的解决 "未授权访问" 漏洞,当用户访问您的网站时,需要输入您配置的用户名和密码信息,不持有认证信息的用户将被拒之门外。
- 动态防护
- 在用户浏览到的网页内容不变的情况下,将网页赋予动态特性,对 HTML 和 JavaScript 代码进行动态加密,确保每次访问时这些代码都以随机且独特的形态呈现。
🧩 核心能力展示
| | Legitimate User | Malicious User |
| ----------------------------- | --------------------------------------------------- | ---------------------------------------------------------------- |
| 阻断 Web 攻击 | | |
| 限制访问频率 | | |
| 人机验证 | | |
| 身份认证 | | |
| HTML 动态防护 | | |
| JS 动态防护 | | |
🚀 上手指南
📦 安装
查看 安装雷池
⚙️ 配置防护站点
查看 快速配置
📋 更多信息
防护效果测试
| Metric | ModSecurity, Level 1 | CloudFlare | 雷池, 平衡 | 雷池, 严格 |
| ----------------- | -------------------- | -------------------- | ---------------------- | --------------------- |
| 样本数量 | 33669 | 33669 | 33669 | 33669 |
| 检出率 | 69.74% | 10.70% | 71.65% | 76.17% |
| 误报率 | 17.58% | 0.07% | 0.07% | 0.22% |
| 准确率 | 82.20% | 98.40% | 99.45% | 99.38% |
雷池可以投入生产使用吗
是的,已经有不少用户将雷池投入生产使用,截至目前
- 全球累计装机量已超过 40 万台
- 防护的网站数量超过 100 万个
- 每天清洗 HTTP 请求超过 300 亿次
🌟 社区认可
- 获得 HelloGitHub 10.0/10 评分
- 被 awesome-selfhosted 收录
- 被 Cyber Press 评为 GitHub 上最受欢迎的开源 Web 应用防火墙
🔌 生态集成
- SafeLine MCP Server:支持通过 AI 辅助管理和控制雷池
- Ingress-NGINX:保护 Kubernetes Ingress 流量
- Kong Gateway:保护经过 Kong 的 API 和服务
🙋♂️ 用户社区
欢迎加入雷池 社区微信群 进行技术交流。
也可以加入雷池 Discord 来获取更多社区支持。
💪 专业版
雷池专业版现已发布!查看 社区版 vs 专业版,选择适合你的版本。Top issues
#563[Suggestion] DNS-01 challenge in 'Get free cert' / 申请泛域名免费证书 / 用 dns 验证方式申请免费证书42 comments · 2024-01-02#953[suggestion] Is it possible to implement interception based on behavioral characteristics?11 comments · 2024-06-26#1266[Bug] Spontaneous shutdown of the anti-bot protection6 comments · 2026-02-05#1235[Suggestion] 能不能开个个人付费版6 comments · 2025-10-29#1227[Suggestion] 社区版功能建议5 comments · 2025-09-16#1356[Bug] SafeLine reports almost all requests as 502 when using Traefik plugin4 comments · 2026-11-09#1355[Bug] [Security] Complete WAF detection bypass via body size limit (all modules affected)4 comments · 2026-11-09#1239[Bug] Blank Screen with HTML Dynamic Encryption enabled from Firefox/Opera3 comments · 2025-11-06
Discussions
#1319Bot Protect Break Phone Apps1 comments · 2026-09-04#1299雷池社区版怎么安装和排查控制台访问问题?0 comments · 2026-06-29#1243所以我在国外进不了IT天空就是这个的原因?1 comments · 2025-11-25#1238How to configure everything without UI0 comments · 2025-11-06#1218Possible to create www to non-www redirect rule?1 comments · 2025-08-23#1209How to install Safeline without Docker Compose to run at network edge and proxy to internal services?0 comments · 2025-07-27#1186App limit1 comments · 2025-05-14#1178How to bind the admin panel to the internal IP?0 comments · 2025-04-06
Latest release
SafeLine-CE 9.4.4 v9.4.4 2026-11-11Improved - Added a Beta upgrade channel: you can opt in from the console to try new features early, and upgrade smoothly to the stable release once it’s published - [Lite/Pro] Custom rules now support “Belongs to ASN / Does Not Belong to ASN” match operators. You can block attack sources by the ASN of the source IP without manually maintaining large IP ranges, and hit rules show ASN info in the logs. - [Pro] Domain-based upstreams now support dynamic resolution: when the DNS records of an upstream domain change, the resolved IP is updated automatically, so failover no longer requires a manu