Newshot

Show HN: Sibuna – A FOSS easy clustered load balancer to protect from AI bots

Original text(via HN AI)

sibuna

Distributed edge load balancer and web application firewall

Features · Load balancing · Benchmarks · Quickstart · Console · How it works · Documentation

English · 简体中文 · 한국어 · 日本語 · Español · Deutsch · हिन्दी · العربية

Sibuna routes TCP, UDP and HTTP to healthy servers from one edge node or a mesh. It can terminate TLS, inspect selected HTTP routes and help protect backends from DDoS floods.

Where we use Sibuna

  • Public websites Serve browsers over HTTP/2 or HTTP/3, renew public certificates with Let's Encrypt and inspect requests before forwarding them to HTTP/1.1 replicas.

Public websites

Serve browsers over HTTP/2 or HTTP/3, renew public certificates with Let's Encrypt and inspect requests before forwarding them to HTTP/1.1 replicas.

  • Internal gRPC services Issue certificates for internal names with the local CA. Clients trust its root and call the service over TLS. An HTTP/2 backend carries gRPC messages and trailers.

Internal gRPC services

Issue certificates for internal names with the local CA. Clients trust its root and call the service over TLS. An HTTP/2 backend carries gRPC messages and trailers.

  • A cluster of edge nodes Distribute a checked routing configuration across the mesh. Nodes can share bans and learned affinity while each node forwards traffic to its own backend pools.

A cluster of edge nodes

Distribute a checked routing configuration across the mesh. Nodes can share bans and learned affinity while each node forwards traffic to its own backend pools.

What is Sibuna?

Features

  • One executable: engine, embedded SQLite storage, browser solver and console assets.
  • Native packages: Linux, macOS, Windows, FreeBSD and OpenBSD. The browser solver uses WebAssembly.
  • Browser challenges: proof of sequential work (default) or Hashcash, followed by a signed session.
  • Access policies: allow, challenge, weigh or deny requests by address, path, headers and User-Agent.
  • Load balancing: TCP, UDP and HTTP in front of several servers, with TLS termination, automatic certificates and a cluster mode. See Load balancing.
  • DDoS protection at the edge We can cap concurrent flows per client IP and frontend, limit admission of new addresses under pressure and reserve UDP capacity for confirmed flows. Floods that saturate the uplink require upstream filtering.
  • TLS fingerprints: match the JA4 fingerprint that a trusted ingress forwards, exactly or by prefix.
  • Application inspection: built-in checks for SQL injection, XSS, path traversal and command injection.
  • Local rate limits: control bursts and sustained traffic, with optional limits per rule.
  • Operator console: traffic, sampled country activity, recorded incidents and policy editing.
  • Cluster support: a separate build shares policies and reputation through PostgreSQL.

Load balancing

Sibuna 1.0.0-rc.7 includes edge mode. We can also build the candidate from source.


        sibuna lb --bind :8080 --server 10.0.0.1:80 --server 10.0.0.2:80
sibuna lb --tls auto --domain example.org --server 10.0.0.1:80
sibuna lb --bind :8080 --server 10.0.0.1:80 --print-config > edge.jlv
sibuna check -f edge.jlv
sibuna --config-file edge.jlv
      

Configuring Sibuna with Jlavi

  • Forwarding: TCP and UDP, TLS passthrough routed by server name (exact or wildcard), QUIC passthrough and the PROXY protocol.
  • Under attack: limits of flows for each client address and each frontend, bans checked when a connection is accepted and shared over the mesh, automatic bans, refusal by reset or tarpit, a pressure mode that admits known clients first, accept threads on several cores, and a UDP packet budget that keeps a reserve for confirmed clients.
  • HTTP: TLS termination with HAProxy-style PEM bundles and post-quantum key exchange (X25519MLKEM768); HTTP/1.1, HTTP/2, HTTP/3 and WebSocket; routes by host name (exact or a wildcard such as *.example.org) and path to HTTP/1.1, HTTP/2 or HTTP/3 servers. On Linux, event-driven workers serve the connections, one worker per processor.
  • Certificates: automatic over ACME with renewal, fallback authorities and external account binding; wildcards through DNS with a hook program, an RFC 2136 update or the Cloudflare API; OCSP stapling; certificates on demand behind a guard; a local authority for localhost, internal names and IP addresses, with a revocation list and an ACME server of its own.
  • Servers: health checks, slow start, draining, weights, sticky sessions and a limit of flows for each server.
  • Changes while it runs: an accepted reload preserves established TCP streams. The admin socket drains, weighs, adds and removes servers (sibuna ctl /run/sibuna/edge.sock set server app/10.0.0.1:80 state drain). On Linux a new executable takes the listening sockets and the UDP mappings from the old one; QUIC connections end.
  • Cluster: the nodes of a mesh share the sticky table and the flow limits of a server, and forward a client to the node that owns it. A PostgreSQL database can publish one configuration to every node and roll it back. A mapped file keeps affinity hints across a restart.
  • Hooks: at the connection and at the request, compiled in, as WebAssembly with a budget, or as an agent on a Unix socket.
  • Observation: metrics, access logs and a console view of servers, flows and refusals.

