Release 10 min read

WAFio 2.0 is released: a WAF agent written in Rust, and the source on GitHub

WAFio 2.0 is out. Why the WAF agent was ported from Go to Rust, what is different from version 1, why most of the source is now open, and which parts those are.

The WAFio logo and the words WAFio v2, in front of a bright teal glass shield that replaces a dim older one, beside an open panel of glowing gears and circuits

WAFio 2.0 is released. Two things changed at once. The WAF agent is a new program, written in Rust. And most of the source of WAFio is now public on GitHub.

This article has four parts: why the agent was ported from Go to Rust, what is different from version 1, why most of the source is now open, and what exactly is open source.

Why we ported the WAF agent from Go to Rust

The Go agent of version 1 judged a request twice: with the OWASP Core Rule Set, run by Coraza, and with our semantic engines. Before the release we ran both agents through blazehttp, the test tool from the makers of SafeLine, on the same machine and the same 33,669 samples. On those samples the rule set added 7 blocked attacks to what the semantic engines of the Go agent found, and 2,486 blocked normal requests.

After the engine work in Rust, the semantic engines alone blocked more of the attacks than both judges of version 1 together, with far fewer false blocks: 90.61 % detection and 0.06 % false positives, against 75.13 % and 8.36 % for version 1 with the rule set. That is why version 2 relies on the semantic engines alone.

Three more things decided the move:

  • CPU per request. On 13 November 2026, on one machine limited to 1.5 CPUs, the Rust agent used 0.149 times the CPU time of the Go agent to analyze the blazehttp samples, about one seventh.
  • Requests per second. With two worker threads each, the Rust agent served 2.8 times as many requests per second as the Go agent before it saturated.
  • One detection path. With the rule set gone there is one place where a request is judged, and one place to fix when a verdict is wrong.

The port was done in two steps. First the Rust agent had to give the same verdict as the Go agent on 130,509 recorded requests, so that a later difference could only come from a change made on purpose. Only then did the engines change.

It was not free. In that test the Rust agent used more memory at its peak under load, 201 to 209 MiB against 155 to 157 MiB for the Go agent, and the 99th percentile of the response time was 2.7 ms where our target is 1 ms. The method and every number are in the benchmark post.

What is different from version 1

Version 2 replaces the Go WAF agent with a WAF agent written in Rust and removes the OWASP CRS rule set (Coraza). Detection is done by the semantic engines. This page lists what a person who runs WAFio notices.

The WAF agent is written in Rust

In version 2 the WAF agent was ported from Go to Rust. It is a reverse proxy in front of your application, and version 2 ships no Go WAF agent.

  • What it does. Routing, body and path limits, rate limits, geo rules, bot checks, IP rules, custom rules, login protection, upload scan, the challenge, WebSocket limits, decision events and the link to the control plane. The agent takes its routes, upstreams and rules from the control plane over gRPC with mutual TLS.
  • Source. The agent is public under GPL-3.0-only at github.com/Wafio/wafio-agent-waf.
  • Supported systems. The release build was started on AlmaLinux 8.10, Rocky Linux 8.9 and 9.3, Debian 11, 12 and 13, and Ubuntu 20.04, 22.04 and 24.04, in container images. Under systemd it ran on Ubuntu 24.04 only, as a transient user service. The binary needs glibc 2.28 or newer, so Ubuntu 18.04 (glibc 2.27) and CentOS 7 (glibc 2.17) are refused. Other distributions with glibc 2.28 or newer should work and have not been started.

Detection is by the semantic engines

The rule set engine is gone. The OWASP CRS rule set (Coraza) is not part of version 2, and the Go detection engines were removed from the control plane. The semantic engines of the WAF agent decide whether a request is an attack.

  • Strong and weak detections. A detection is either strong, which blocks, or weak, which is logged. Score thresholds and base scores are gone. Three settings replace them: whether weak detections are recorded, the bot score at which a request is blocked in score mode, and a log action on a tuning rule.
  • Engine switches. The switches cover twenty engines. An engine can be switched off for a project or for one path, or set to log. An engine set to log still detects and records but never blocks, which suits a site that is being tuned.
  • What a decision shows. A decision shows the HTTP status the client received, the engines that were switched off for it, and the engines that were set to log.
  • API. The API no longer returns the rule engine of an agent, the rule-based and hybrid trigger counts, or the paranoia level of a route. Stored rows that say rule-based or hybrid read as semantic.

Upgrading from version 1

