kubeWAF is under active development — feedback and stars on GitHub are very welcome!
kubeWAFkubeWAF
kubeWAFmodsecurity-proxy-wasmpow-proxy-wasm

WAF engine

Select and configure the ModSecurity Wasm engine on a WAF resource

A kubeWAF WAF resource always evaluates traffic with a Proxy-Wasm WAF engine. The supported product engine is ModSecurity via modsecurity-proxy-wasm (OWASP CRS embedded in the binary).

This page is operator-facing: which CR fields select the engine, enable CRS, and override wasm delivery. For standalone Envoy use, metrics series, and build details, see modsecurity-proxy-wasm.


Select the engine

apiVersion: waf.kubewaf.io/v1beta1
kind: WAF
metadata:
  name: shop-waf
  namespace: shop
spec:
  engine: ModSecurity
  crsEnable: true
  provider:
    type: EnvoyGateway
  parentRefs:
    targetRef:
      group: gateway.networking.k8s.io
      kind: Gateway
      name: external
  ruleRefs:
  - kind: RuleSet
    name: shop-rules
FieldDescription
engineModSecurity — product engine (modsecurity-proxy-wasm)
crsEnableWhen true, include embedded OWASP CRS with correct directive order
crsOptional declarative CRS tuning (paranoia, exclusions, …) — see Using CRS
logLevelFilter log verbosity (07)
ruleRefsRuleSets to append as SecLang after defaults/CRS

Optional PoW challenge before this engine: Proof-of-Work challenge.


How config reaches Envoy

  1. Operator resolves RuleSets → SecLang directives
  2. Builds plugin JSON (directives_map, metrics labels, block message, …)
  3. Publishes ECDS resource kubewaf/<namespace>/<waf-name>
  4. Envoy loads modsecurity-proxy-wasm from the operator wasm server (or your URL)

Default serve path:

GET /wasm/modsecurity-proxy-wasm.wasm

You do not hand-author the plugin JSON for normal GitOps use — the controller owns that mapping.


Override the wasm binary

Per-WAF (on the CR):

FieldDescription
wasmHTTPHTTPS URL Envoy uses to fetch the WAF .wasm
wasmSHA256Optional content pin
wasmImageOptional OCI reference (documentation / future fetchers)
spec:
  engine: ModSecurity
  wasmHTTP: https://cdn.example.com/modsecurity-proxy-wasm.wasm
  wasmSHA256: "abcdef..."

Cluster defaults (Helm / operator flags):

Helm / flagPurpose
dataplane.modsecurityWasmFile / --modsecurity-wasm-filePath inside operator image
dataplane.modsecurityWasmSourceURL / --modsecurity-wasm-source-urlDownload at operator startup
# values.yaml excerpt
dataplane:
  modsecurityWasmFile: /wasm/modsecurity-proxy-wasm.wasm

Status

kubectl get waf shop-waf -o jsonpath='{.status.engine}{"\n"}'
# ModSecurity

When challenge is also enabled: status.challengeEnabled=true (see challenge).


On this page