The gate or the shield applies to the names that need it, or to none. The file stays the authority: a change at run time lasts until the next reload.

Production traffic qualification remains open. Its cluster features were tested on three hosts. Each design discussion lists what is built and the known gaps.

Quickstart

Download a release for your platform. The default package includes storage and console support. The console starts with --console.

PlatformPackageRequirements
Linux x86-64sibuna-linux-amd64.tar.gzLinux 5.10 or later; statically linked musl
Linux ARM64sibuna-linux-arm64.tar.gzLinux 5.10 or later; statically linked musl
macOS Apple Siliconsibuna-macos-arm64.tar.gzmacOS 12 or later
macOS Intelsibuna-macos-amd64.tar.gzmacOS 12 or later
Windows x86-64sibuna-windows-amd64.zipWindows 10 / Server 2016 or later; native sibuna.exe
FreeBSD x86-64sibuna-1.0.0-rc.7-freebsd-15.1-amd64.pkgFreeBSD 15.1; CLI package
OpenBSD x86-64sibuna-1.0.0-rc.7.tgzOpenBSD 7.9; CLI package

macOS builds are unsigned. Each package includes licenses, source links and a build manifest. Verify the archive against SHA256SUMS before using it.

Debian/RPM packages cover Linux x86-64 and ARM64; Arch sibuna-bin covers x86-64. FreeBSD 15.1 and OpenBSD 7.9 packages cover x86-64 and install the CLI. Linux packages include an optional, disabled systemd service. BSD packages create no service, account or state. These are upstream downloads; community archive acceptance is separate. The release also includes a Helm chart and a container image, ghcr.io/insanai/sibuna. See the package operations guide for installation, verification, private state, upgrades and Kubernetes setup.

The Sibuna Homebrew tap provides a CLI formula that installs the verified release archive for macOS and Linux (Apple Silicon, ARM64 and x86-64). The tap follows the newest published release. Installation does not start a service:


        brew tap insanai/sibuna
brew install insanai/sibuna/sibuna
sibuna --version
      

For Linux x86-64, with your app listening on port 3000:


        curl -fLO https://github.com/insanai/sibuna/releases/download/v1.0.0-rc.7/sibuna-linux-amd64.tar.gz
curl -fLO https://github.com/insanai/sibuna/releases/download/v1.0.0-rc.7/SHA256SUMS
sha256sum --ignore-missing -c SHA256SUMS
tar -xzf sibuna-linux-amd64.tar.gz
(umask 077; openssl rand -hex 32 > sibuna.seed)
./sibuna --host 127.0.0.1 --port 8080 --upstream-port 3000 --secret-file ./sibuna.seed
      

Open http://127.0.0.1:8080 to try it locally. For a public site, terminate HTTPS at a trusted ingress and keep Sibuna's listener private. Follow the deployment guide for Caddy or nginx.

The default mode is reverse_proxy. Use --mode forward_auth when your ingress forwards requests and asks Sibuna for an access decision. The guide includes both configurations. Shield's built-in inspection is enabled by default. Use --gate for admission without that inspector. Choose access rules with --policy-file <file>, including rules for API clients and health checks that cannot run a browser challenge. ./sibuna --help lists every option.

On Windows, extract the ZIP and run .\sibuna.exe --help in PowerShell. Use Ctrl+C to stop it. Restrict access to seed, credential and data files with Windows ACLs.

Build from source

All feature sets require Rust 1.100. We build the JSON-only daemon with --no-default-features and select sqlite,console as needed. The browser solver and the console interface are Rust compiled to WebAssembly; the build does not need Node or npm.


        git clone https://github.com/insanai/sibuna.git
cd sibuna
rustup toolchain install 1.100.0 --profile minimal --target wasm32-unknown-unknown
cargo +1.100.0 build --release -p sibuna
      

