展示HN:Shibuya – 一款用Rust、eBPF和ML引擎构建的高性能WAF
Show HN: Shibuya – A High-Performance WAF in Rust with eBPF and ML Engine

原始链接: https://ghostklan.com/shibuya.html

## Shibuya:下一代Web应用程序防火墙 - 摘要 Shibuya是一款现代、开源的WAF,提供全面的安全防护和独特的功能。它采用分层方法,从**内核级别阻止**(通过eBPF/XDP)开始,以实现超快的(~1µs延迟)恶意IP和SYN洪泛攻击缓解。 安全性通过**双AI引擎**——孤立森林和随机森林进一步增强,提供跨10个类别的可解释攻击检测,推理时间小于5毫秒。Shibuya **符合OWASP标准**,包含615+ CRS规则和一个兼容ModSecurity的引擎,并具有热重载功能。 可扩展性是关键:Shibuya支持在沙盒环境中运行的**WASM插件**,可以使用任何语言编写。它通过影子模式和流量回放引擎提供**零风险部署**,以便进行彻底的测试。 独特的功能包括**API优先设计**,可从OpenAPI规范(包括GraphQL保护)自动生成规则,以及内置的**漏洞攻击环境(Ashigaru Lab)**,用于实际验证。最后,Shibuya提供**企业级功能**,如多租户、RBAC和联邦学习——所有功能均免费——以及**NLP策略和AI虚拟补丁**,以快速响应漏洞。

## Shibuya:一款新的基于Rust的WAF Shibuya是一款下一代Web应用程序防火墙(WAF),使用Rust构建,旨在实现高性能和智能威胁检测。与依赖正则表达式的传统WAF不同,Shibuya利用多层管道,结合高性能代理(Pingora)、速率限制和威胁情报。 主要特性包括:用于DDoS保护的基于eBPF的内核级数据包过滤,以及用于异常检测和特定攻击分类(SQLi、XSS、RCE)的双机器学习引擎。它还提供API和GraphQL保护,具有模式验证功能,并通过WebAssembly插件实现可扩展性。 该项目包含“Ashigaru Lab”,一个用于测试的易受攻击环境,以及一个SvelteKit仪表板,用于实时监控和配置。开发者正在寻求反馈,特别是关于Rust-eBPF集成和性能方面的反馈。初步反馈质疑机器学习分类器训练数据的稳健性。
相关文章

原文

01

Kernel Power · Linux Only

eBPF / XDP Kernel-Level Blocking

Shibuya drops an XDP hook directly in the Linux kernel. Packets from known-malicious IPs get killed before they ever reach your application or even the WAF itself. IP blacklists stored in eBPF maps for O(1) lookup on millions of IPs. SYN flood protection included. Toggle on/off at runtime via Admin API — no restart needed.

XDP hookeBPF mapsSYN floodO(1) lookupruntime toggle

⚡ Blocking latency: ~1 microsecond — faster than any userspace WAF possible

02

🧠 AI Security · Explainable

Dual ML Engine with SHAP Explainability

Two independent ML models run in parallel: an IsolationForest (via ONNX runtime) detects anomalies, and a Random Forest classifies attacks across 10 classes: SQLi, XSS, RCE, SSRF, XXE, SSTI, NoSQLi, Path Traversal, Command Injection, Benign. SHAP-like explainability shows exactly which top-5 features triggered the alert. Human-in-the-loop feedback loop. A/B model testing. Data drift detection.

IsolationForestRandom ForestONNX runtimeSHAP explainA/B testingdrift detection

🧠 ML inference <5ms · 10 attack classes · full confidence scoring

03

🛡️ OWASP Standard · ModSec Compatible

615+ CRS Rules — Full ModSecurity-Compatible Engine

Native SecRule parser with the full OWASP Core Rule Set — the enterprise-standard ruleset used worldwide. Every operator: @rx @pm @detectSQLi @detectXSS @ipMatch @validateByteRange. Anomaly scoring with 4 paranoia levels. ReDoS protection built-in. Rules hot-reload without downtime. Custom rule creation via Admin API or CLI.

942xxx SQLi941xxx XSS932xxx RCE930xxx LFI920xxx ProtocolReDoS guardhot-reload

