Data Hop Firewall: Zero Trust & DLP in Rust and Envoy
By Shay Mordechai | March 8, 2026
This project was born from a practical need while building a SaaS product. After deploying EC2 on AWS, bots immediately started scanning for vulnerabilities. This pushed me to redesign the security model around Zero Trust.
1. Infrastructure Hardening
Closed all inbound EC2 ports. Routed all traffic through a Cloudflare Tunnel. Personal access secured via hardware USB Security Key. Services isolated inside containers in a Podman pod.
2. Layer 7 DLP
After reading about React2Shell and building on my V8 research, I realized network hardening alone was not enough. The core threat in microservice architectures is API Over-fetching (CWE-201/CWE-209) — where the backend returns full database objects and trusts the frontend to filter sensitive fields.
My first instinct was kernel-level filtering with eBPF — but I quickly realized it is Read-Only for payloads and cannot mutate HTTP response content. The solution came from Cloudflare Tunnel, which I already had running: a WASM filter in Rust on top of Envoy, sitting in User Space but intercepting HTTP responses before they leave the internal network.
3. Wasm DLP Firewall Architecture
Built a filter for Envoy Proxy in Rust compiled to WebAssembly (wasm32-wasi). Rust provided memory safety and performance. The Wasm sandbox allowed hot-reloading without proxy downtime.
- Recursive JSON Redaction: Deep-scans response payloads and masks sensitive keys.
- Logical Data TTL: Custom header (X-Data-TTL) triggers sanitization on specific responses.
- Fail-Closed Security: If a payload cannot be safely parsed, the response is dropped.
4. Real-World Case: Information Disclosure in a Financial Environment
Modeled on a real observation from a production banking environment (CWE-209): an idle session combined with a forced refresh triggered a raw ASP.NET 500 error exposing physical server paths, IIS and .NET versions, and web.config configuration hints.
The filter intercepts 5xx responses and replaces the sensitive payload:
{ "status": "error", "message": "Internal Security Proxy Intervention", "code": 500 }