Repository navigation
v0.6.0
Highlights
- Responses through HAProxy (#469, #470). A policy with
responses.inspectnow has the responses of its HAProxy Kubernetes Ingress Controller Ingresses inspected, as through Envoy Gateway and Istio: the operator injects the engine with--response-messagesand adds the response rules to each Ingress's backend snippet; they wereResponsesNotInspectedin 0.5.x. An HAProxy you configure yourself gets the same withinkwall-engine spoe --inspect-responsesand the newinkwall-responseSPOE group ofexamples/haproxy/spoe.confandhaproxy.cfg(protecting HAProxy). A response that leaks is replaced with 403 inBlockmode and logged inDetectmode. - Streamed responses, event by event (#323), opt-in.
responses: {inspect: true, streams: Inspect}inspects each Server-Sent Event and each message of a gRPC response on its own, through Envoy Gateway and Istio (raw Envoy:--response-streams inspect), instead of letting their bodies pass with only the status and headers inspected; inBlockmode a leaking event ends the stream, and the client keeps the events before it. The standalone proxy inspects responses too (inkwall-engine proxy --inspect-responses, and--response-streams inspectfor streams), bounded by--max-held-response-bytes(Responses). Traefik's ForwardAuth never sends the engine a response, and won't: route such traffic through another proxy, or put the standalone engine in front of the app (why). - gRPC (gRPC):
- Long streams, one message at a time (#315), opt-in. With
body.grpcMessages: Inspect,body.grpcStreams: PerMessagehas each message of a call inspected as it arrives, through Envoy Gateway, Istio and raw Envoy (--grpc-streams per-message), so long client streams and bidirectional calls work inBlockmode; a denied message ends the call with its gRPC status. The messages before a denied one have already reached the application, which is whyBufferstays the default. - Server messages (#317). With streamed responses inspected, what a gRPC server sends back is inspected per message, and its status message (
grpc-message, where a server's error text goes) as one more event: a SQL error leaked there is replaced by the denial, or ends the call when it comes in the trailers.
- Long streams, one message at a time (#315), opt-in. With
- Status proves what it claims (the operator's probe):
- The probe proves responses (#595). For a policy with
responses.inspect, the operator's probe now also proves that each route's responses reach the engine, through every Istio gateway pod and every HAProxy controller pod: a second request per pod and listener (the response leg). Until it has, the policy isUnverified; where a pod's engine doesn't see the responses,ResponsesNotInspected, naming the pod. Detect-mode Istio routes areProgrammed(#475). Envoy discards the engine's answer to the probe inDetectmode, so those routes stayedUnverifiedin 0.5.x. The engine now keeps a receipt of each probe it verified and reports it to the operator, which proves the route by it.
- The probe proves responses (#595). For a policy with
- Answers, not only status:
inkwallctl explain(#438):explain policy <namespace>/<name>gives the cause and the fix of each condition that isn'tTrue;explain request <request-id>(theX-Request-Idof a denial) lists the rules that matched with their CRS descriptions, the score against the threshold, and the narrowest exclusion, checked asinkwallctl test --policydoes.-o jsonfor scripts (Explaining a policy or a denial).- A read-only MCP server (#439):
inkwallctl mcpserves those answers to an AI assistant (Claude Code, Cursor, VS Code, ...) over the Model Context Protocol:status,explain_policy,explain_request,test_policy,suggest_exclusions,list_policies,get_policy, and this version's docs. The assistant starts it on your machine with your kubeconfig; it never writes to the cluster, and nothing is hosted (Using Inkwall from an AI assistant).
- Traefik is as fast as the other proxies (#625, #626). Traefik's ForwardAuth allocated its
maxBodySize(10 MiB) for every request, body or not, which added about 8 ms at p50. On Traefik v3.7 and later the operator'sinkwall-wafMiddleware is now achain:inkwall-waf-body, a Buffering Middleware that bounds request bodies (10 MiB + 1, in memory; responses aren't buffered), theninkwall-waf-auth, the ForwardAuth, with no body limit of its own. Routes keep referring toinkwall-waf, the engine inspects the same requests, and Traefik now adds about 1.3 ms at p50 (Tested). Before Traefik v3.7, the Middleware stays as it was. - Rule sets before the CRS (#423). A rule set binding takes
placement: BeforeCRS: the rule set loads before the CRS's initialization, as the standalone engine's--rules-before-crs, so itssetvar:tx.…andctl:ruleRemoveByIdrules change what the CRS does, on conditions of their own (README). - The operator's metrics over HTTPS (#430), opt-in:
metrics.secure.enabled=trueserves/metricsover HTTPS only to bearer tokens the API server authenticates and authorizes forgeton/metrics(the newinkwall-operator-metrics-readerClusterRole); a rejected token gets 401 (#562) (Metrics over HTTPS). - HAProxy: bodies over an SPOE frame are handled as oversized (#336). HAProxy sends each request and response to the engine in one frame and sends none of one that doesn't fit. For
Block-mode policies, the operator's backend snippet answers such a request with 413 and replaces such a response with 502, asbody.onOversizeandresponses.onOversizesay (0.5.2 did it for requests).Programmed's note on HAProxy's buffer also names aresponses.maxByteslarger than it, and Bodies gives the memory a largertune.bufsizecosts. WAFIPListin Managed mode (#577). A control plane can deliver the IP lists its policies name in a policy snapshot, written and pruned like the other kinds and labelledinkwall.dev/source: saas, and the cluster state lists everyWAFIPList(Managed mode).- The Go memory limit from the container's cgroup (#537). The engine and the operator set
GOMEMLIMITto 90% of the container's cgroup memory limit whenMEMORY_LIMITisn't set, so a standalone engine in a plain container (docker run --memory 256m) gets one too; theGo memory limit setlog line says where it came from (memory limit). - A pinned older engine starts (#536). With
InkwallConfig.spec.engine.imagepinned to an older release, the operator leaves out the flags that engine doesn't know, instead of injecting them and leaving its pod crash-looping; the newEngineConfiguredcondition and a Warning Event name the settings left out.
What each proxy inspects
| Requests | Bodies | Responses | Streamed responses (SSE, gRPC) | gRPC message text | gRPC streams per message | WebSocket handshake | WebSocket messages | |
|---|---|---|---|---|---|---|---|---|
| Traefik (ForwardAuth) | Yes | Yes | No (ResponsesNotInspected) |
No | Yes | No (buffered) | Yes | No |
| Envoy Gateway (ext_proc) | Yes | Yes | Yes (responses) |
Yes (streams: Inspect), new in 0.6.0 |
Yes | Yes (grpcStreams: PerMessage), new in 0.6.0 |
Yes | No |
| Raw Envoy (ext_proc) | Yes | Yes | Yes, when envoy.yaml sends them |
Yes (--response-streams inspect), new in 0.6.0 |
Yes | Yes (--grpc-streams per-message), new in 0.6.0 |
Yes | No |
| Istio (ext_proc) | Yes | Yes | Yes (responses) |
Yes (streams: Inspect), new in 0.6.0 |
Yes | Yes (grpcStreams: PerMessage), new in 0.6.0 |
Yes | No |
| HAProxy (SPOE) | Yes | Up to HAProxy's buffer (about 15 KiB unless you raise tune.bufsize); larger is oversized |
Yes (responses, or --inspect-responses by hand), up to HAProxy's buffer, new in 0.6.0 |
No (ResponsesNotInspected) |
Yes, within the body sent | No (buffered) | Yes | No |
inkwall-engine proxy |
Yes | Yes | Yes (--inspect-responses), new in 0.6.0 |
Yes (--response-streams inspect), new in 0.6.0 |
Yes, with --h2c or TLS for gRPC |
No (buffered) | Yes | Yes (--websocket-messages) |
A gRPC response's status message (grpc-message) is read through Envoy only. A proxy that can't do what a policy asks never pretends to: the policy's status says so.
Tested
The battle test of CONTRIBUTING.md (#600) ran on this release's code; its tools are in the repository, to run on your own machine and traffic.
False positives (make fp-run, #608). The recorded traffic of OWASP Juice Shop, an online shop with an Angular front end and a REST API: 560 requests from six scripted shoppers with six browsers' headers (register, log in, search, review, fill a basket, check out, send feedback, upload a complaint, change the password), with free text that is hard on a WAF. Every request is benign, so every denial is a false positive. The policy: the built-in CRS in Block mode, nothing excluded.
| Paranoia level | Denied of 560 | False-positive rate | With crs.allowedMethods |
|---|---|---|---|
| 1 | 23 | 4.11% | 1 (0.18%) |
| 2 | 46 | 8.21% | 28 (5.00%) |
| 3 | 65 | 11.61% | 49 (8.75%) |
| 4 | 108 | 19.29% | 96 (17.14%) |
At paranoia level 1, 22 of the 23 denials come from rule 911100, method enforcement: the shop's REST API takes PUT and DELETE, which the CRS refuses by default. Setting the policy's crs.allowedMethods for the API (as any REST API needs) removes them; the last column is the same run with allowedMethods: [GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS]. The one left at level 1 is rule 920120 on the photo upload (POST /rest/memories, multipart). Higher levels add SQL injection rules (942xxx) on checkout, address, feedback and login bodies, a remote file inclusion rule (931130) on the shop's own /redirect?to=https://..., and, at levels 3 and 4, the byte-range rules (920272, 920273) on bodies with accents and symbols: that is why level 1 is the default, and a higher level is for tuning in Detect mode first.
Latency added per proxy (make kind-response-load). 8 concurrent clients, 20 s per run (closed loop, after a 3 s warm-up), GET of an nginx page of about 1 KB or about 15 KB (HTML, uncompressed), through each proxy with a Block-mode policy, against the same proxy without a policy (the standalone proxy: against the app directly). One kind node (Kubernetes v1.34.11), one replica of each proxy, the client on the host: a 12th Gen Intel Core i7-1255U laptop, 12 CPUs, 15 GiB. Added p50 / p99:
| Proxy | Requests inspected, 1 KB | Requests inspected, 15 KB | Responses inspected too, 1 KB | Responses inspected too, 15 KB | Engine RSS peak |
|---|---|---|---|---|---|
| Traefik | +1.36 / +3.86 ms | +1.27 / +2.91 ms | n/a (no responses) | n/a | 106 MiB |
| Envoy Gateway | +1.22 / +2.77 ms | +1.38 / +3.00 ms | +2.47 / +4.82 ms | +15.57 / +20.28 ms | 107 MiB |
| Istio | +1.82 / +3.60 ms | +2.09 / +3.69 ms | +2.95 / +6.40 ms | +16.47 / +24.77 ms | 107 MiB |
| HAProxy | +1.00 / +3.23 ms | +0.95 / +2.80 ms | +1.73 / +3.86 ms | +15.57 / +23.11 ms | 103 MiB |
| Raw Envoy | +1.28 / +3.24 ms | +1.37 / +2.92 ms | +2.50 / +5.24 ms | +16.14 / +21.90 ms | 107 MiB |
inkwall-engine proxy |
+0.96 / +2.91 ms | +1.15 / +4.32 ms | +1.79 / +3.98 ms | +15.39 / +20.76 ms | 104 MiB |
Inspecting requests adds about 1 to 2 ms at p50 and 3 to 4 ms at p99 through every proxy; Traefik added 8.4 ms at p50 before #626. Inspecting a response reads its body before the client gets any of it: about 1 ms per KiB of HTML at this load, so a 15 KB page takes about 15 ms more. Turn responses.inspect on for the routes that can leak (APIs, error pages), and raise the policy's timeout with responses.maxBytes.
Soak with chaos (make kind-soak).
One hour on the release's fixes, chaos every 10 minutes, 5 requests per second per proxy (one in five an attack), and a policy edit every 10 minutes.
The six proxies on one kind cluster (Traefik, Envoy Gateway, Istio, HAProxy, raw Envoy, the standalone proxy), each with steady clean and attack traffic, and at a fixed interval one of: the operator's leader killed, an engine killed, a proxy's pod deleted, the API server stopped, the bundle distribution cut.
| Proxy | Clean requests (app answered) | Attacks (denied) | Attacks through | False denials | p50 / worst p99 outside chaos |
|---|---|---|---|---|---|
| Traefik | 14,399 | 3,599 | 0 | 0 | 2.2 / 112 ms |
| Envoy Gateway | 14,398 | 3,599 | 0 | 0 | 2.4 / 36 ms |
| Istio | 14,399 | 3,599 | 0 | 0 | 2.8 / 34 ms |
| HAProxy | 14,378 | 3,594 | 0 | 0 | 1.8 / 32 ms |
| raw Envoy | 14,399 | 3,599 | 0 | 0 | 2.2 / 41 ms |
| standalone proxy | 14,399 | 3,599 | 0 | 0 | 1.7 / 41 ms |
No attack reached the app, and no request failed outside chaos. Recovery: the operator's leader killed 29 s, an engine killed 9 s, a proxy's pod deleted 30 s, the API server stopped for 20 s 3 s, the distribution cut for 90 s 14 s. Engines stayed at 62 to 68 MiB and the operator at 108 MiB, with no growth. One status claim was early: a policy edit made seconds after the API server came back was Enforced through raw Envoy about 10 s before its engine ran it (attacks were still denied; only the edit's new rule wasn't applied yet). It didn't recur in a targeted run of six such edits, and is tracked in #675.
And on every change: the OWASP CRS regression suite through every adapter, each proxy's end-to-end test on kind, upgrades from each supported release, the release qualification of the older release branches (#619), fuzzing, and the scale and stress tests.
Changes that may need action
- Upgrade the chart before using the new fields.
placement: BeforeCRS,responses.streamsandbody.grpcStreamsneed the 0.6.0 CRDs. A policy that uses one isEnforced=False(EnginesOutdated) while an engine before 0.6.0 runs it, since an older engine would load the rule set after the CRS, or let streams through uninspected or buffered: restart the proxy pods that run the engine, or letspec.engine.rollout: Automaticdo it. - Traefik: upgrade Traefik and its CRDs together to v3.7 or later to get the faster Middleware; the operator detects the version from the CRD and from Traefik's image tag, and before v3.7 keeps the old single ForwardAuth (and its latency). On v3.7+:
- the operator rewrites
inkwall-wafinto achainof two new Middlewares in the same namespace,inkwall-waf-bodyandinkwall-waf-auth, on its first reconcile, with no restart of Traefik. A Middleware of yours with one of those names stops the wiring in its namespace (WiringFailed): rename it; - a request body over 10 MiB + 1 gets 413 from Traefik instead of 401, and a chunked request body reaches the application with a
Content-Length; - after a rollback to 0.5.x, the older operator rewrites
inkwall-wafto its ForwardAuth in place and leavesinkwall-waf-bodyandinkwall-waf-authunused:kubectl delete middlewares.traefik.io -A -l app.kubernetes.io/managed-by=inkwall-operator --field-selector metadata.name=inkwall-waf-body(andinkwall-waf-auth) removes them.
- the operator rewrites
- The operator's probe reaches your app, in
Blockmode too, for policies withresponses.inspecton Istio and on the HAProxy controller (#595): aGET(orHEAD) withUser-Agent: inkwall-operator-probeon the reserved path.well-known/inkwall-probe/<nonce>?inkwall-probe-leg=response(or an exact path with?inkwall-probe=<nonce>&inkwall-probe-leg=response), per pod and listener every 5 minutes. Your app can answer 404; the engine replaces its answer. InDetectmode, Istio's request probe reaches your app as well (#475). Such policies areUnverifieduntil the probe has passed, and a rule matching only a method other thanGETorHEADisNotProbeablethere. Alerts onReadyshould expect it after the upgrade. - HAProxy controller: restart its pods after the upgrade (or
spec.engine.rollout: Automatic) for response inspection: until every controller pod runs an engine injected by 0.6.0, a policy withresponses.inspectstaysProgrammed=False(ResponsesNotInspected), naming the pods. A pinnedspec.engine.imagemust be 0.6.0 or later. A policy withresponses.streams: InspectisResponsesNotInspectedon HAProxy's Ingresses, since HAProxy doesn't send a streamed body. - HAProxy configured by hand: copy the new lines of
examples/haproxy/spoe.conf(theinkwall-responsegroup and message, and the longerregister-var-names) andhaproxy.cfg(theAccept-Encodingremoval, thehttp-responserules, and the two rules ontxn.inkwall.error) to inspect responses and handle oversized ones; they do nothing until the engine runs with--inspect-responses. - Metrics over HTTPS is off by default, also with
--reuse-values. Before turning it on, bind the newinkwall-operator-metrics-readerClusterRole to Prometheus' service account, unless its role already allowsgeton/metrics. inkwallctl explain requestreads the engines' logs: it needsgetonpods/log.- In Managed mode, a
WAFIPListlabelledinkwall.dev/source: saasbelongs to the control plane: the webhook refuses deleting it, and the next snapshot that doesn't carry it deletes it. The operator never wrote such lists before 0.6.0, so one you labelled yourself is pruned: find them withkubectl get wafiplist -A -l inkwall.dev/source=saasand remove the label before the cluster is in Managed mode. GOMEMLIMITfrom the cgroup: a standalone engine in a container with a memory limit and noMEMORY_LIMITnow setsGOMEMLIMITto 90% of it.MEMORY_LIMIT, andGOMEMLIMITset by hand, still win.- A pinned older engine is injected only with the flags its release knows, read from the image tag; an image whose tag isn't a release (
latest, a digest alone) gets only the flags every release knows. Pin a custom build with its version in the tag (:0.6.0@sha256:...) to keep every setting; theEngineConfiguredcondition names what was left out.
Fixed
- Traefik (ForwardAuth) added 8 to 10 ms at p50, six times the other proxies: Traefik allocated 10 MiB per request (#625, #626).
- A policy could be
Enforcedfor a moment after the bundle distribution was cut, while a proxy pod that serves it had no connected engine:Enforcednow waits for the engine of every running proxy pod that serves the policy (EnginesBehind, naming the pods) (#652). - An engine pinned to an older release crash-looped on flags it didn't know (#536).
- A control plane couldn't deliver or see
WAFIPListobjects (#577). - The forward-auth adapter's invalid-request log no longer quotes the
X-Forwarded-Hostvalue (#620). - The operator answers 401, not 500, to a rejected token on the secure metrics endpoint (#562).
- The GitOps health checks' test module pinned
golang.org/x/netandx/textversions with known vulnerabilities; it ships in no image or binary, and every Go module is now in Dependabot and the vulnerability scan (#567). - Releases: cosign is installed and signing is checked before anything is published, and retried, so a failed download or signing step can't leave an unsigned image or chart on GHCR (#541, #586).
Security
This release fixes six vulnerabilities, also fixed in 0.5.4 and 0.4.3. The advisories' details are published with the release. 0.3.x reached the end of support with this release and gets no patch: upgrade to 0.4.3 or later.
- High: A request can be inspected by a weaker policy than the route it reaches (GHSA-c52q-5h8m-279w). Affects 0.3.0 to 0.5.3, in bundle mode, where a path with dot segments, encoded characters or repeated slashes can select another route's policy.
- High: A namespace's WAFPolicy can weaken or freeze another namespace's protection on a shared proxy fleet (GHSA-r2m3-77h9-hq8v). Affects 0.3.0 to 0.5.3, where several namespaces may create policies and routes for one proxy fleet.
- High: Standalone proxy forwards non-WebSocket upgrades such as h2c (GHSA-9rmr-w4mp-34f3). Affects every release up to 0.5.3, the standalone proxy only.
- Medium: Response inspection skips bodies by media type, Range and Content-Encoding list (GHSA-6vg9-25gh-3327). Affects 0.4.0 to 0.5.3, with response inspection on.
- Medium: gRPC message fields with control characters are not inspected, and some event snippets are not redacted (GHSA-m6qq-cj2f-9h75). Affects 0.4.0 to 0.5.3, with
body.grpcMessages: Inspect. - Medium:
inkwallctl migrate ingress-nginxcan produce a broader exclusion than the source rules (GHSA-pjxq-6323-wcr3). Affectsinkwallctl0.3.0 to 0.5.3; no running component.
Upgrading
Upgrade the chart (Helm 3 or 4; run it with --dry-run first), upgrade Traefik and its CRDs to v3.7 or later if you run Traefik, then restart the proxies whose pods run the engine (Traefik, Istio's ingress gateways, the HAProxy controller; Istio rolls its Gateway API gateways and Envoy Gateway re-creates its own) so they get the 0.6.0 engine, or let spec.engine.rollout: Automatic do it. Until they do, a policy that uses a new field is Enforced=False (EnginesOutdated), and a policy with responses.inspect on HAProxy stays ResponsesNotInspected. Every new feature is off until a policy, a flag or a chart value asks for it. See from 0.5.x to 0.6.0.
Supported versions: 0.6, 0.5 and 0.4 get fixes (SECURITY.md). 0.3 is out of support: upgrade to a supported minor.
Changelog
Features
- feat(engine): inspect gRPC request streams message by message through Envoy (opt-in grpcStreams: PerMessage) (#603)
- feat(engine): inspect gRPC server messages and their status message through Envoy (#613)
- feat(engine): inspect responses in the SPOE agent (#558)
- feat(engine): inspect streamed responses event by event through ext_proc (#592)
- feat(engine): take the Go memory limit from the container's cgroup when MEMORY_LIMIT isn't set (#569)
- feat(engine): the reverse proxy inspects responses (#590)
- feat(inkwallctl): an MCP server with read-only tools for AI assistants (#578)
- feat(inkwallctl): explain a denied request or a policy that isn't Ready (#560)
- feat(operator): inspect responses through the HAProxy Kubernetes Ingress Controller (#591)
- feat(operator): make HAProxy's oversize handling exact for bodies over its buffer (#602)
- feat(operator): prove Detect-mode Istio routes by the engine's probe receipts (#576)
- feat(operator): prove response inspection with the probe's response leg (#612)
- feat(operator): serve metrics over HTTPS with authentication and authorization (optional) (#561)
- feat(policy): let a rule set load before the CRS (placement: BeforeCRS) (#553)
- feat: WAFPolicy.spec.responses.streams, and the reverse proxy inspects streamed responses event by event (#601)
Bug fixes
- fix(adapters): keep the X-Forwarded-Host value out of the forward-auth invalid-request log (#623)
- fix(engine): a stream the proxy ends at a denied event no longer logs an error (#617)
- fix(engine): stream gRPC calls per message in bundle mode (grpcStreams: PerMessage) (#647)
- fix(operator): a control plane delivers and sees WAFIPList objects (#582)
- fix(operator): answer 401, not 500, to a rejected token on the secure metrics endpoint (#589)
- fix(operator): hold a policy's Enforced back while a serving pod's engine isn't connected (#653)
- fix(operator): inject only the engine flags a pinned engine's version knows (#575)
- fix: the vulnerabilities of the 0.6.0 security advisories (#668)
Performance
- perf(operator): stop Traefik allocating 10 MiB per request in ForwardAuth (#626)
Install
helm install inkwall oci://ghcr.io/inkwall-dev/charts/inkwall --version 0.6.0 \
--namespace inkwall-system --create-namespaceImages: ghcr.io/inkwall-dev/inkwall-engine:0.6.0, ghcr.io/inkwall-dev/inkwall-operator:0.6.0
(linux/amd64, linux/arm64), signed with cosign, with SBOM and provenance attestations.