Protection starts here.
From your first request to your entire stack. Get GuardianWAF running in the way that fits your application.
01. Pick your installation
Download a prebuilt binary for your platform, use the official container image, or install using a compatible Go toolchain. Check the repository’s go.mod for the current Go requirement.
Download the latest releaseThe source build includes a dashboard asset step; use the official source-build workflow if you are building a release yourself.
go install github.com/guardianwaf/guardianwaf/cmd/guardianwaf@latest02. Docker sidecar
The quickest way to protect an existing application. This example creates a demo backend and the WAF on a shared Docker network.
For your application, replace http://app:80 with its reachable upstream address. For production, choose a pinned container release. Automatic service discovery is also available with gwaf.* Docker labels.
docker network create guardian-demo
docker run -d --name app --network guardian-demo nginx:alpine
docker run -d --name guardianwaf --network guardian-demo \
-p 8088:8088 \
ghcr.io/guardianwaf/guardianwaf:latest \
sidecar --upstream http://app:80
curl -i http://localhost:808803. Go middleware
Wrap a standard net/http handler. The engine runs inside your application, with no external Go module dependencies.
Start your application and send a request to http://localhost:8088. Use thresholds, exclusions, and event callbacks to adapt protection to your own traffic.
go get github.com/guardianwaf/guardianwafpackage main
import (
"log"
"net/http"
"github.com/guardianwaf/guardianwaf"
)
func main() {
waf, err := guardianwaf.New(guardianwaf.Config{
Mode: guardianwaf.ModeEnforce,
})
if err != nil { log.Fatal(err) }
defer waf.Close()
app := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello, protected world."))
})
log.Fatal(http.ListenAndServe(":8088", waf.Middleware(app)))
}04. Standalone reverse proxy
Install a binary, then save this file as guardianwaf.yaml. The proxy listens on port 8088 and forwards requests to a local app on port 3000.
mode: monitor and review the findings first.mode: enforce
listen: ":8088"
upstreams:
- name: app
targets:
- url: "http://localhost:3000"
routes:
- path: /
upstream: appguardianwaf serve -c guardianwaf.yaml05. Before you go live
Use the project’s production deployment guide for the complete configuration. At a minimum:
- Start in monitor mode, review findings, and tune exclusions for your application.
- Configure TLS certificates or place the WAF behind your trusted TLS terminator.
- Keep the dashboard on a private interface with separate viewer and administrator keys.
- Configure trusted proxy addresses so client IP handling matches your infrastructure.
- Set up health probes, metrics, persistent configuration, and event retention.
- Pin the release you deploy and follow the project’s upgrade guidance.
Go a little deeper.
The source repository is the authoritative reference for configuration and supported capabilities.