The executable is target/release/sibuna. It stores state in SQLite with --data-dir. Cluster builds use --features postgres-tls and share one PostgreSQL database through --database-url-file and --cluster-node. See CONTRIBUTING.md for tests, lints and size checks.

Console

The console runs in the same executable. Bootstrap an administrator while the daemon is stopped:


        ./sibuna init-admin admin --data-dir ./data
./sibuna --host 127.0.0.1 --upstream-port 3000 --secret-file ./sibuna.seed \
  --data-dir ./data --console 127.0.0.1:19446
      

Open http://127.0.0.1:19446/console/ and change the temporary password. The operations guide explains HTTPS access, GeoIP imports, users, API tokens and wall displays.

Sibuna Console with navigation, country activity globe, request outcomes, coverage and country samples
Sibuna Console with navigation, country activity globe, request outcomes, coverage and country samples

The globe shows sampled country activity over the last minute. Markers give approximate country positions. Arrows point toward the server's configured location. They do not show individual live connections. GeoIP needs a separately imported dataset. Set --console-location <latitude,longitude> to place the server on the globe.

Traffic overview - live request outcomes, admission and challenge counters, node health and sparklines.

Sibuna Console traffic overview with request, admission, challenge and denial counters
Sibuna Console traffic overview with request, admission, challenge and denial counters

Security overview - recorded findings, challenges, bans and a live event feed.

Sibuna Console security overview with inspection, challenge, ban and honeypot findings
Sibuna Console security overview with inspection, challenge, ban and honeypot findings

Policies - the rules a node applies, in order, with their recorded hits.

Sibuna Console policies page with the applied configuration and an allow rule
Sibuna Console policies page with the applied configuration and an allow rule

Events - recorded incidents, with filters by module, country, address, path and time.

Sibuna Console events page with incident filters and recorded SQL injection findings
Sibuna Console events page with incident filters and recorded SQL injection findings

The globe and traffic overview were captured in a normal Chrome window running v1.0.0-beta.2; the other views show v1.0.0-beta.1. All captures use a local test node with generated traffic and test GeoIP mappings. The displayed counts are not benchmark results.

How it works

A frontend accepts the connection. For TCP or UDP, Sibuna chooses a server for the flow. For HTTP, it matches the host and path on each request, applies the route's firewall policy and sends admitted traffic to a healthy server in the selected pool. Each edge can make that decision while its peers exchange affinity and ban updates.

A request can be admitted, challenged or denied. A visitor who solves a challenge receives a signed session. Later requests still pass the applicable policy and rate checks.

Solve a puzzle, receive a signed session and check rules on later requests
Solve a puzzle, receive a signed session and check rules on later requests

Gate checks access rules, sessions and local rate limits. Shield adds the built-in attack inspector. Shield is the default; --gate selects Gate at startup.

Gate and Shield request decisions: allow, challenge or block
Gate and Shield request decisions: allow, challenge or block

The diagram shows the built-in Gate and Shield checks. A valid session does not bypass applicable attack checks or request limits.

The jobs of the crates inside Sibuna
The jobs of the crates inside Sibuna

The crates separate networking, proofs, policies, local state, storage and management. The book explains their responsibilities.

Deployment limits

The private listener uses HTTP/1.1 behind an external ingress. In edge mode we can terminate TLS, HTTP/2 and HTTP/3 in Sibuna and forward to HTTP/1.1, HTTP/2 or HTTP/3 server pools. Forward-auth inspects the metadata supplied by the ingress. In reverse-proxy mode, the built-in inspector covers the first 8 KiB of a body. Uploads stream to your app. WebSocket messages are relayed without inspection. The inspector is a heuristic, not a full language parser.

Rate limits are local to each node. Sibuna does not provide volumetric network mitigation. The replacement of the executable without lost connections and the event-driven workers exist on Linux only. Challenges are bound to the node that issued them; route a challenge and its solution to the same node. The console's strict performance target has not formally passed. Review the deployment limits and measurements before enabling the console beside a production app.

Benchmarks

The book records the source revision, configuration and host for each run. These measurements show request cost under a few workloads on one machine. They do not measure equivalent protection or bot accuracy.

Sibuna on one host