Nothing is rewritten in the database, and a configuration saved by version 1 still loads.

  • Restart. A running Go agent cannot reload into the Rust agent. The first upgrade restarts the agent, and so does a rollback.
  • Two files. The WAF agent comes as the agent and the engine library. The installer puts the library in place, and an agent whose library is missing or damaged does not start. An upgrade from version 1 installs the library.
  • Stored configuration. A configuration saved by version 1 loads, shows in the dashboard, saves again and produces a valid bundle. Keys that do nothing in version 2 are rewritten or removed when the configuration is read or saved, and in the bundle sent to an agent. Examples are score thresholds, base scores and the rule set switches.
  • Database. Four migrations from version 1.10, all additive: two columns for what an agent reports, a column for the HTTP status of a decision, and eight built-in Runtime Security rules for every host. Nothing is dropped, and no existing rule is changed or deleted.
  • Settings files. The control plane no longer reads crs.* or WAFIO_CRS_*, and a configuration that still sets them boots as before. The agent reads its security data directory from WAFIO_SECURITY_DATA_DIR, in place of three WAFIO_CRS_* lines of version 1. The installers write the new line, and a re-run removes the old ones. An agent file that was not touched still works, and the agent logs one warning.
  • Security data. wafio fetch-data and Administration › Security data no longer download the rule set.
  • Installers. On a host whose OpenSSL cannot verify Ed25519 (OpenSSL 1.1.1: AlmaLinux 8, Debian 11, Ubuntu 20.04), the installer checks the signature of a bundle with a verifier from the standard library of python3. It used to refuse to install there. A WAF agent upgrade is staged: the installer starts the staged agent with its library before it stops any service, and a library the agent cannot load is refused with the host as it was. A bundle that cannot be unpacked whole stops the install. Amazon Linux counts as the RHEL family.

Runtime Security stores less routine noise

An ordinary Ubuntu 24.04 workstation stored high and critical events for its own routine. In version 2 they are stored at medium severity, which opens no incident, and tagged unverified-identity, because a process chooses its own name.

  • What is covered. The shadow file reads of sudo, su, cron and similar helpers, the environment reads of process viewers such as ps and top, the setup steps of the container runtime at docker run, and the raw socket of ping and similar network tools. A program that reads the credential file of its own tool, such as ssh and its keys, is covered too.
  • What keeps its severity. Writes, opens that failed, and reads of another tool's credential file keep the severity they had.
  • Rules. Eight built-in rules do this, apart from the credential file case, which has no switch. Detection rules can test the result of an open (ret_val) and use the starts_with_any operator.

Why most of WAFio is open source now

Until version 2 the source of WAFio was closed, and the control plane and the host agent were shipped obfuscated. Two reasons changed that.

  • Trust. WAFio sits in front of your application and reads every request. The host agent runs as root and loads programs into the kernel. Software in that position should be readable by the people who run it. Now you can read what the proxy, the control plane and the BPF programs do, and build them yourself. The control plane and the host agent are no longer obfuscated either: with the source open, obfuscation hid nothing.
  • Reach. Open code is easier to try, to check and to fix. A bug report can point at a line, and a fix can arrive as a pull request.

What is open source

The control plane, the dashboard, the WAF agent, the host agent and the uddin script interpreter are public at github.com/Wafio.

Published

Five repositories, each under the license listed here.

  • wafio-cp-backend. Control plane: HTTP API, agent server, database migrations, the shared module the host agent uses, and the protocol both agents follow. Language: Go. License: GPL-3.0-only.
  • wafio-cp-frontend. Dashboard, a static app the control plane serves. Language: SvelteKit, TypeScript. License: GPL-3.0-only.
  • wafio-agent-waf. WAF agent: proxy, limits, bot checks, custom and script rules, and the link to the control plane. Language: Rust. License: GPL-3.0-only.
  • wafio-agent-host. Host agent: eBPF firewall and runtime security tracing. Language: Go, BPF C. License: GPL-3.0-only, the BPF programs GPL-2.0.
  • uddin-lang-rs. Interpreter of the uddin script language, which runs script rules inside the WAF agent. Language: Rust. License: MIT.

Reports and contributions

  • Contributing. Each repository has a CONTRIBUTING.md with its rules and one gate, scripts/ci-local.sh, which runs on Linux. The repositories under GPL-3.0 ask you to agree to a contributor license agreement (CLA.md) in your first pull request. uddin-lang-rs asks for a sign-off on each commit.
  • Security reports. A security problem never goes into a public issue. Each repository has a SECURITY.md that says how to report it privately. A missed attack is reported to wafio-agent-waf as a private security report.

Install or upgrade

The install command is on the download page. If you run version 1 today, read "Upgrading from version 1" above before you start.