WAFio documentation
WAFio is a self-hosted Web Application Firewall and kernel-level security platform. Traffic inspection runs on your infrastructure. Configured providers supply threat intelligence and updates; uploaded files are inspected locally.
- Three-layer protection
- HTTP L7 WAF + eBPF kernel firewall + runtime security tracing, all reporting to the same control plane.
- Detection
- Semantic engines analyze each request, and the agent turns what they find into ALLOW, LOG or BLOCK.
- Multi-tenant control plane
- One control plane manages multiple projects. Each project is fully isolated with its own agents, rules, and credentials.
- Self-hosted
- WAFio stores traffic telemetry on your infrastructure. Updates and configured threat-intelligence integrations contact their providers; MalwareBazaar requires an abuse.ch Auth-Key.
- Allowed request
- Blocked request
- Policy sent out
- Event sent back
- 1 Control Plane (dashboard + REST API + gRPC agent orchestration)
- WAF Agent: HTTP L7 inspection reverse proxy sidecar
- Host Agent: eBPF kernel firewall (XDP/TC) + runtime security tracing
- Bundles downloaded from
wafio.cloud(free, no API key)
Quick start (install.sh)
The fastest way to deploy WAFio is the all-in-one installer script. One command downloads the signed binaries, installs PostgreSQL + TimescaleDB, runs migrations, creates your admin account, provisions mTLS certificates, and starts all three components as systemd services.
Want to see it first? The installer walkthrough replays a control plane install, a host agent enrollment and an upgrade, line by line.
- Linux. The installer detects Ubuntu, Debian, Raspbian and Linux Mint, and the RHEL family: RHEL, Rocky, AlmaLinux, CentOS, Fedora, Oracle Linux and Amazon Linux (on Amazon Linux use
--db dockeror--db existing). Where OpenSSL is 1.1.1 (AlmaLinux 8, Debian 11, Ubuntu 20.04), it checks the bundle signature withpython3. - Kernel 5.10+ with BTF enabled (required for host agent eBPF; 5.8 and 5.9 are not supported)
- x86_64 (amd64) architecture
- Root access;
curl,tar,opensslandpython3installed - PostgreSQL 17+ with the TimescaleDB extension: the installer runs it in its own Docker container, installs it on the host, or enables TimescaleDB on your existing PostgreSQL. Required only for the Control Plane.
- No account or API key required: WAFio is free to download.
- Signed bundle
- Unsigned or mismatched bundle, refused
The Control Plane stores all data in PostgreSQL, and uses the TimescaleDB extension for time-series event storage (WAF decisions, host security events, firewall events) with automatic retention: 30 days by default (host security events 7), adjustable under Administration › Data retention. History older than a day is stored compressed.
- Docker (
--db docker): PostgreSQL 17 + TimescaleDB in a container of its own (wafio-db), published on127.0.0.1only, data in/var/lib/wafio/postgresql. A PostgreSQL other applications already use on the host is not touched. Needs Docker. - Host (
--db host): the installer installs PostgreSQL 17 + TimescaleDB and tunes it. Beside another PostgreSQL version it uses the 17 cluster on its own port. - Existing PostgreSQL (
--db existing): the installer creates a dedicatedwafiodatabase and enables the TimescaleDB extension only inside that database. Existingshared_preload_librariesare preserved (timescaledb is merged in, not overwritten), and your memory/worker tuning is left as-is. When the server lacks TimescaleDB, the installer installs and preloads it only for a cluster of the same host and asks before restarting it (its other databases disconnect briefly); for any other server it stops with instructions. Thewafiorole is also grantedpg_read_all_settings(see below).
WAF Agent and Host Agent installs do not require PostgreSQL.
SSH into your Linux server and run:
curl -fsSL https://wafio.cloud/install.sh | sudo bash WAFio is free to download, with no account or API key required. Piping into sudo bash works: the prompts read from your terminal (/dev/tty), not from the pipe. To skip the component menu, name the component (controlplane, waf-agent, host-agent or all) as an argument or with --component:
curl -fsSL https://wafio.cloud/install.sh | sudo bash -s -- controlplane
curl -fsSL https://wafio.cloud/install.sh | sudo bash -s -- --component waf-agent
# Or download first, then run (recommended for production)
curl -fsSL https://wafio.cloud/install.sh -o wafio-install.sh
sudo bash wafio-install.sh --help The installer will prompt you for:
- Component selection: choose All Components for a complete setup
- Dashboard mount path (control plane): leave empty to serve the dashboard at the domain root, or give a path such as
/wafio-cpwhen it sits behind a reverse proxy under a sub-path. SetWAFIO_BASE_PATHaftersudo(for examplesudo WAFIO_BASE_PATH=/wafio-cp bash) to skip the prompt. - Database: a Docker container of its own, PostgreSQL on this host, or an existing server (
--db docker|host|existingskips the question; without a terminal the default is host) - Admin account: name, email, and password for the WAFio dashboard
- Project name: a label for your first security project
The installer automatically:
- Downloads the signed WAFio binaries from
wafio.cloud(free, no signup) - Verifies the SHA-256 checksum and the Ed25519 release signature of every bundle, and refuses to install an unsigned or mismatched one
- Installs or configures PostgreSQL + TimescaleDB
- Downloads security data (GeoIP, FireHOL, JA4, Bot signatures); an agent-only server downloads only what its agent needs
- Writes
/etc/wafio/config.yamlwith fresh JWT and 2FA encryption secrets - Runs all database migrations
- Creates your admin account and first project
- Provisions mTLS certificates for WAF and host agents
- Installs and starts all components as systemd services, then runs a health check
When installation completes, the dashboard is available at http://your-server:9087 (plus the mount path, if you chose one). Log in with the admin credentials you created during installation.
Both agents are already connected and running. Navigate to your project to see them online:
- WAF agents: your WAF agent is registered and awaiting traffic configuration
- Hosts: your host agent is online and the eBPF firewall is active
- Go to Applications › New application, choose your WAF agent, and set the listen port and upstream of your app
- Go to Hosts › Firewall to configure L3/L4 rules for your host
- Go to Hosts › Runtime security to review and tune detection rules
To protect another server, open Hosts, click Register host, and follow the Connect this host guide. It shows a one-command install with the host's key, your dashboard address and the SHA-256 of the agent CA filled in:
curl -fsSL https://wafio.cloud/install.sh -o wafio-install.sh && printf '%s\n' '<host key>' | sudo bash wafio-install.sh host-agent --host-key-stdin \
--url 'https://<dashboard>' \
--ca-sha256 '<CA SHA-256>' Use waf-agent instead of host-agent for a WAF agent (optional --agent-name NAME; the defaults are <hostname>@ebpf and <hostname>@waf).
- The agent's private key is generated on the server and never leaves it: only a certificate signing request is sent, authenticated by the host key
- The installer writes nothing unless the control plane's agent CA matches
--ca-sha256 --urlmust behttps://(http://only for loopback); use--dashboard-cacert FILEfor a dashboard with a private TLS certificate- The host key goes over stdin, so it never appears in
psor sudo's log - A host key enrolls only within 24 hours of the host being created or its key being rotated: rotate the key on the host's page to open a new window. Each host holds at most 4 enrolled credentials.
Verify services
After installation, verify all services are running:
sudo systemctl status wafio wafio-waf-agent wafio-host-agent
# View live logs
sudo journalctl -u wafio -f
sudo journalctl -u wafio-waf-agent -f
sudo journalctl -u wafio-host-agent -f PostgreSQL already installed?
If your server already runs PostgreSQL for other applications, choose docker to keep WAFio's database apart from it: nothing in the existing server changes and it is never restarted. Choose existing to use that server: the installer asks for its connection details and creates a dedicated wafio user and database. Your existing databases are not touched. Required: PostgreSQL 17+. When TimescaleDB is missing there, the installer installs the package and preloads it only for a cluster on the same host (asking before it restarts that cluster); for a server elsewhere it stops with instructions.
# PostgreSQL in its own container (the server needs Docker)
curl -fsSL https://wafio.cloud/install.sh -o wafio-install.sh
sudo bash wafio-install.sh controlplane --db docker
# back up the container's database
sudo docker exec wafio-db pg_dump -U postgres -Fc wafio > wafio.dump For a database on the same host, the installer also grants pg_read_all_settings to the control plane's role (wafio) on install and on every upgrade, so the database size alert can check the free disk. The role can then read every server setting but no files or data; keep secrets out of settings (for example a password in primary_conninfo belongs in a passfile). To skip the grant, set WAFIO_SKIP_SETTINGS_GRANT=1 after sudo, which drops the caller's environment. For a database on another host, run GRANT pg_read_all_settings TO wafio; there yourself if you want the disk check.
# Install or upgrade without the grant
curl -fsSL https://wafio.cloud/install.sh | sudo WAFIO_SKIP_SETTINGS_GRANT=1 bash Upgrading an existing install
Re-running the installer on a server that already has WAFio is safe and idempotent. The script auto-detects an existing install and switches to upgrade mode:
- Downloads and checks every bundle, and checks that the new WAF agent loads its new engine library, before it stops any service. Only then does it stop each service and put the new files in place, so a refused bundle leaves the server as it was
- Preserves
/etc/wafio/config.yamlas it is: JWT secret, 2FA encryption key, database credentials and your other settings are kept, so users stay logged in and 2FA keeps working (a backupconfig.yaml.bak.<time>is saved next to it) - Skips admin, project, and credential creation: no duplicate projects, no setup errors
- Keeps the agent certificates, and the gRPC address and agent name in the agent
*.envfiles (an agent re-run with--urlafter a key rotation is enrolled again and gets a renewed certificate). Inwaf-agent.envit removes the three rule set lines of version 1 (WAFIO_CRS_*), setsWAFIO_SECURITY_DATA_DIRfrom them when it is not set yet, and addsWAFIO_ENGINE_LIB_REQUIRED=1when it installs the engine library - Refreshes the binaries, the engine library of the WAF agent, the agent systemd units (taken from the bundle), the frontend assets, the database migrations and the security data, then restarts the services
# Same command: upgrades in place
curl -fsSL https://wafio.cloud/install.sh | sudo bash Before you upgrade:
- Upgrade the control plane first (it runs the migrations), then the agents. Agents of version 1 keep running against a version 2 control plane until you upgrade them, with three limits. A host agent older than version 2 does not apply the new forwarding filter and sends every runtime event. A WAF agent older than 1.9 refuses a policy that names
jwtorgraphqlin a path override or inskip_semantic, and keeps serving its cached policy. A version 1 WAF agent ignores Log only on an engine and blocks. A version 1 WAF agent cannot reload into the version 2 agent, so the first upgrade and a rollback restart it. - The installer installs only the latest release and keeps no copy of what it replaces. To be able to go back, first keep a
pg_dumpof the database and a copy of/usr/local/bin/wafio*,/usr/lib/wafio/,/etc/wafio/(the agent env files),/etc/systemd/system/wafio*.service,/opt/wafio/frontendand/opt/wafio/migrations. - When you upgrade from a version before 1.9, history older than a day is compressed by a TimescaleDB background job (community license, as the installer sets up) after the upgrade (about 80 s for 1 GB on one vCPU).
- On PostgreSQL without TimescaleDB (or with its Apache-licensed build), the control plane starts deleting telemetry older than its retention (30 days, host security events 7) one hour after its first start. To keep more, raise it under Administration › Data retention within that hour.
Architecture
WAFio uses a hub-and-spoke architecture. The Control Plane is the central brain: it stores configuration, aggregates telemetry, and pushes rule updates to agents over a gRPC mTLS channel.
- Policy out
- Events back
Component roles
| Binary | Role | Port |
|---|---|---|
wafio | Control plane: dashboard, REST API, agent orchestration, telemetry storage | HTTP :9087, gRPC :9090 |
wafio-waf-agent | HTTP reverse proxy sidecar: inspects every request before it reaches your app | Configurable (e.g. :8080) |
wafio-host-agent | Linux-only eBPF agent: L3/L4 kernel firewall + runtime security tracing | Local API on 127.0.0.1:18089 (--listen); no public port |
How agents connect
Agents connect to the control plane over gRPC (port 9090) using mutual TLS (mTLS). Each agent presents a client certificate, enrolled from the host with the one-command install or provisioned on the Credentials page. The certificate's SHA-256 fingerprint identifies which project the agent belongs to, so no additional API key is needed at runtime. An enrolled certificate is also bound to its host, agent kind and agent name.
On connect, the control plane pushes a bundle containing the full WAF configuration. The agent applies it and begins inspecting traffic. Subsequent configuration changes are pushed automatically without restarting the agent. The WAF agent keeps the last applied bundle (last-bundle.json in its state directory, /var/lib/wafio-waf-agent) and keeps serving from it when the control plane is unreachable at start.
- Policy out
- Events back
Storage
| Store | Purpose |
|---|---|
| PostgreSQL + TimescaleDB | All control-plane data: users, projects, agents, WAF decisions, host security events, firewall events, and audit logs. TimescaleDB hypertables for time-series event storage, compressed after a day, with automatic retention (30 days by default, runtime security events 7, adjustable under Administration › Data retention). |
Security data setup
WAFio requires external threat intelligence data: GeoIP databases, IP reputation lists, JA4 fingerprints, and bot signatures. These datasets are not bundled in the binary and must be downloaded separately.
When you install WAFio using install.sh, security data is downloaded automatically. This section is relevant only if you need to refresh data or used a manual install.
Without security data the WAF agent does not start: it needs the GeoIP country, city and ASN databases, the bad-bot user-agent list and a JA4 (or JA3) fingerprint file. The host agent starts with GeoIP enrichment off.
- Update fetched
- Events and telemetry
- Upload not sent
Malware hash feeds have a separate credential setup. See Malicious uploads detection to configure MalwareBazaar and verify agent synchronization.
Download general security data
# Download all security data (no MaxMind account required)
./wafio fetch-data What gets downloaded
| Component | Files | Used for |
|---|---|---|
geoip | security-data/geoip/country.mmdbcity.mmdb, asn.mmdb | GeoIP country blocking, dashboard geo map, IP enrichment |
firehol | security-data/firehol/firehol_level1.netsetfirehol_level2.netset | IP reputation blocklists (known malicious IPs, botnets, scanners) |
ja4 | security-data/ja4/ja4.txtja4_allowlist.txt | A built-in list of TLS fingerprints of HTTP client libraries, scanners and exploit tools, and an allowlist of browsers and search engine crawlers. WAFIO_JA4_BLOCKLIST_URL and WAFIO_JA4_ALLOWLIST_URL replace them with a feed. |
ja3 | security-data/ja3/ja3.txt | Legacy JA3 TLS fingerprint list (Salesforce, abuse.ch) |
ua | security-data/user-agents/bot.txt | Bad bot user-agent strings (scrapers, attack tools) |
malware | security-data/malware/malware_hashes.txtmalware_bloom.bin | MalwareBazaar SHA-256 hashes for upload scanning. Needs an auth key (see Malicious uploads detection); without one, a run skips it and keeps the current database. |
GeoIP provider: DB-IP vs MaxMind
By default, WAFio downloads from DB-IP, a free GeoIP provider with no account or license key required. If you need MaxMind GeoLite2, obtain a free license key at maxmind.com and set it in config:
geo:
maxmind_license_key: "YOUR_FREE_LICENSE_KEY_HERE" Then re-run ./wafio fetch-data --force. On a server without the control plane, pass --maxmind-key to the agent's fetch-data or set WAFIO_MAXMIND_LICENSE_KEY.
Profiles and agent-only servers
--profile picks the component set. For wafio fetch-data it is all (default), control-plane or agent; --only geoip,firehol,… fetches single components and --dir sets the target directory. A server without the control plane has no wafio binary: the agents carry their own fetch-data command, and the installer uses it. wafio-waf-agent fetch-data defaults to --profile agent and --dir /etc/wafio/security-data; wafio-host-agent fetch-data takes only --profile host-agent:
sudo wafio-waf-agent fetch-data --dir /opt/wafio/security-data --profile agent Keeping data fresh
GeoIP databases update monthly. The WAF agent reloads the FireHOL lists itself every 24 hours: from GitHub, or from the files named by WAFIO_IPREP_LEVEL1_FILE and WAFIO_IPREP_LEVEL2_FILE when they are set. The JA4 lists are built in. Files that already exist are skipped unless --force is given. Recommended monthly cron on a control plane server installed by install.sh (on an agent-only server, run the agent's own fetch-data with its profile instead):
# /etc/cron.d/wafio-update-security-data
0 3 1 * * root /usr/local/bin/wafio fetch-data --dir /opt/wafio/security-data --profile all --force >> /var/log/wafio-fetch-data.log 2>&1
# On a server with only the WAF agent:
# 0 3 1 * * root /usr/local/bin/wafio-waf-agent fetch-data --dir /opt/wafio/security-data --profile agent --force >> /var/log/wafio-fetch-data.log 2>&1Malicious uploads detection
Check complete uploaded files against known malware SHA-256 hashes, directly on your WAF agent.
A Bloom filter screens candidate hashes, then an exact SHA-256 lookup confirms each match. A Bloom candidate alone never triggers a malware verdict. This protects against Bloom-filter false positives; it does not guarantee that threat intelligence is error-free or that an unmatched file is safe.
1. Connect MalwareBazaar
- Sign in to the abuse.ch Authentication Portal and obtain your Auth-Key. This is an abuse.ch account credential, separate from your WAFio login, license, or agent certificates.
- As a WAFio system administrator, open Administration › Security data › MalwareBazaar. Paste the key value and save it. If you downloaded a file containing the key, copy the key itself; do not paste a download URL or account password.
- Select Check access & update hashes. Review the update log and the connected WAF agents' database status before enabling enforcement.
The control plane stores the provider key encrypted, downloads hash lists, and distributes them to compatible WAF agents over authenticated connections. The key stays on the control plane; uploaded files are not sent to MalwareBazaar. Updates from this screen run when requested, not on an automatic schedule.
Provider requirements and export availability are documented in the MalwareBazaar export documentation.
- File forwarded
- File blocked
- Hash list
2. Choose an upload policy
Open Project settings, switch to the Default WAF policy tab, and select Uploads and body size (an application can override the project policy in the Config tab of its page). Under Malicious uploads, turn on Scan uploads for known malware, choose the policies below, then save the WAF configuration. Connected agents receive the updated configuration automatically.
| Setting | Behavior |
|---|---|
| When malware is detected | Block upload rejects a confirmed match with HTTP 403. Log only records the detection and forwards the request. |
| When scanning is incomplete | Forward and log is the default for scan limits and errors. Forward with scan details and Reject upload are also available. Log only mode always forwards. |
| Scan budget per request | Default: 10 MiB (10,485,760 bytes), at most 100 MiB, shared across files and fields in a request. A file that cannot be read completely within the remaining budget is not hash-matched. |
| Multipart file uploads | Enabled by default. Inspects individual file parts in multipart uploads; processing is also limited to 128 parts. |
| Raw request bodies | Disabled by default. Enable for endpoints that send the file as the entire non-multipart request body. |
| Your hash lists | Optional SHA-256 entries under Blocked hashes and Allowed hashes. A match in Allowed hashes is never reported as malware and takes precedence over the blocked list; it does not bypass other WAF protections. |
Start in Log only mode with Forward and log for incomplete scans. Observe your real upload sizes and application behavior, verify database synchronization, then switch confirmed malware matches to Block. Other WAF rules and your application can still reject an upload.
What happens when the database is missing?
When no downloaded database is available, the current offline fallback contains only the EICAR test signature. This fallback is not classified as an incomplete scan. A file with no match can therefore pass the hash check even when the real malware feed is absent. A successful EICAR test alone does not prove that the MalwareBazaar database is installed.
If the scan reports an unavailable database, a parsing error, or a size/part limit, the incomplete-scan policy applies. Keep Forward and log selected if these reported scan failures should not interrupt client uploads. An incomplete scan blocked by policy is not labeled as a malware match.
3. Verify before enforcing
- Use a controlled test application and an innocuous file. Verify that the upload reaches the application and review its response.
- Use the standard EICAR test file to check policy handling. With scanning disabled, this feature does not reject it. With scanning enabled in Block mode, a confirmed match returns HTTP 403. Log only forwards and records the detection.
- Test a file larger than the scan budget. Forward and log should preserve delivery; Block should reject the incomplete scan when enforcement mode is Block.
- Check the agent's database source, hash count, and synchronization status separately. Confirm that it has the downloaded feed, not just EICAR fallback.
Coverage and limits
Exact hash detection recognizes known byte-for-byte files. Modified malware, unknown malware, and files inside archives require additional inspection. Archives are not unpacked, and partial files are never treated as complete hash matches. Use this feature alongside application-side file validation, storage controls, and any additional scanning your application requires.
The configuration key is content_scan.on_incomplete, with values log (default), allow, or block. Keep this policy distinct from content_scan.mode, which controls confirmed malware matches.
First-run bootstrap
The installer runs both commands below automatically. This page covers manual installs and recovery when the installer cannot complete.
Two commands on the control-plane host:
wafio migrate up
wafio admin create --email you@example.com --name "Your Name" admin create prompts for the password and reads it from the terminal. A --password flag exists, but avoid it: flag values are visible in ps to every user on the machine. A non-interactive install can pipe a single line on stdin instead. The password must be at least 12 characters and at most 72 bytes.
Every account created this way gets system role: admin, which reaches every project, manages members, and can use the admin API. Confirm it exists with:
wafio admin list Configuration is validated at boot
The control plane refuses to start on a configuration it cannot run safely, and reports every problem at once rather than one per restart:
jwt.secretmust be set, at least 32 characters, and must not be the placeholder shipped in the example config or any secret ever published in the WAFio repositorytotp.enc_keyis mandatory and must decode to exactly 32 bytes (openssl rand -hex 32)database.name, host and port must be usable- a wildcard CORS origin combined with credentials is rejected
server.trusted_proxiesmust hold valid IPs/CIDRs no broader than IPv4 /8 or IPv6 /16, andserver.proxy_headermust beX-Forwarded-FororX-Real-IPlog.levelmust bedebug,info,warnorerror
totp.enc_key is mandatory. 2FA secrets stored before it was set keep working, and are stored encrypted the next time the user sets up 2FA again. Keep the key stable and backed up: changing or losing it makes the encrypted secrets unreadable and locks those users out of 2FA.
After bootstrap
- Log in at
http://your-server:9087/login - Click New project to create your first security project
- Open Hosts, click Register host and run the one-command install from the Connect this host guide on each server (see Host agent setup)
- Or, for a manual install, issue a project credential on the Credentials page and deploy the agents with it
Manual install
This section describes manual installation. If you are deploying for the first time, use Quick start (install.sh) above: the installer script handles everything automatically.
Prerequisites
- Linux server, x86_64
- Kernel 5.10+ with BTF for the host agent (
ls /sys/kernel/btf/vmlinuxmust exist) - PostgreSQL 17+ (TimescaleDB recommended)
- Ports 9087 (HTTP) and 9090 (gRPC) open in your firewall
Download binaries
Download bundles from the portal (free, no API key):
# Download WAFio bundles
curl -fsSL "https://wafio.cloud/api/download/controlplane" -o wafio-controlplane.tar.gz
curl -fsSL "https://wafio.cloud/api/download/waf-agent" -o wafio-waf-agent.tar.gz
curl -fsSL "https://wafio.cloud/api/download/host-agent" -o wafio-host-agent.tar.gz
# Verify checksums (from manifest)
MANIFEST=$(curl -fsSL https://wafio.cloud/api/download/manifest)
# Extract sha256 values and verify with sha256sum;
# the Ed25519 signature of each bundle: /api/download/<component>/sigStart dependencies
WAFio requires PostgreSQL 17+. The TimescaleDB extension is recommended and used automatically when present; without it the event tables are plain tables without chunking or compression, and the control plane deletes rows past their retention itself, every hour.
# Add the apt.postgresql.org repository first, as install.sh does
sudo apt-get install -y postgresql-17
# Optional but recommended (chunking, compression, fast retention):
# add the TimescaleDB package and extension for your distroConfigure the control plane
The bundle has no config directory. Write config/config.yaml next to the wafio binary (the control plane reads config/config.yaml or ./config.yaml from its working directory) with at least these settings:
# config/config.yaml
server:
http_addr: ":9087"
database:
host: localhost
port: 5432
name: wafio
user: wafio
password: your-db-password
jwt:
secret: "output-of-openssl-rand-hex-32"
totp:
enc_key: "openssl-rand-hex-32-output"Run the control plane
# The dashboard files carry the placeholder /__WAFIO_BASE__: replace it with
# your mount path, or with nothing when the dashboard is at the domain root
find frontend -type f \( -name '*.html' -o -name '*.js' -o -name '*.json' -o -name '*.css' \) \
-exec sed -i 's#/__WAFIO_BASE__##g' {} +
# Run migrations + start server
./wafio serve --migrate
# Or run in background
nohup ./wafio serve --migrate > wafio-server.log 2>&1 & The dashboard files in frontend/ carry the placeholder /__WAFIO_BASE__, which the installer rewrites. For a manual install, rewrite it with the sed command above before you open the dashboard: as shown, it serves the dashboard at the domain root; for a sub-path, put the mount path (such as /wafio-cp) after the second #. Create the first administrator on the host with wafio admin create --email you@example.com --name "Your Name", then sign in at http://your-server:9087/login. The browser setup wizard was removed; see First-run bootstrap.
Provision credentials
The simplest path is the one-command install from Hosts › Register host › Connect this host (see Host agent setup): it enrolls each agent with a key generated on its own server. For a fully manual install, go to Credentials in your project sidebar, enter a name and click Issue credential. Download the credential bundle immediately: the private key is shown only once.
The bundle (wafio-<name>-bundle.tar) contains ca.crt, client.crt, client.key and a systemd unit, wafio-<name>.service. The installer also accepts it directly: sudo bash wafio-install.sh waf-agent --bundle credential.tar.
Deploy WAF agent
Copy the agent binary and the provisioned certificate bundle, then run it with the mTLS paths. Routes and listen ports are pushed from the control plane: the agent needs transport and data paths only.
sudo install wafio-waf-agent /usr/local/bin/wafio-waf-agent
sudo install -D -m 0644 libwafio_semantic_engine.so /usr/lib/wafio/libwafio_semantic_engine.so
id wafio >/dev/null 2>&1 || sudo useradd --system --no-create-home --shell /usr/sbin/nologin wafio
sudo mkdir -p /etc/wafio/certs/waf
sudo cp ca.crt client.crt client.key /etc/wafio/certs/waf/
sudo chown -R root:wafio /etc/wafio/certs/waf
sudo chmod 0750 /etc/wafio/certs/waf
sudo chmod 0640 /etc/wafio/certs/waf/client.key
# Security data the agent needs to start (GeoIP, bot list, JA4)
sudo wafio-waf-agent fetch-data --dir /opt/wafio/security-data --profile agent
sudo chown -R wafio:wafio /opt/wafio/security-data
# /etc/wafio/waf-agent.env
WAFIO_GRPC_SERVER=your-control-plane:9090
WAFIO_GRPC_CA_CERT=/etc/wafio/certs/waf/ca.crt
WAFIO_GRPC_CLIENT_CERT=/etc/wafio/certs/waf/client.crt
WAFIO_GRPC_CLIENT_KEY=/etc/wafio/certs/waf/client.key
WAFIO_AGENT_NAME=edge-waf-prod
WAFIO_ENGINE_LIB_REQUIRED=1
WAFIO_SECURITY_DATA_DIR=/opt/wafio/security-data
WAFIO_GEO_COUNTRY_DB_PATH=/opt/wafio/security-data/geoip/country.mmdb
WAFIO_GEO_CITY_DB_PATH=/opt/wafio/security-data/geoip/city.mmdb
WAFIO_GEO_ASN_DB_PATH=/opt/wafio/security-data/geoip/asn.mmdb
WAFIO_UA_BAD_BOT_FILE=/opt/wafio/security-data/user-agents/bot.txt
WAFIO_JA4_BLACKLIST_FILE=/opt/wafio/security-data/ja4/ja4.txt
WAFIO_JA4_ALLOWLIST_FILE=/opt/wafio/security-data/ja4/ja4_allowlist.txt The agent registers itself on first connect (or register it by name under WAF agents › Register agent). Then add an application under Applications › New application with its listen port and upstream, choosing this agent, and the bundle is streamed to the agent over mTLS gRPC within seconds.
Verify
In the dashboard, navigate to WAF agents. Your agent should appear as Online. Test with a SQL injection payload:
curl "http://your-agent:8080/?id=1' OR '1'='1"
# Expected: 403 Forbidden (if blocking mode is enabled)Dashboard tour
The WAFio dashboard gives you a real-time view of your infrastructure's security posture. Here is a walkthrough of every section.
Projects list
The projects list is your starting point. Each project represents an isolated security environment, with its own agents, credentials, WAF rules, and event log.
Project overview
The Overview is the mission control for one project: WAF decision volume, firewall drops, decision latency, and a "Needs attention" queue covering incidents, heartbeat gaps, pending configuration deliveries, and expiring certificates. A time-series chart breaks requests down into Allow, Block, and "Log, monitor, challenge", next to top attacker IPs, matched attack categories, source countries, and live host infrastructure.
- Recorded requests
- WAF decisions recorded in the selected window (5 minutes to 30 days), with a per-bucket activity chart.
- Blocked decisions
- Requests the WAF agent blocked. Drill into full forensic detail from the WAF event log.
- Firewall drops
- Drop events the eBPF firewall on your hosts stored in the selected window.
- Average decision latency
- Mean inline inspection time per recorded decision.
The project sidebar follows the same order as this tour: Overview, Applications, WAF agents, Custom rules, Hosts (with Firewall and Runtime security), Project settings, Credentials, Members, and Audit log. System administrators also reach Administration: users, invitations, security data, email (SMTP), data retention and the global audit log.
Applications
Applications lists every application of the project: its mode (Block or Monitor), the WAF agent that serves it and its route. New application creates one with its listen port and upstream URL; choose a WAF agent to deploy it right away, or save it unassigned. Each application has its own page with Monitoring, Decisions (live), Config (its WAF policy, or inherit the project's), Block window, Maintenance (see Maintenance mode), Routing and Assignment tabs.
WAF agents
The WAF agents page lists every registered agent for this project in an inventory table: online status, protected application count, and last-seen time. Agents register themselves on first connect, or you can register one by name. An agent's page shows its applications, inspection health, SIEM delivery and security data status; the configuration bundle streams to the agent over mTLS gRPC within seconds. No config files on the agent host.
Custom rules
Custom rules adds rules to one application, on top of the detection engines: condition rules, script rules and tuning rules. Condition rules match request fields and allow, block, log or challenge; only allow and block end inspection, log and challenge record the match and let the pipeline continue. Script rules run in a sandbox with fixed time and memory limits, and only project owners can save or edit them.
Hosts
The Hosts page is the project's host fleet: one table with each host's status, what protects it (firewall, runtime security), open incidents and agent versions, with filters and labels. Select hosts to edit labels, add or remove a firewall rule, or copy runtime policies and detection rules in one step. Register host shows the host's one-time key inside the Connect this host guide; rotating the key, revoking and deleting live on the host's own page.
Firewall
The Firewall page manages the eBPF kernel firewall on each host. Configure inbound/outbound rules, IP allow- and blocklists, country blocking (or allow-only countries), and SYN flood protection, first in monitor-only mode, then enforced. Rules are applied instantly via BPF maps, no iptables, no service restart.
Runtime security
Runtime security uses eBPF tracepoints to monitor process execution, file access, network connections, and privilege escalation, at the kernel level, with zero application instrumentation. Events are categorized by severity (INFO, LOW, MEDIUM, HIGH, CRITICAL) and grouped into an incident queue mapped to MITRE ATT&CK techniques.
The host agent traces only with the --trace flag (the kernel firewall flag --ebpf is on by default, tracing is not). The unit the installer puts in place passes --trace=true, so an installed host agent traces. On hardened kernels where kernel.perf_event_paranoid is 4 or higher, lower it (sudo sysctl -w kernel.perf_event_paranoid=1) or some tracepoints will be skipped at attach time. Runtime security shows Probes loaded N of M for each host agent.
Project settings
Project settings holds the project details and, in the Default WAF policy tab, the policy every application inherits: detection (each engine on or off, block or log only, and its sensitivity), access control, rate limits, bot protection, IP reputation, bot challenge, uploads and body size, SSRF destinations, rule paths, custom responses and SIEM delivery. WebSocket settings are set per application, in the Config tab of its page.
Credentials
Credentials issues project-wide mTLS client certificates for manual agent installs. The private key is shown once at issue time: download and store it securely. It is never stored on the control plane. Agents installed with the one-command install from Hosts do not need one: they enroll a certificate of their own.
Members
Members invites people to the project and sets their role: viewer (read only), member (configuration and agent changes) or owner (also members, invitations, and deleting projects, applications and hosts). Only owners manage members.
Audit log
The Audit log records every action taken by project members: configuration changes, credential provisioning, agent registration, and WAF rule changes. Use it for compliance, incident investigation, and change tracking. Sign-ins are not in it: system administrators find them in Administration › Global audit log.
- Where you go next
WAF agent setup
The WAF agent is a lightweight HTTP reverse-proxy sidecar. Deploy it in front of any HTTP/HTTPS application, or turn on Gateway to let it serve HTTPS itself. It intercepts every request, runs it through the detection pipeline, and either forwards, logs, or blocks it. The agent is two files: the open agent /usr/local/bin/wafio-waf-agent and the engine library /usr/lib/wafio/libwafio_semantic_engine.so. It needs glibc 2.28 or later. The installer sets WAFIO_ENGINE_LIB_REQUIRED=1, so the agent does not start without the library. Without that setting it starts and forwards traffic with no semantic detection.
Detection pipeline
- Client sends request to WAF agent (e.g. :8080)
- Body size and request checks, per-path limits, L7 flood, block policy, geo and bot protection (user agent, JA4 and JA3), custom rules, then per-path IP rules and login protection
- 20 semantic analyzers (SQL, XSS, CMD, PHP, Python, LFI, SSRF, Java, LDAP, NoSQL, Prototype Pollution, SSTI, XXE, Deserialization, Open Redirect, Header Injection, Prompt Injection, Anomaly, GraphQL, JWT)
- The agent turns the findings of the engines into ALLOW / LOG / BLOCK
- Request forwarded to upstream (ALLOW/LOG) or rejected 403 (BLOCK)
- Request that passes
- Request blocked
Install
Use the one-command install from Hosts › Connect this host with the waf-agent component (see Host agent setup), or sudo bash wafio-install.sh waf-agent --bundle credential.tar with a credential from the Credentials page. The installer writes /etc/wafio/waf-agent.env, the certificates under /etc/wafio/certs/, and the systemd unit. Listen ports and upstreams are not set on the agent: they come from the applications you assign to it in the dashboard.
Systemd service
The installer installs this unit from the WAF agent bundle (systemd/wafio-waf-agent.service); for a manual install, copy it from there. The agent runs as the system user wafio, which must exist and be able to read the certificates and the security data. Security data outside /etc/wafio/security-data needs a drop-in with ReadWritePaths= (systemctl edit wafio-waf-agent). Comments of the shipped file are left out here:
[Unit]
Description=WAFio WAF Agent
After=network.target
[Service]
Type=notify
NotifyAccess=all
User=wafio
Group=wafio
Environment=MIMALLOC_PURGE_DELAY=10
EnvironmentFile=/etc/wafio/waf-agent.env
ExecStart=/usr/local/bin/wafio-waf-agent
ExecReload=/bin/kill -SIGUSR2 $MAINPID
ExecStop=/bin/sh -c 'p="$1 $(cat /proc/$1/task/*/children 2>/dev/null)"; kill -TERM $p 2>/dev/null; for i in $p; do while kill -0 $i 2>/dev/null; do sleep 0.2; done; done' sh $MAINPID
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=wafio-waf-agent
LimitNOFILE=65536
StateDirectory=wafio-waf-agent
StateDirectoryMode=0700
NoNewPrivileges=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictSUIDSGID=yes
RestrictRealtime=yes
RestrictNamespaces=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources @obsolete
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
ReadWritePaths=-/etc/wafio/security-data
[Install]
WantedBy=multi-user.target # /etc/wafio/waf-agent.env
WAFIO_GRPC_SERVER=10.1.1.2:9090
WAFIO_GRPC_CA_CERT=/etc/wafio/certs/waf/ca.crt
WAFIO_GRPC_CLIENT_CERT=/etc/wafio/certs/waf/client.crt
WAFIO_GRPC_CLIENT_KEY=/etc/wafio/certs/waf/client.key
WAFIO_AGENT_NAME=waf-prod-01
WAFIO_ENGINE_LIB_REQUIRED=1
WAFIO_SECURITY_DATA_DIR=/opt/wafio/security-data
WAFIO_GEO_COUNTRY_DB_PATH=/opt/wafio/security-data/geoip/country.mmdb
WAFIO_GEO_CITY_DB_PATH=/opt/wafio/security-data/geoip/city.mmdb
WAFIO_GEO_ASN_DB_PATH=/opt/wafio/security-data/geoip/asn.mmdb
WAFIO_UA_BAD_BOT_FILE=/opt/wafio/security-data/user-agents/bot.txt
WAFIO_JA4_BLACKLIST_FILE=/opt/wafio/security-data/ja4/ja4.txt
WAFIO_JA4_ALLOWLIST_FILE=/opt/wafio/security-data/ja4/ja4_allowlist.txt systemctl daemon-reload
systemctl enable --now wafio-waf-agent
systemctl status wafio-waf-agent Zero-downtime reload
systemctl reload wafio-waf-agent sends SIGUSR2: a new process takes over the listening sockets and the old one drains. The unit is Type=notify with NotifyAccess=all. The agent sends READY=1 after its first bundle is applied, either live from the control plane or from the cached last-bundle.json when the control plane is unreachable at start, or after 20 seconds when no bundle has arrived.
Key environment variables
| Variable | Required | Description |
|---|---|---|
WAFIO_GRPC_SERVER | Yes | Control plane gRPC address (e.g. 10.1.1.2:9090) |
WAFIO_GRPC_CA_CERT | Yes | Path to the agent CA certificate |
WAFIO_GRPC_CLIENT_CERT | Yes | Path to agent client certificate |
WAFIO_GRPC_CLIENT_KEY | Yes | Path to agent private key |
WAFIO_AGENT_NAME | Yes | Agent name shown in the dashboard. An enrolled certificate accepts only the name it was enrolled with |
WAFIO_GEO_COUNTRY_DB_PATH | Yes | GeoIP country database, e.g. /opt/wafio/security-data/geoip/country.mmdb. The file must exist and not be empty, or the agent does not start |
WAFIO_GEO_CITY_DB_PATH | Yes | GeoIP city database, e.g. /opt/wafio/security-data/geoip/city.mmdb |
WAFIO_GEO_ASN_DB_PATH | Yes | GeoIP ASN database, e.g. /opt/wafio/security-data/geoip/asn.mmdb |
WAFIO_UA_BAD_BOT_FILE | Yes | Bad-bot user-agent list, e.g. /opt/wafio/security-data/user-agents/bot.txt |
WAFIO_JA4_BLACKLIST_FILE | Yes | JA4 fingerprint list, e.g. /opt/wafio/security-data/ja4/ja4.txt. When unset, the agent uses the first ja4.txt it finds under security-data/ja4/, /etc/wafio/security-data/ja4/ and /usr/local/share/wafio/ja4/; a JA3 list (WAFIO_JA3_BLACKLIST_FILE) also satisfies it |
WAFIO_GRPC_SERVER_NAME | No | Name in the control plane's gRPC certificate (server.grpc_domain), needed when WAFIO_GRPC_SERVER is an IP address or another name |
WAFIO_SECURITY_DATA_DIR | No | Security data directory (default /etc/wafio/security-data); the installer sets /opt/wafio/security-data |
WAFIO_ENGINE_LIB_REQUIRED | No | 1 makes a missing or unusable engine library fatal at start. The installer sets it. Without it the agent starts and forwards traffic with no semantic detection |
WAFIO_STATE_DIR | No | Directory of the bundle cache; defaults to systemd's StateDirectory |
WAFIO_BUNDLE_CACHE_MAX_AGE | No | Age after which a cached bundle is reported stale (default 168h); it is still served |
WAFIO_BODY_DECODE_BUDGET_BYTES | No | Memory budget for decoding compressed request bodies across the process (default 64 MiB, 0 = no limit) |
WAFIO_WAF_STORE_MAX_ENTRIES | No | Capacity of each L7 rate-limit and block store (default 100,000, minimum 1,000) |
WAFIO_METRICS_ADDR | No | Opt-in OpenMetrics endpoint GET /metrics on a loopback IP literal, e.g. 127.0.0.1:9100 |
Maintenance mode
Maintenance mode makes the WAF agent answer every request for one application with a 503 page while you work on the application or its upstream. The agent answers before any other step: no inspection, no contact with the upstream, and no decision is recorded. This holds for every method and in Monitor mode too. The switch is in the Maintenance tab of the application's page, and the control plane sends the change to the WAF agent that serves the application. Maintenance mode never ends by itself: turn it off when you are done. The expected end you can set is shown to visitors and sent as Retry-After, but it does not turn the switch off.
Who still gets through
A request that matches one of these settings runs the full normal pipeline, as if maintenance mode were off.
| Setting | Behavior |
|---|---|
| Allowed IP addresses | IPv4 or IPv6 addresses and CIDR ranges. A request is judged by its client IP after trusted-proxy handling, the same address the rest of the agent uses. |
| Allowed paths | A path that starts with /. It is compared with the decoded path with its dot segments resolved, which is the path your upstream receives. A request matches when its path equals an entry or lies below it (/healthz covers /healthz/x, not /healthzx), or starts with an entry that ends in /. The match is case-sensitive. A path that holds ; must also match once the path parameters are removed from it and from the entries, because servlet containers route /healthz/..;/admin to /admin. / alone is refused: it would let every request through. |
What visitors get
The format follows the Accept header: text/html gets HTML, else a header that contains json gets JSON, else one that contains xml gets XML, else HTML. Only the HTML page can be replaced, with Custom HTML. In a custom page, {{WAFIO_MESSAGE}} is your message, or a default text, escaped for the format, and {{WAFIO_END_TIME}} is the expected end as YYYY-MM-DDTHH:MM:SSZ while it lies ahead, else empty. An end time in the past counts as none. The JSON answer has the keys status, maintenance, message and expected_end. A HEAD request gets the headers only.
| Header | Value |
|---|---|
Cache-Control | no-store |
X-Content-Type-Options | nosniff |
Retry-After | The seconds until the expected end, only while it lies ahead |
Vary | Origin |
Decided from the request head
The agent decides from the request line and the headers. It does not read the request body into memory and does not forward it. An upload over the body limit gets the 503, not a 413, and a request with Expect: 100-continue gets the final 503 without a 100 Continue first.
- No body, or
Content-Length: 0: the connection stays open and the next request on it is answered. - A body (
Content-Lengthabove 0, a chunked body, orExpect: 100-continue): the 503 carriesConnection: close. The agent then closes the connection after it has discarded up to 256 KiB or one second of what the client still sends, so the client can read the answer. It stores none of it. Requests pipelined behind such a request are not answered; a client can send them again on a new connection.
The agent does not read an upload to the end just to keep the connection open: that buys nothing during maintenance. A request that gets through is read and inspected as usual.
Connections that are already open
When maintenance mode turns on, or when the allowed lists change, the agent applies it to connections that are already open, for every client that is not allowed. A connection counts as allowed by the client IP and the path it was opened with. Other applications on the same agent are not affected. Turning maintenance mode off changes no connection.
| Connection | What happens |
|---|---|
| WebSocket handshake | Refused with the 503. Nothing is upgraded. |
| Open WebSocket session | Closed within about 2 seconds after the agent applies the change. The agent sends a close frame with code 1001 and reason Maintenance to the client and to the upstream at once, then closes both connections. It does not wait for their replies. A session of an allowed IP address or on an allowed path keeps running; if you later remove that address or path from the lists, the session is closed. |
Event stream (Content-Type: text/event-stream) | Ends for a client that is not allowed: the agent sends the final chunk when the response is chunked, closes the connection and drops the connection to the upstream. The event stream of an allowed client continues. |
| Other streamed responses (downloads, exports, streamed API answers) | Finish. |
An event stream has no end, and it would keep your backend busy for the whole maintenance window. A download is a request that started before maintenance: cutting it leaves the visitor a broken file, and the upstream timeout already ends one that stalls.
When the agent reloads (see Zero-downtime reload), the old process closes every WebSocket session it still holds with code 1001 and reason Going away. Clients reconnect to the new process, which has the current configuration and answers the handshake with the 503 while maintenance mode is on.
Browser applications on other sites
A browser application on another origin can read the maintenance answer, so a single-page app can show your message instead of a network error. Only the maintenance answer gets these headers. A request that bypasses maintenance mode, and an application that is not in maintenance mode, are not touched.
| Request | Added to the answer |
|---|---|
No Origin header, or one that is not valid | Vary: Origin |
A valid Origin: null, or scheme://host[:port] in printable ASCII, without a comma, at most 256 bytes | Vary: Origin, Access-Control-Allow-Origin with that origin, Access-Control-Allow-Credentials: true and Access-Control-Expose-Headers: Retry-After |
A preflight: OPTIONS with a valid Origin and an Access-Control-Request-Method that is a token of at most 32 bytes | Status 204 with no body, Access-Control-Allow-Origin with that origin, Access-Control-Allow-Methods with the requested method, Access-Control-Allow-Headers with the requested list (only when it holds tokens and commas and is at most 1024 bytes), Access-Control-Max-Age: 0, Cache-Control: no-store, X-Content-Type-Options: nosniff and Vary: Origin, Access-Control-Request-Method, Access-Control-Request-Headers. No Access-Control-Allow-Credentials. |
Why this is safe: the body is public text, your message and the expected end. The 503 sets no cookie and holds no data of your upstream, so letting a page on another site read it, with cookies, leaks nothing. Browsers already send simple cross-origin requests; the headers only let the page read the answer.
A request that sends cookies and needs a preflight, for example a JSON POST with credentials, still fails in the browser during maintenance mode. The agent cannot tell that a preflight and the request after it belong together. If the preflight allowed credentials and maintenance mode ended in between, a page on another site could get a credentialed request that needs a preflight through to your application. For the same reason Access-Control-Max-Age is 0, which keeps the approval out of the browser's preflight cache, and the agent sends no Access-Control-Allow-Private-Network header.
Limits
| Setting | Limit |
|---|---|
| Message | At most 500 characters, plain text. Empty uses "We are carrying out planned maintenance. Please check back soon." |
| Custom HTML | At most 64 KiB (65,536 bytes). |
| Allowed IP addresses | At most 50 entries. |
| Allowed paths | At most 20 entries of at most 256 bytes each. The unit is bytes, not characters: a character outside ASCII takes 2 to 4 bytes. |
| Expected end | In the future when you set or change it or turn maintenance mode on, and within 365 days. |
| Configuration of one WAF agent | A WAF agent accepts a configuration of at most 4 MiB in one message, so the control plane keeps the whole configuration it sends to one agent at or below 4,193,280 bytes. The custom pages of all applications in maintenance mode on that agent count toward it, and <, > and & count as 6 bytes each there. Turning maintenance mode on, saving its settings, moving an application in maintenance mode to another agent, or giving such an application its listen port and upstream for the first time is refused with 409 and the code MAINTENANCE_BUNDLE_TOO_LARGE when it would pass that size, and the error shows the size it would reach. Turning maintenance mode off is never refused. |
Agent support
- Maintenance mode needs a WAF agent that reports the
maintenance_modefeature. The control plane refuses to turn it on when the agent that serves the application has connected without reporting that feature (409, codeMAINTENANCE_UNSUPPORTED). - While maintenance mode is on, the application can only move to a WAF agent that reports the feature; otherwise the control plane refuses the move with the same code. A move onto an agent whose configuration would pass the limit above is refused with
MAINTENANCE_BUNDLE_TOO_LARGE. - An agent that supports maintenance mode but is older than the release that added the behavior on this page keeps sending the 503, but it reads the request body first, sends no CORS headers and leaves open WebSocket sessions running. Upgrade it to get everything described here.
Gateway
Gateway lets the WAF agent serve an application over HTTPS itself, with no web server in front of it. It is set for each application on the Gateway tab, between Maintenance and Speed, behind a switch that is off by default. With the switch off, requests reach the agent on the Routing listen address and a web server or CDN in front of it handles HTTPS, as before. Gateway and Speed need WAFio v2.2.1 or later.
- Request that passes
- Request blocked
What the listener does
| Setting | Behavior |
|---|---|
| Protocols | TLS 1.2 and 1.3. HTTP/1.1 only: there is no HTTP/2 on the listener yet. |
| Choosing the application | The SNI name picks the application and its certificate, so several applications can share one HTTPS address. A request whose Host header differs from the SNI name gets 421 and the connection closes. A client that sends no name, or a name no application has, gets no handshake. |
| Host names | 1 to 100 plain DNS names for an application: no wildcard, IP address or port. A name belongs to one application on a listener. |
| HTTPS address | 0.0.0.0:443 by default. An application in Gateway opens no plain listener of its own, and the application behind it is told X-Forwarded-Proto: https. |
| Redirect HTTP to HTTPS | An optional HTTP address. It answers every method with 308 to the same path and query on HTTPS, for the host names of the application, and 404 for any other host. |
| Main host name | A visitor who comes in under another host name of the application gets 308 to https://<main host> with the same path and query, and the HTTP address sends every visitor there in one hop. A blocked request is never redirected, and neither is a request that asks for an upgrade. Browsers keep a 308, so a main host name that you change later may keep sending returning visitors to the old name for a while. |
Turning it on
Switching to Gateway opens a dialog that lists the checks (source, host names, agent, certificate, host credential, trusted proxies) and what visitors get meanwhile. If another program holds the HTTPS address, a web server on port 443 for example, the agent cannot bind it, tries again every minute and reports cannot listen on <address>: address in use. Move the web server off the port before you turn Gateway on.
Uploaded certificates
Upload the chain and the unencrypted private key in PEM on the Gateway tab. The chain can hold up to 10 certificates. The key is RSA of 2048 to 4096 bits, ECDSA P-256 or ECDSA P-384. The control plane checks that the key belongs to the leaf certificate, that the certificate has not expired and that it covers every host name. A chain that does not lead to a root that browsers trust is accepted with a warning, which fits a private CA.
The control plane keeps the key sealed with AES-GCM under totp.enc_key, in a table of its own, and sends it only to the agent that serves the application. That agent needs a credential bound to its host, enrolled with a host key; otherwise the API answers 409 AGENT_NOT_HOST_BOUND. The agent keeps the files in /var/lib/wafio-waf-agent/tls/ with mode 0600, serves a new certificate from the next handshake and keeps open connections. The host keeps a copy of the key. When you delete an agent, or revoke or delete a host that served an uploaded certificate, upload a new certificate with a new key.
Let’s Encrypt
The agent orders one certificate for all host names of the application. The dashboard asks you to confirm the Let’s Encrypt terms. The directory is the one of Let’s Encrypt by default; --acme-directory or WAFIO_ACME_DIRECTORY in /etc/wafio/waf-agent.env names another one (https only).
| Topic | Behavior |
|---|---|
| Challenges | TLS-ALPN-01 on the HTTPS listener (port 443), and HTTP-01 on the HTTP address (port 80) and on the HTTPS listener. After a failed order the agent tries the other challenge. HTTP-01 on port 80 needs the HTTP address, so turn on Redirect HTTP to HTTPS. |
| Ports | Ports 80 and 443 must be open to everyone, because the authority checks from several networks. A host firewall or an XDP allowlist that lets only some addresses through makes the order fail. |
| Before the first certificate | The agent serves a self-signed placeholder: visitors get a browser warning and a 503 page, and the HTTP address answers 503 with Retry-After: 60 instead of the 308. |
| Renewal | It starts when a third of the lifetime is left (30 days before the end of a 90-day certificate), when a host name is not covered, or when you press the request button. The button is disabled for five minutes after the last request, or for as long as a refusal asked. |
| After a failure | The agent keeps serving the current certificate. A failed order is tried again after 10 minutes, then 1 hour, 4 hours, 12 hours and a day. A rate limit makes the agent wait for the time the authority names, up to 7 days. A restart or a reload does not order again at once: the agent keeps the state of its orders in state.json in the key directory. |
| Behind Cloudflare | SSL/TLS mode Full works with HTTP-01. It does not work with TLS-ALPN-01, which Cloudflare does not pass, so the first request usually fails and the retry over HTTP-01 succeeds. A mode that connects to your server over plain HTTP loops. |
Certificate card and expiry alerts
The certificate card shows the source, the names, the issuer, the dates and the key type. For an ordered certificate it also shows the state the agent reports: pending, active or failed, with the reason and the time of the next try. Expiry shows as an alert on the card and as a badge in the header of the application page while the application is in Gateway.
While the control plane has a mail server configured, the owners and members of the project (not viewers) get one mail for each level of each certificate, with a link to the Gateway tab. The levels are 30, 14, 3 and 1 days left for an uploaded certificate, and 14, 3 and 1 for Let’s Encrypt, where a mail means the renewal is late. The control plane checks every 6 hours.
Not supported
- HTTP/2 on the listener. Visitors get HTTP/1.1.
- The DNS-01 challenge. Let’s Encrypt orders use TLS-ALPN-01 and HTTP-01.
- Wildcard host names, IP addresses and ports as host names.
Speed
The Speed tab of the application page has three parts: compression, files from a folder and the response cache. Each part has its own switch and Save button, and each is off by default. For each part the tab shows a line that says whether the agent runs it (waiting, in use, refused with the reason, too old or offline), and counters in words. Every setting is checked on every save, and a save writes an audit entry. The agent applies the settings itself and may refuse them; a refusal keeps the settings it already runs. The WAF checks every request before any of the three parts act, so a blocked request never gets a compressed copy, a file or a cached answer.
- Request that passes
- Request blocked
Compression
The agent compresses with gzip or brotli, whichever the visitor’s Accept-Encoding prefers; a tie goes to brotli. It applies to text, JSON, JavaScript, XML, WebAssembly, SVG and some fonts, when the answer is at least min_bytes (1 KiB by default) and at most 8 MiB. Streamed answers, HEAD, 206 and 304 answers, and answers that carry a Content-Encoding or Cache-Control: no-transform are left alone. A compressed answer gets a weak ETag and Vary: Accept-Encoding. For a signed-in request, HTML and JSON are not compressed (the BREACH attack). A request is signed in as described under the cache below.
Files from a folder
The agent answers GET and HEAD for the files of one folder after the WAF verdict, without asking the application. A request whose file is not in the folder goes to the application, or gets 404 when you choose “the folder is the whole site”. The agent sends the type, ETag, Last-Modified, Accept-Ranges, range and conditional requests, and a browser cache time you set.
| Case | Behavior |
|---|---|
| Never served | Folder listings, names that start with a dot (except .well-known), PHP files, symbolic links, and a path with a part named like a system file or folder, such as profile, network or shadow. |
| Folders that are refused | /, and any folder in or above /etc, /root, /proc, /sys, /dev, /run, /boot, /usr, /var/lib/wafio-waf-agent and /var/cache/wafio-waf. |
| When the folder is checked | When the agent applies the settings, and again on every request, so a current link that moves somewhere forbidden serves nothing. A refusal carries a code (root_missing, root_not_directory, root_unreadable, root_forbidden or invalid) and the application keeps the folder it had. |
Response cache
The agent keeps answers of the application and sends them again without asking it. The cache is off by default. With it on, the defaults are: images, fonts, media, styles and scripts that carry no lifetime are kept for 1 hour; stored copies are sent for 10 minutes while the application is down; 1 GiB of disk, 32 MiB of memory and objects of up to 8 MiB.
| Topic | Behavior |
|---|---|
| Where copies live | In /var/cache/wafio-waf. Copies up to 256 KiB also go to memory from their second hit. Both tiers evict the least used copies first. The agent refuses settings whose disk total passes the free space minus 5 percent of the file system (disk_too_small) or whose memory total passes a quarter of the host memory (memory_too_small). With under 5 percent of the file system free it stores nothing and removes the least used copies. |
| What is looked up | Only a GET or HEAD that the WAF verdict allows. |
| What is stored | The answer to a GET without Range, when it has a status of 200, 203, 300, 301, 308, 404 or 410 and a lifetime (s-maxage, max-age, Expires, a path rule, or the default for a file type). |
| Never stored | Answers with Set-Cookie, private, no-store or no-cache, a Vary of *, Cookie or Authorization, and objects over the size limit. A path that contains ; is never cached. |
| X-Cache header | Every answer of a path that the cache looks up carries X-Cache: HIT, STALE, MISS or BYPASS. |
| Signed-in visitors | They skip the cache. A request is signed in when it has an Authorization header, user information in the address, or a session cookie: a cookie whose name holds sess, starts with wordpress_logged_in_, wp-postpass_, remember_web_, remember-me or .AspNetCore., or is JSESSIONID or connect.sid, or is one of up to 20 names you list. An application with another session cookie name must list it. Only a path rule with “Also for signed-in visitors” reads and fills copies for them, and it shares them between all visitors of that path, so use it only for a path that shows one page to everyone. |
| Other cookies | A request with another cookie, an analytics cookie for example, is still answered from a stored copy. The answer to it is stored only when it says public or has s-maxage, or is a file type while the default lifetime is on. |
| Path rules | Up to 50 rules; the longest matching prefix decides. A rule keeps answers for a time you set, or bypasses the cache for that path. |
| Stale copies and changes | A copy past its life is sent as STALE within stale-while-revalidate and while the application is down, or confirmed with the application through ETag or Last-Modified. A POST, PUT, PATCH or DELETE with a 2xx or 3xx answer ends the copies of the same URL. 100 requests for a page that has no copy make one request to the application: the others wait up to 5 seconds for it. |
| Remove stored copies | Under the cache settings, for one address, for every path that starts with a prefix, or for the whole application. An agent that is offline gets the request when it connects again. |
Limits of the cache
- With the cache on, a request whose answer is stored costs about 2.4 to 3 times the agent CPU of plain forwarding. This is the worst case, where every request is for a new URL.
- With the cache on, pages that set a cookie pass about 2 percent slower than with the cache off.
- Both apply only to an application that turns the cache on.
- A
GETwhose answer was fetched before aPOSTto the same URL can still be stored after thePOSTended the copies of that URL. Remove the address under Speed, Remove stored copies, if that matters.
Host agent setup
The host agent runs on Linux and provides two capabilities: a kernel-level eBPF firewall (XDP/TC) and runtime security tracing (syscall/tracepoint hooks). It requires root privileges and Linux kernel 5.10+ with BTF enabled.
- Linux kernel 5.10+ with BTF (
CONFIG_DEBUG_INFO_BTF=y); kernels 5.8 and 5.9 are not supported - Root privileges (systemd service runs as root)
- Verify BTF:
ls /sys/kernel/btf/vmlinux: file must exist - eBPF objects are CO-RE (Compile Once, Run Everywhere), no kernel headers needed at deploy time
- Linux amd64 (x86_64) only: host agent does not run on macOS or ARM
- Rule update
- Allowed packet
- Dropped packet
Register a host
- Go to Hosts in your project sidebar
- Click Register host and enter a name
- The Connect this host guide shows the host key once, together with a ready-made install command
- Run that command on the server as root:
curl -fsSL https://wafio.cloud/install.sh -o wafio-install.sh && printf '%s\n' '<host key>' | sudo bash wafio-install.sh host-agent --host-key-stdin \
--url 'https://<dashboard>' \
--ca-sha256 '<CA SHA-256>'
# WAF agent on the same host (optional name, default <hostname>@waf)
curl -fsSL https://wafio.cloud/install.sh -o wafio-install.sh && printf '%s\n' '<host key>' | sudo bash wafio-install.sh waf-agent --host-key-stdin \
--url 'https://<dashboard>' \
--ca-sha256 '<CA SHA-256>' \
--agent-name 'web-01@waf' The installer generates the agent's private key on the server and sends only a certificate signing request, authenticated by the host key, to POST /api/internal/host-enroll. It writes nothing unless the control plane's agent CA matches --ca-sha256. --url must be https:// (http:// only for loopback). The key is piped on stdin so it never shows in ps or sudo's log; without --host-key-stdin the installer asks for it without echo.
A host key enrolls only within 24 hours of the host being created or its key being rotated, each agent once per key. A host holds at most 4 enrolled credentials. To add an agent later or renew a certificate, rotate the key on the host's page and run the new command. Revoking or deleting a host also revokes its enrolled credentials and disconnects its agents.
Manual alternative: issue a project credential on the Credentials page and run sudo bash wafio-install.sh host-agent --bundle credential.tar; the installer then asks for the host key and stores it as WAFIO_HOST_KEY in /etc/wafio/host-agent.env.
Systemd service
The installer installs this unit from the host agent bundle. It reads the interface, the BPF object paths and the GeoIP database path from <code>/etc/wafio/host-agent.env</code>, where the installer fills them in for your server. Comments of the shipped file are left out here:
[Unit]
Description=WAFio Host Agent (eBPF Firewall + Runtime Security)
After=network.target
[Service]
Type=simple
User=root
SupplementaryGroups=wafio
EnvironmentFile=-/etc/wafio/host-agent.env
ExecStart=/usr/local/bin/wafio-host-agent \
--interface ${WAFIO_INTERFACE} \
--ebpf=true \
--xdp-obj ${WAFIO_EBPF_XDP_OBJ} \
--tc-obj ${WAFIO_EBPF_TC_OBJ} \
--geoip-db ${WAFIO_GEOIP_DB} \
--trace=true \
--trace-obj ${WAFIO_TRACE_OBJ}
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=wafio-host-agent
LimitMEMLOCK=infinity
AmbientCapabilities=CAP_BPF CAP_NET_ADMIN CAP_SYS_ADMIN CAP_PERFMON CAP_KILL CAP_SYS_RESOURCE CAP_SYS_PTRACE
CapabilityBoundingSet=CAP_BPF CAP_NET_ADMIN CAP_SYS_ADMIN CAP_PERFMON CAP_KILL CAP_SYS_RESOURCE CAP_SYS_PTRACE
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
BindReadOnlyPaths=-/etc/wafio/certs/host/client.crt -/etc/wafio/certs/host/client.key -/etc/wafio/certs/host/ca.crt
RestrictSUIDSGID=yes
LockPersonality=yes
RuntimeDirectory=wafio
RuntimeDirectoryMode=0755
RuntimeDirectoryPreserve=yes
StateDirectory=wafio-host-agent
StateDirectoryMode=0700
LogsDirectory=wafio
ReadWritePaths=/sys/fs/bpf -/etc/wafio/ebpf
[Install]
WantedBy=multi-user.target # /etc/wafio/host-agent.env
WAFIO_GRPC_SERVER=cp.example.com:9090
WAFIO_GRPC_CA_CERT=/etc/wafio/certs/host/ca.crt
WAFIO_GRPC_CLIENT_CERT=/etc/wafio/certs/host/client.crt
WAFIO_GRPC_CLIENT_KEY=/etc/wafio/certs/host/client.key
WAFIO_AGENT_NAME=web-01@ebpf
WAFIO_INTERFACE=eth0
WAFIO_EBPF_XDP_OBJ=/opt/wafio/ebpf/wafio_xdp.o
WAFIO_EBPF_TC_OBJ=/opt/wafio/ebpf/wafio_tc.o
WAFIO_TRACE_OBJ=/opt/wafio/ebpf/wafio_trace.o
WAFIO_GEOIP_DB=/opt/wafio/security-data/geoip/country.mmdb
WAFIO_LOCAL_API_TOKEN_GROUP=wafio What the host agent monitors
- Process execution
- Every
execvewith full command line, parent/grandparent, UID, cgroup, and container context. - File access
- Opens to sensitive paths (
/etc/passwd,/proc/, web shells) with read/write flags. - Network connections
- Outbound TCP connections: detect C2 callbacks, reverse shells, and data exfiltration.
- Privilege escalation
- setuid and setgid calls,
prctl, ptrace, mounts, kernel module loads and BPF program loads, seen at syscall level.
Container enrichment
The host agent follows container start and stop events on a Docker API socket (Docker, Podman or rootless Docker; <code>WAFIO_CONTAINER_SOCKET</code> picks one) and refreshes the full list every 30 seconds. It maps cgroup IDs to container metadata (image, name, labels, Kubernetes pod/namespace). All trace events from containers are tagged with this context. Without a socket the host agent runs without this context.
Credentials (mTLS)
Every agent authenticates to the control plane using a mutual TLS client certificate signed by the control plane's own internal agent CA, no public CA involved. The certificate's fingerprint maps the agent to its project.
- Credential and policy out
- Events back
Two kinds of credentials
| Credential | How it is made | Bound to |
|---|---|---|
| Enrolled (recommended) | One-command install from Hosts › Connect this host: the private key is generated on the host, the control plane signs its CSR (valid 365 days). Only the certificate and its fingerprint are stored. | One host, agent kind (host or WAF) and agent name |
| Project-wide | Issued on the Credentials page; the private key is generated by the control plane and shown once. | The project: the agent may connect under any name |
Issuing a project credential
- Navigate to Credentials in your project
- Enter a descriptive name (e.g.
waf-prod-edgeorhost-vpn-server) - Set the validity in days (default: 365)
- Choose the Agent type (WAF agent or Host agent); it selects the systemd unit in the bundle
- Click Issue credential
- The panel shows the credential once: click Download bundle (.tar) before you leave the page, then pass the file to the installer with
--bundle
Credential bundle contents (wafio-<name>-bundle.tar)
| File | Description |
|---|---|
ca.crt | Agent CA certificate: used by the agent to verify the control plane's identity |
client.crt | Agent's client certificate: presented to the control plane during TLS handshake |
client.key | Agent's private key: shown once, never stored on the server |
wafio-<name>.service | Sample systemd unit for a manual install without the installer |
The private key (client.key) is never stored on the control plane. If you lose it, revoke the credential and provision a new one. Revocation takes effect within seconds: the agent will disconnect immediately.
Revoking a credential
Click Revoke next to any issued credential. The agent loses its connection within seconds. Revocation is immediate and permanent: issue a new credential to reconnect. Enrolled credentials are revoked with their host: revoking or deleting a host deletes them and closes their agents' connections.
Firewall
The WAFio firewall operates at the kernel level using eBPF XDP and TC hooks. Inbound packets are checked at XDP, before the kernel's network stack; outbound packets at TC egress.
- Allowed packet
- Dropped packet
- Rule update
Firewall rule types
| Rule type | Description |
|---|---|
| Blocklist | Drop all inbound traffic from specific IPv4/IPv6 addresses, CIDR prefixes or ranges |
| Allowlist | Always pass traffic from trusted sources, ahead of blocks. An entry can be limited to TCP/UDP ports (up to 8 port scopes; needs an agent that reports the allowlist_ports feature) |
| Egress blocklist | Drop outbound packets to specific addresses at TC egress (exfiltration, C2 callbacks) |
| Geo-blocking | GeoIP-based: block mode drops traffic from listed countries; allow mode drops every public source outside the listed countries (needs conntrack and an explicit confirmation) |
| Port rules | Allow, drop or log packets by port, protocol and direction. Deny all for inbound or outbound traffic is the default you set under Firewall › Settings |
| SYN flood protection | A switch under Firewall › Settings: detect and mitigate SYN floods |
| Port scan detection | A switch under Firewall › Settings: count unique destination ports per source; with Drop on detect, drop packets from scanning sources |
Rule application
Rules are pushed to the agent as BPF map updates: they take effect instantly with no traffic interruption. No agent restart needed. Changes reflect in the dashboard within 1–2 seconds. The agent keeps the last good state on disk and re-applies it after a restart.
Lockout protection
Before a rule set is applied, the control plane and the agent check that it cannot lock you out: inbound Deny All needs connection tracking and a permanent TCP allow on a reported SSH port (22 when none is reported); egress Deny All needs connection tracking; a wildcard or family-wide block needs connection tracking and a lockout-escape allowlist entry; geo allow mode needs connection tracking, at least one country and a confirmation. A refused rule set is shown on the host with its reason; nothing is applied.
Enforcement modes
| Mode | Behavior |
|---|---|
| Monitor | Monitor-only: matching packets are counted as would-drop, and logged when Log dropped packets is on (the default); every packet is forwarded |
| Enforce | Matching packets are dropped in the kernel |
Memory use
The firewall keeps its state in BPF maps that the kernel allocates when the host agent starts, whatever the traffic. The agent sizes these maps from the memory of the host, so a small server does not pay for the capacity of a large one. A host with 8 GB or more gets the full sizes.
| Host memory | Kernel memory for the sized maps (estimate) |
|---|---|
| 1 GB | 28 MB |
| 2 GB | 45 MB |
| 4 GB | 90 MB |
| 8 GB and more | 180 MB |
To set the scale yourself, put WAFIO_EBPF_MAP_SCALE in /etc/wafio/host-agent.env and restart the host agent. auto is the default. A number above 0 and at most 1 replaces the computed scale: 1 gives the full sizes on any host. The agent logs the sizes in use at every start.
A full map does not drop legitimate traffic. The connection table evicts the flows used least recently, and a reply to a connection the host opened still passes. A full per-source table (SYN flood, rate limit, port scan) skips the check for a new source and counts it; sources already tracked stay tracked. The dashboard shows the scale, the size of each map and whether a map was full: Firewall › Overview for the firewall maps, Runtime security › Agent for the trace maps.
Runtime security
Runtime security uses eBPF tracepoints to hook into kernel syscalls, detecting suspicious behavior at the source rather than relying on log-based detection after the fact.
- Event that raises an alert
- Process stopped
Detection rules
WAFio adds a set of built-in detection rules to each host when the host is registered. Built-in rules cannot be deleted (only disabled). Custom rules can be added, updated, or deleted by project members (member role or higher). Each rule has ordered AND-ed conditions and an action:
| Action | Effect |
|---|---|
suppress | Drop the event: reduce noise from known-good processes |
escalate | Raise event severity: force attention to high-value events |
downgrade | Lower severity: tune noisy rules without disabling them |
tag | Add a label to the event: useful for SIEM correlation |
Condition fields
Rules can match on: comm, parent_comm, grandparent_comm, event_name, category, severity, filename, addr, port, uid, gid, addr_family, flags, detail, ret_val, is_container, exe_verified, container_image, container_name. ret_val is the syscall result: negative for a failed open, and 0 for an open without a recorded result.
Supported operators: eq, neq, in, not_in, contains, starts_with, starts_with_any, glob, gte, lte, and the bit tests bit_and / bit_none on flags and detail.
Process names (comm and its parents) are chosen by the process itself. exe_verified is true only for PID 1 and the agent-verified protected set: the agent itself, and processes such as sshd, systemd, containerd, dockerd and kubelet (plus names added with WAFIO_PROTECTED_PROCESSES) when they run the host binary. A rule that drops events should require it; built-in suppress rules that name a process do, as in the example below.
Example: suppress network events of the verified dockerd
conditions:
- field: comm
op: eq
value: dockerd
- field: category
op: eq
value: network
- field: exe_verified
op: eq
value: true
action: suppress Enforcement policies
Besides detection rules, runtime policies decide what happens when a traced event matches:
| Action | Behavior |
|---|---|
| Monitor | Record only |
| Alert | Record and raise an alert to the control plane |
| Simulate | Record as if enforced, without acting |
| Kill | SIGKILL the matching process through a verified pidfd; never protected system processes such as PID 1, sshd or systemd |
To block outbound traffic to an address, use the firewall egress blocklist (Firewall, Access rules, Egress blocklist); to stop a process, use Kill. A Kill policy that does not narrow its match (by process, path or destination) needs an explicit confirmation in the dashboard before it is enforced.
SIEM export
WAF BLOCK and LOG decisions can be sent as JSON to a webhook for your SIEM or log collector. Configure it in the WAF policy (Project settings › Default WAF policy › SIEM delivery, or per application); each WAF agent's page shows the delivery status.
Detection engine
WAFio analyzes each request with semantic engines, one per attack class. Each engine weighs the evidence it finds in the request: strong evidence blocks the request, weaker evidence is recorded and the request passes. Read the illustrated semantic scanning guide
Semantic engines (20 analyzers)
Twenty language-specific and structural analyzers use a mix of parsers, tokenization, heuristics and pattern checks. They inspect supported normalized input, with pre-filters and bounded engine concurrency. Not every engine uses an AST, and coverage depends on the input and enabled policies.
- Allowed request
- Blocked request
| Analyzer | Detects | Key techniques |
|---|---|---|
| SQL | SQL injection | Full SQL AST parsing, UNION, subqueries, boolean blinds, versioned comments (/*!50000*/) |
| XSS | Cross-site scripting | HTML/JS parser, event handler analysis, CRLF evasion, entity decode chains, protocol obfuscation |
| CMD | OS command injection | Shell metacharacter detection, $IFS expansion, ANSI-C octal escapes, backtick/process substitution |
| Prompt Injection | LLM / AI application jailbreaks (LOG tier; blocks in the address of a chat path) | System prompt overrides, roleplay escaping, delimiter/tag hijacking, markdown/exfil injections |
| Open Redirect | Unvalidated redirects & phishing relays (LOG tier) | A redirect parameter (next, return_to, goto and others) that points to another origin, including // and /\ forms |
| LFI | Local file inclusion / path traversal | ../ patterns, null bytes, encoded variants, Windows 8.3 short names |
| SSRF | Server-side request forgery | RFC-1918 targets, cloud metadata endpoints (169.254.169.254), IPv6 translation addresses |
| Java | Java deserialization, SpEL/OGNL, Log4Shell | Recursive Log4j lookup unfold, nested obfuscation, JNDI protocol variants |
| PHP | PHP code injection, wrapper abuse | php://, data://, dangerous function detection, string concat eval |
| Python | Python code / template injection | eval/exec, os.system, __class__.__mro__ gadget chains, pickle opcodes |
| NoSQL | NoSQL injection | MongoDB operator injection ($where, $ne, $gt), JS expression injection, JSON-encoded operator smuggling |
| LDAP | LDAP injection | Filter metacharacter injection, blind boolean filters, wildcard / null-byte abuse in DN and search filters |
| SSTI | Server-side template injection | Jinja2 / Twig / Freemarker / Velocity expression syntax, sandbox-escape gadgets, arithmetic probes |
| XXE | XML external entity | External / parameter entity declarations, SYSTEM / PUBLIC DTDs, OOB exfil, billion-laughs expansion |
| Deser | Insecure deserialization | Java serialized streams (rO0 / ac ed), PHP O:/a: objects, Python pickle, .NET / YAML gadget markers |
| Proto Pollution | Prototype pollution | __proto__ / constructor / prototype key injection in JSON and query/body params |
| Header Injection | CRLF / response splitting | A header, mail or cache command after a line break. Blocks when the line break is encoded or the command is a mail or cache command; logs a header after a plain line break |
| GraphQL | GraphQL abuse | Introspection queries (logged); a batch over the operation limit is blocked with HTTP 400 |
| JWT | Forged tokens (block tier) | alg: none, kid path traversal |
| Anomaly | Unusual requests | Control characters and high entropy in a long value, a query parameter the project has not seen before (logged); the User-Agent of a known vulnerability scanner (blocked) |
The agent turns what the engines report into one decision for the request: ALLOW, LOG or BLOCK. If part of a request was not fully inspected (oversized or truncated values, field caps, binary bodies), the decision records the coverage gap, and the request becomes LOG rather than a clean ALLOW. With "on_uninspected": "block" under semantic_policies in the policy JSON it becomes BLOCK instead, except when every gap comes from load or from your own choice, such as an engine you switched off; then it stays LOG.
How a request is decided
Twelve engines weigh evidence and have two evidence values, a block value and a lower one. Their parsers compare the evidence they find with both. The fast pattern checks run first and do not use these values:
evidence >= block value → BLOCK (403)
evidence >= lower value → LOG, the request passes
otherwise → ALLOW A LOG request reaches the application; it is a weak detection. With Record weak detections off, it is recorded as a plain allowed request. An engine set to Log only never blocks: what it would block is recorded as LOG. An engine that is switched off looks at nothing.
Sensitivity levels
The level is set for each engine. Twelve engines have levels: SQL, XSS, CMD, PHP, Python, LFI, SSRF, Java, NoSQL, SSTI, XXE and Deser. The other eight have no level: they take Block, Log only or Off.
| Level | Evidence an engine needs | Effect |
|---|---|---|
| Relaxed | About a quarter more than Balanced | Fewer detections and fewer false positives. |
| Balanced | The default values | Default. |
| Strict | About a fifth less than Balanced | More detections and more false positives. |
Tuning false positives
- Set the engine that raises the false positive to Relaxed, under Project settings › Default WAF policy › Detection
- Set that engine to Log only while you look into it: it records and blocks nothing
- Add a rule under Rule paths for known-safe routes (health checks, webhooks)
- Switch an engine off for one path under Rule paths, not for the whole project
Configuration reference
Configuration is read from config/config.yaml, and WAFIO_* environment variables override it. Every YAML key maps to an env var: server.http_addr maps to WAFIO_SERVER_HTTP_ADDR.
Required settings and pool size
| Key | Env var | Description |
|---|---|---|
database.name | WAFIO_DATABASE_NAME | PostgreSQL database name: server refuses to start if empty |
jwt.secret | WAFIO_JWT_SECRET | At least 32 characters. Boot is refused if it is empty or still the placeholder from the example config, in every environment, not only production |
totp.enc_key | WAFIO_TOTP_ENC_KEY | Encrypts 2FA secrets at rest. Mandatory, and must decode to exactly 32 bytes: openssl rand -hex 32 |
database.max_conns | WAFIO_DATABASE_MAX_CONNS | Optional. Shared pool size, default 20. One pool serves decision ingest, dashboard queries, auth and the host paths, so the driver default of max(4, NumCPU) lets a burst of WAF traffic starve the dashboard. Keep the sum across every process pointed at one database below its max_connections |
database.min_conns | WAFIO_DATABASE_MIN_CONNS | Optional. Connections kept warm, default 2. Must not be above database.max_conns |
Hot reload vs restart required
| Setting group | Reload behavior |
|---|---|
server.*, database.*, jwt.*, log.level | Restart required: wired at boot |
smtp.*, server.base_url | Read at boot; when set they win over the dashboard (a non-empty smtp.host makes the whole mail server config-managed) |
| Administration › Email (SMTP) | Used when smtp.host is empty: applied live, no restart (the password is stored encrypted and never shown again) |
| Administration › Data retention | Retention per table and the database size budget: applied live, no restart |
| Project WAF rules JSON | Pushed to agents via gRPC automatically: no restart |
Common settings
server:
http_addr: ":9087" # HTTP listen address (dashboard + API)
agent_grpc_addr: "0.0.0.0:9090" # gRPC mTLS listen address for agents
grpc_domain: "cp.example.com" # name in the gRPC server certificate
base_url: "https://cp.example.com" # absolute link base for emails
trusted_proxies: ["127.0.0.1", "::1"] # reverse proxies whose header is trusted (empty = none)
proxy_header: X-Forwarded-For # or X-Real-IP
agent_recv_account_mib_per_sec: 64 # agent data taken in per account, MiB/s (0 = default)
agent_recv_total_mib_per_sec: 128 # all accounts together, shared fairly (0 = default)
database:
host: localhost
port: 5432
name: wafio
user: wafio
password: secret # raw, never percent-encoded
max_conns: 20
statement_timeout_ms: 15000 # 0 = off, else 1000–600000
jwt:
secret: "output-of-openssl-rand-hex-32"
expire_hours: 72
totp:
enc_key: "output-of-openssl-rand-hex-32"
log:
level: info # debug | info | warn | error
smtp: # optional; or Administration › Email (SMTP)
host: smtp.example.com
port: 587
encryption: starttls # auto | starttls | ssl | none
username: noreply@example.com
password: smtp-password
from: "Wafio <noreply@example.com>" Behind a reverse proxy on the same host, set trusted_proxies as above and have the proxy send X-Forwarded-For $proxy_add_x_forwarded_for (or X-Real-IP $remote_addr with proxy_header: X-Real-IP); otherwise every client appears as 127.0.0.1 to login lockout, rate limits and the audit log.
Metrics
Set WAFIO_METRICS_ADDR=127.0.0.1:9100 (a loopback IP literal; anything else stops the process at start) on the control plane, the WAF agent or the host agent to serve OpenMetrics at GET /metrics on a separate listener. The control plane also reports database size and retention (wafio_db_size_bytes, wafio_db_size_alert_level, wafio_retention_days, …) and the agent receive budget (wafio_agent_recv_*).
WAF project config (per-project JSON)
Each project stores its WAF policy as rules_json (edited in Project settings › Default WAF policy); an application's own policy of {} inherits the project's. Any key left out takes its default: omitting a key never turns an engine off; only disabled: true does. An engine with action: "log" records what it finds and blocks nothing.
{"semantic_policies": {
"scan_all_headers": true,
"sql": {"block_threshold": 4.0, "soft_threshold": 2.5},
"graphql": {"action": "log"},
"ldap": {"disabled": true}
},
"geo": {"block_countries": [], "allow_countries": []},
"bot_protection": {"enabled": false, "mode": "off"},
"l7_flood": {"enabled": true, "window_sec": 60, "max_requests": 500},
"request_body_limit": "5M"
}Upstream timeouts
Each application's proxy timeouts are set from the dashboard, on the WAF Agent and Application pages. They read as three states:
| Value | Meaning |
|---|---|
0 | Not set: the built-in default applies |
-1 | Unlimited: no deadline is imposed. Shown as an Unlimited checkbox in the dashboard |
above 0 | Milliseconds |
The upstream timeout applies to both HTTP and FastCGI upstreams. Unset, it is 30 seconds.
Only the deadline on the backend's response. A request that never finishes holds the connection (and the PHP-FPM worker behind it) until the backend answers or the client gives up. Dial, connection-pool wait and idle timeouts stay bounded; those protect WAFio's own resources rather than the backend's working time.
Prefer a finite value just under whatever your front-end proxy allows, and give the backend a limit of its own (request_terminate_timeout for PHP-FPM). Unlimited turns an error at 30 seconds into a request that hangs instead: sometimes what you want, sometimes worse.
Signed releases
Every WAFio release bundle on wafio.cloud has an Ed25519 signature in the release manifest (latest.json), not in the archive. install.sh checks the SHA-256 from the manifest and then the signature against the release public key built into the installer, and refuses to install a bundle that is unsigned, signed by another key, or whose manifest names a different public key.
A checksum alone proves the bytes arrived intact but says nothing about where they came from: whoever controls the download could serve any binary together with a perfectly correct hash. The signature closes that gap. The signed payload binds the version to the bundle hash, so a valid signature for an older release cannot be passed off as a newer one.
Agents do not update themselves: there is no self-update path. Upgrade any server by re-running the installer (see Upgrading an existing install), which applies the same checks.
GET /api/download/<component>/sig returns the version, SHA-256, signature and public key of a bundle. The signed payload is wafio-release-v1, the version and the SHA-256, each on its own line.
Downloads
WAFio is free to download from the wafio.cloud portal, with no account, signup, or API key required. Each bundle download adds one to a daily count per component and client type (installer, browser or crawler). No address and nothing else about the client is stored.
Download endpoints
| Endpoint | Auth | Description |
|---|---|---|
GET /api/download/manifest | None | Returns latest.json with version and SHA-256 checksums for all bundles |
GET /api/download/controlplane | None | Download control plane bundle (amd64) |
GET /api/download/waf-agent | None | Download WAF agent bundle (amd64) |
GET /api/download/host-agent | None | Download host agent bundle (amd64) |
GET /api/download/<component>/sig | None | Ed25519 release signature, version, SHA-256 and public key of a bundle |
GET /api/download/<component>/sbom | None | SPDX JSON software bill of materials of a bundle, when published |
GET /api/download/stats | None | How many bundles installers and browsers downloaded, and the first day counted |
Using the API
# Check current version and checksums
curl -s https://wafio.cloud/api/download/manifest | python3 -m json.tool
# Download WAF agent bundle (no key needed)
curl -fsSL "https://wafio.cloud/api/download/waf-agent" -o wafio-waf-agent.tar.gz
# Verify checksum
EXPECTED=$(curl -s https://wafio.cloud/api/download/manifest \
| python3 -c "import sys,json; print(json.load(sys.stdin)['bundles']['waf-agent']['sha256'])")
echo "$EXPECTED wafio-waf-agent.tar.gz" | sha256sum -c Bundle contents
Each bundle is a .tar.gz archive containing the binary, an install.sh helper script, NOTICES.txt and README.txt. The control plane bundle also carries the dashboard (frontend/) and the database migrations/. The WAF agent bundle also carries the engine library libwafio_semantic_engine.so with its .sha256, and its systemd unit. The host agent bundle also carries the CO-RE eBPF objects and its systemd unit.
Error responses
| HTTP status | Condition |
|---|---|
400 | Unknown component name (must be controlplane, waf-agent, or host-agent) |
429 | More than 60 requests in a minute from one client (RATE_LIMITED) |
503 | Bundle, signature or SBOM not published yet: check the manifest for the current version |