These runs used an AMD Ryzen 9 5950X. The daemon had four CPUs and ran in memory; the load generator and a stub origin ran on eight other CPUs. wrk used 64 connections over loopback. Figures are medians of three runs.

  • In forward-auth mode, every workload ran at 197,532 to 211,636 requests per second, with a p99 of 305 to 327 us and 11.7 to 13.8 us of CPU per request. The load generator was the limit.
  • Proxied requests ran at 138,965 to 147,303 per second. Peak memory was about 16 MiB.
  • At an equal offered load of 100,000 admitted requests per second, the p99.9 latency was 62 us in forward-auth mode and 150 us in reverse-proxy mode.

Beside HAProxy and Envoy

On 25 November 2026 we ran Sibuna, HAProxy 3.0.11 and Envoy 1.40.2 with BoringSSL on the same host. Each proxy had eight CPUs and eight worker threads. We used the same origins, certificate and load generator, with 256 connections and a two-byte response over loopback. The first three rows give median requests per second across three eight-second runs. The last three give resident memory at the end of the run. The request rates in each case varied by at most 4%. Every request completed.

CaseSibunaHAProxyEnvoy
HTTP/1.1220,040220,32370,909
HTTP/1.1 over TLS174,611165,19963,399
HTTP/2104,132153,89968,972
Resident memory, HTTP/1.114 MiB48 MiB58 MiB
Resident memory, HTTP/1.1 over TLS21 MiB61 MiB61 MiB
Resident memory, HTTP/2116 MiB112 MiB140 MiB

Plaintext HTTP was effectively tied between Sibuna and HAProxy. HAProxy served about 48% more HTTP/2 requests than Sibuna, and used slightly less memory in that case. We used a static Envoy configuration with its router filter. Other settings or workloads could change the result. These short runs tell us little about dynamic configuration, application latency or performance across a real network. Method and measurements

Beside Anubis

We measured the official Anubis 1.27.0 release binary with the same workloads, CPUs and load generator. Hashcash work was matched: 8 zero bits for Sibuna, 2 zero hex digits for Anubis. The origin was caddy respond. The table shows admitted requests with a session.

Admitted requestsSibuna GateSibuna ShieldAnubis 1.27.0
Forward auth, req/s210,682208,63536,509
Forward auth, p99305 us308 us7,477 us
Forward auth, CPU per request12.1 us13.2 us106.3 us
Reverse proxy, req/s106,376103,29819,398
Reverse proxy, p993,331 us3,321 us11,062 us

The second run timed admission operations, each product on two CPUs. Anubis ran once with its default Ed25519 tokens and once with HS512 tokens.

Operations per secondSibuna (keyed BLAKE3)Anubis (Ed25519)Anubis (HS512)
Valid session check88,10410,95116,976
Unauthenticated check78,99728,61927,785
Challenge bootstrap42,6647,8937,952
Proof verification57,92412,66819,261

Sibuna's peak memory stayed near 16 MiB. Anubis used about 33 MiB in forward-auth mode and up to about 600 MiB in reverse-proxy mode. Anubis is a widely used and capable tool, and these rows are not a ranking. Several are not like for like: in forward-auth mode Anubis answers some paths itself, it does no payload inspection, and the challenge pages differ. The runs used loopback without TLS, real browsers or storage.

See the benchmark records for the method, ranges and replay commands: product-latest.md, latency-latest.md, comparison-latest.md and admission-latest.md. Part X of the book discusses each difference.

Documentation

  • Book: concepts, algorithms, examples and measurements.
  • Whitepaper: architecture, proofs and design details.
  • Operations guide: installation and deployment.
  • Reference: CLI and protocol details.
  • Design discussions: decisions and engineering contracts.
  • Contributing: source builds and checks.

Other software to consider

  • Anubis: browser challenges for reducing crawler traffic.
  • BunkerWeb: nginx, ModSecurity, CRS and bot challenges.
  • ModSecurity: a WAF engine used through connectors.
  • Coraza: a Go WAF library supporting ModSecurity rules and CRS.
  • OWASP Core Rule Set: attack-detection rules for WAF engines.

These projects cover different parts of web protection. Sibuna's inspector is built in; it does not run CRS or other ModSecurity rule sets. Pair Sibuna with a full WAF when your app needs broader rule coverage.

License

Sibuna is LGPL 3.0 or later. The license covers the engine, the libraries, the browser solver and the console, including its WebAssembly interface.

LICENSE describes the scope. LICENSES contains the full terms. NOTICE lists dependencies. Source and build scripts are available under each release tag.

Sibuna is written by Vikrant Rathore with assistance from Ronak Rathore and Kanak Rathore. Companies seeking other licensing terms can contact Vikrant Rathore. Third-party libraries and materials keep their respective licenses.

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