🛡️ 615 rule files · 4 paranoia levels · hot-reload in production

04

🧩 Extensibility · Any Language

WASM Plugin System — Extend in Any Language

Extend Shibuya with WebAssembly plugins written in any language — Rust, Go, C, AssemblyScript, anything that compiles to WASM. Each plugin runs in a fully sandboxed environment with configurable memory limits, execution time caps, and fuel budgets. A host API lets plugins inspect and modify requests in real-time. No other open-source WAF has this.

any languagesandboxedmemory limitstime limitsfuel budgethost API

🧩 Any language → WASM → instant Shibuya plugin, zero core changes

05

🎭 Zero-Risk · Test in Prod

Shadow Mode + Traffic Replay Engine

Deploy new rules to production without any risk. Shadow mode logs what would have been blocked — without blocking anything. Configurable per-route, per-percentage (0–100%). Request replay engine captures real traffic to PostgreSQL and replays it against new policy versions, generating a full diff report: "old policy vs new policy" — with zero production impact.

per-route shadow0–100% capturePostgreSQL storereplay enginediff reports

🎭 Test policy changes on real traffic — zero risk, full insight

06

📐 API-First · Schema-Driven

Native GraphQL + OpenAPI Protection

Import your OpenAPI 3.x spec and Shibuya auto-generates positive security rules — only documented endpoints, methods, and schemas are allowed. GraphQL gets: depth analysis, complexity scoring, alias count validation, batch size limits, and introspection blocking. JWT validation and OAuth 2.0 for API auth. Response validation to catch data leakage on the way out.

OpenAPI 3.xpositive securityGraphQL depthcomplexity limitJWT/OAuthresponse validation

📐 Import spec → instant API protection with zero rules written manually

07

🔥 Included · Unique in the Market

Ashigaru Lab — A Complete Vulnerable Attack Environment, Shipped With Shibuya

No other WAF on the market ships with a built-in attack lab. Ashigaru is a full Docker-based environment with 6 deliberately vulnerable services — real exploitable vulnerabilities — so you can validate the WAF against actual attacks, not synthetic benchmarks. A Red Team Bot automates attacks. The War Room provides a full test suite dashboard. Test everything before you go live.

Express REST (5 vulns)React SSR (XSS+RCE)Flask AI (Prompt Injection)Apollo GraphQLPHP Legacy (SQLi+LFI)Red Team Bot

🔥 Real vulnerabilities · Real attacks · Real WAF validation — included, free

ASHIGARU — 6 VULNERABLE SERVICES

SQLi × 5Express Gateway
REST API

XSS + RCEReact Frontend
SSR attacks

Prompt InjectionFlask AI Search
LLM bypass

GraphQL AttacksApollo Engine
Depth + batch

SQLi + LFIPHP Legacy
Classic vulns

🤖 AutoRed Team Bot
Full attack suite

08

🏢 Enterprise Grade · $0 Cost

Multi-Tenancy + RBAC + LDAP + Federated Learning

Built for teams and enterprises at zero cost. Full multi-tenancy with tenant isolation, RBAC for role-based dashboard access, LDAP integration for enterprise SSO, OAuth 2.0. Federated Learning module shares threat intelligence across WAF nodes. Post-Quantum Cryptography for future-proof TLS. Hardware attestation via TPM. Dynamic SBOM for supply chain monitoring.

multi-tenancyRBACLDAP/SSOfederated learningpost-quantum TLSTPM attestationSBOM

🏢 Enterprise features that competitors charge thousands/month for — free

09

🤖 Next-Gen · No SecRule Needed

NLP Policies + AI Virtual Patching in 30 Seconds

Write security policies in plain English with the NLP policy engine — no SecRule syntax required. The AI Virtual Patching module automatically generates WAF rules from CVEs. Integrates with Burp Suite, nuclei, and ZAP — when a scanner finds a vulnerability, Shibuya blocks it in 30 seconds, without touching a single line of application code. Promote to permanent rule with one click.

NLP policiesAI patchingBurp Suitenuclei/ZAPCVE-to-blockone-click promote

🤖 Scanner finds CVE → WAF blocks in 30 seconds, zero code changes

联系我们 contact @ memedata.com