How to troubleshoot Envoy Gateway WAF false positives without switching the rule off
Troubleshoot Envoy Gateway WAF false positives by reading the shadow event, finding the CRS rule ID, and scoping a narrow exception to one route and parameter.
The short answer: find the rule, then narrow the exception
To troubleshoot Envoy Gateway WAF false positives without switching the rule off, inspect the shadow event to identify the matching rule ID, verify the payload context, and apply an exception scoped strictly to that rule, route, and parameter. Disabling a rule cluster-wide removes protection for every route that shares it, including paths you have not audited yet.
Exceptions are code. Every false positive resolves through four specific moves: capture the request, identify the rule ID that fired, decide whether the payload is legitimate business traffic, and write a RevetmentException custom resource. Revetment attaches to Envoy Gateway through the Kubernetes Gateway API. It is not an ingress controller and does not run on NGINX, Traefik, HAProxy, or Istio. Because our policies are Kubernetes CRDs targeting HTTPRoute resources in the Gateway API HTTPRoute specification, your exception lives as a declarative manifest in Git next to the routing table. Details on extension points are available in the Envoy Gateway Documentation.
When an alert fires or an application team reports an unexpected HTTP 403 status code, use a three-way decision tree:
- The rule is wrong for this parameter: the data is legitimate business input that matches an attack signature. Scope a narrow exception to the parameter on that specific route.
- The application is wrong: a frontend script sends malformed JSON, unencoded special characters, or incorrect headers. Fix the client serializer to keep the security perimeter intact.
- The payload is ambiguous: the data looks like an injection attempt but appears in normal user traffic. Keep the route in shadow mode to collect more traffic samples before taking action.
Turning off a Core Rule Set signature across your entire cluster solves an immediate user complaint by creating a silent security hole everywhere else. When you troubleshoot Envoy Gateway WAF false positives properly, you eliminate false alarms on known fields while keeping inspection active across all other parameters.
Why false positives cluster around a few CRS rules
Signatures match syntax. The OWASP Core Rule Set (CRS) is a collection of generic attack detection signatures. Regular expressions cannot determine if an apostrophe or a SQL keyword came from an attacker probing a database or an author updating an editorial article. When an application accepts structured text, false alarms are inevitable.
In our implementation, 477 of the pinned OWASP CRS v4.30.0 rule ids compile at paranoia level 1. The rules that do not load are named on our cannot-stop list. If an alert reports a rule ID that is not present in our compiled set, that rule never loaded in Envoy, and the event came from an external proxy or an upstream application filter. Checking our load list prevents engineers from debugging non-existent rule matches.
According to the OWASP CRS paranoia level documentation, Paranoia Level 1 (PL1) is the baseline tier designed to produce minimal false positives for standard web traffic. The OWASP CRS false positive tuning guide explains that signature tuning balances attack detection against operational disruption. When a false positive occurs at PL1, the payload almost always resembles a real attack vector. Common culprits include:
- Rule 942100 detects SQL injection patterns when query parameters or JSON fields contain SQL keywords like
UNION,SELECT, orORfollowed by quotation marks. Search bars and content management APIs hit this rule frequently. - Rule 941100 detects Cross-Site Scripting patterns on HTML tags, angle brackets, or JavaScript event handlers. Rich-text editors and Markdown inputs routinely trip this signature.
- Rule 920270 detects restricted HTTP headers on unconventional header values or missing
Acceptheaders from third-party webhook dispatchers. - Rule 932100 detects remote code execution syntax such as shell command separators, pipes, or environment variable patterns in configuration fields.
No signature engine can promise total detection or an absence of false alarms. Revetment does not promise complete detection or zero false positives; our workflow is built to show the false positives before blocking. Scoping exceptions systematically keeps inspection active across the rest of the payload.
Step 1: capture the event before you change anything
Inspect the payload directly. To fix a false positive, you need the exact string that triggered the match and the field where it lived. Guessing the trigger based on an HTTP error page leads to broad, dangerous exceptions. You must inspect the inspection record directly.
Shadow mode records what a rule would have blocked and lets the request through. Blocking is a separate, per-route promotion. When a route operates in shadow mode, incoming requests pass to your upstream backend services unharmed, while the data plane writes an audit event detailing what the engine would have done. Our team documented this workflow in our post on Envoy Gateway WAF shadow mode.
Each recorded event contains four critical attributes:
- Rule ID, which is the numeric identifier of the matching OWASP CRS rule such as
942100. - Target Route, which is the Kubernetes namespace and name of the
HTTPRouteresource receiving the request. - Parameter Location, which is the exact transport location of the match, such as
ARGS:q,REQUEST_HEADERS:Authorization, orARGS_POST:body.description. - Redacted Excerpt, which is a snippet of the matched payload with surrounding context, showing the trigger string while masking sensitive user credentials.
The data plane inspects requests inside your Envoy process and sends no traffic to Revetment, keeping inspection within your infrastructure boundary while the hosted console remains entirely optional. If you use our console, it groups events by rule, route, parameter, and excerpt. The hosted console keeps 7 days on Free and 13 months on Pro. Self-hosted retention is yours to set. Operators managing local environments can pull these records directly from standard cluster logging pipelines or local persistent storage.
Once you capture the event, recreate it against a staging environment using curl:
curl -X POST https://staging.example.com/api/v1/posts \
-H "Content-Type: application/json" \
-d '{"title": "Quarterly Review", "body": "Sales were up or down depending on the region."}'
Verify that your staging gateway records the identical rule ID on the identical parameter. If the staging gateway does not fire, compare your staging and production RevetmentPolicy manifests to confirm both run the same rule set.
Step 2: decide whether the rule or the request is wrong
Classify the root cause. Once you reproduce the event, classify the underlying cause before writing any policy code. Review the payload with the engineering team that owns the route. Triage falls into three categories:
Legitimate business traffic
An application endpoint expects free-form input, Markdown, mathematical expressions, or serialized payloads. For example, a blogging platform accepts HTML tags in article bodies, or an analytics dashboard accepts boolean query expressions in search filters. The WAF detected an attack pattern, but the pattern is valid application data. In this situation, the rule is wrong for that specific field, and you should scope an exception.
Malformed payloads from client bugs
Frontend code or an external webhook provider may serialize data incorrectly. Common examples include JavaScript clients transmitting string representations like [object Object] in query parameters, or mobile applications passing unencoded raw binary data inside standard string headers. The rule fired on garbage data that violates the application's own API schema. The correct remedy is to fix the client serializer. Scoping an exception here masks upstream bugs and weakens security.
Genuine attack attempts
Security scanners and automated scrapers send probing requests continuously. A user filing a support ticket might claim they experienced an error while performing routine tasks, but the audit record reveals directory traversal tokens such as ../../etc/passwd or automated exploit payloads. Verify application access logs to see whether the user was attempting unauthorized actions. If the payload is malicious, keep blocking enabled. No policy change is needed.
Review the commit diff. Every exception creates an intentional gap in your security perimeter. Document the business justification directly in your Git commit message so future engineers understand why that input field bypasses inspection.
Step 3: write a scoped exception, not a rule disable
When you confirm a false positive on valid data, implement the fix using a declarative manifest. Exceptions are scoped to a rule, a route, and a parameter. They are not a global rule disable. Writing exceptions as code ensures that your WAF policies follow the same code review, testing, and deployment gates as application services.
Revetment runs as a native module inside the Envoy process. It is not a sidecar, a WASM plugin, an ext_proc server, or a separate proxy. Policy enforcement occurs directly within the network execution path configured through Envoy Gateway extension points. We define our policies using the RevetmentException custom resource.
Here is an example of an exception applied to a specific JSON body field on an API route:
apiVersion: revetment.io/v1alpha1
kind: RevetmentException
metadata:
name: allow-markdown-in-post-body
namespace: content-system
spec:
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: articles-api
ruleId: 941100
scope:
location: BodyJson
field: "content.article_text"
Parameter scoping prevents the exception from spreading across the rest of the application. In the manifest above, rule 941100 is disabled only for the content.article_text JSON field on the articles-api route. If an attacker attempts a Cross-Site Scripting attack in the author_id field or the slug query parameter on that same route, the engine inspects and blocks the request as usual.
When an attacker attempts an injection attack through an unshielded field, disabling a signature across the entire route leaves those remaining query parameters and request headers exposed. If you disable rule 942100 on an entire checkout route because the user_notes field contains SQL-like phrases, you leave the item_id and coupon_code parameters uninspected. For deeper guidance on structuring exception manifests, refer to our article on Envoy Gateway WAF exception management.
Step 4: re-promote the route and watch the rollback threshold
After applying a RevetmentException to your cluster, verify that the exception works under live production traffic without risking application availability. Do not switch an unverified policy directly from shadow mode to full blocking.
Blocking is promoted per route in many, many, then many steps, with an automatic rollback threshold that returns the route to shadow mode if rejected requests cross your error limit. This staged promotion allows the data plane to evaluate production traffic gradually. As traffic matches the route, Envoy samples the configured percentage for active blocking while evaluating the remainder in shadow mode. If the rate of 403 responses exceeds your defined failure threshold, the module automatically reverts the route to shadow mode.
Stage the rollout carefully. The progression proceeds through three distinct phases:
- Promote to many: Apply the policy change to many matching production requests. Verify that false positives on the excepted parameter drop immediately while monitoring standard response codes for valid user traffic.
- Promote to many: Increase sampling to many matching traffic. Monitor downstream application logs for payload parsing errors, and inspect shadow events to confirm other rules on the route evaluate traffic normally.
- Promote to many: Complete full enforcement across all matching traffic. At this stage, only confirmed malicious requests or un-excepted rule violations receive a 403 status code.
A common edge case during OWASP CRS false positive reduction is the unmasking effect. A single complex payload might violate multiple CRS signatures simultaneously. For instance, an input string containing rich formatting might trigger rule 941100 (Cross-Site Scripting) and rule 942100 (SQL Injection). When you add an exception for rule 941100, the engine stops matching on XSS, which then exposes the underlying SQL injection signature on the same field. If your route rolls back during promotion, check whether a secondary rule fired on the same parameter.
Managed feed rollout across a fleet, with automatic rollback, is planned for Q1 2027 on Pro. Per-route promotion with rollback is available today. You can read our detailed operational retrospective on staged deployment in our route promotion guide.
Troubleshooting Envoy Gateway WAF false positives that keep coming back
Some false positives resist standard tuning and recur across multiple deployments. If an alert repeatedly fires after you deployed an exception, use the following operational checks to diagnose the failure.
Check for shared upstream contracts and headers
If an identical rule fires across multiple independent routes, the trigger is likely located in a shared client library, tracking script, or API gateway header that injects uniform metadata into every outgoing call. For example, an internal service mesh proxy might inject custom tracking headers containing serialized metadata that trips rule 920270. Adding route-by-route exceptions creates configuration bloat. Instead, update the client SDK to serialize headers properly, or define an exception on the shared gateway policy that manages incoming traffic before route dispatch.
Verify compiled rule presence
Ensure that the rule you are debugging actually exists in the runtime engine. Our implementation compiles 477 PL1 rules from CRS v4.30.0. If your monitoring dashboard reports an alert for an excluded rule, that alert did not originate from Revetment. Review upstream cloud services, load balancers, or third-party container sidecars to identify which component generated the block event.
Differentiate client versions from rule defects
When false positives appear intermittently on the same endpoint, cross-reference the events against client user-agent strings and software versions. Legacy mobile clients or outdated API integrations often emit unescaped query strings or omit standard HTTP headers required by CRS protocol validation rules, such as rules 920100 through 920200. If only a legacy client triggers the rule, update the client software.
Audit Gateway API targetRef binding selectors
Test bindings with kubectl. If an exception manifest is applied but requests continue to be blocked, check the Kubernetes resource binding. The spec.targetRef within your RevetmentException must match the target HTTPRoute exactly, including its name and namespace. A typographical error in the resource name causes Kubernetes to accept the CRD while the gateway ignores the rule silently. Inspect the status subresource of your exception using kubectl:
kubectl get revetmentexception allow-markdown-in-post-body -n content-system -o yaml
Review the status.conditions block to confirm that the Envoy data plane accepted the reference and bound the policy to the active route filter chain.
What this workflow cannot do
Engineering teams must understand the architectural boundaries of our WAF and rule tuning workflow. Revetment matches known signatures. A genuinely novel exploit passes until a rule for it exists and reaches the deployment; no signature WAF can promise otherwise. Tuning your rule set reduces operational noise on known endpoints, but it does not replace secure application development practices.
Our software operates strictly at the application layer (L7). Revetment is an L7 WAF. It does not absorb DDoS traffic, filter network packets, protect DNS, or act as a scrubbing network; use an edge CDN or DDoS service for that. Revetment does not implement rate limiting, slowloris protection, HTTP/2 rapid-reset budgets, or concurrency limits. Volumetric traffic spikes and brute-force credential attacks must be mitigated by an upstream edge network, traffic scrubber, or specialized rate-limiting engine. Attempting to use OWASP CRS signatures to stop high-concurrency traffic floods will degrade proxy performance without resolving the attack.
Revetment is pre-GA. It runs in the operator's own production, but the site does not claim general availability or scale proof. We run the software across our own infrastructure, where all 18 policied routes have run in full blocking mode since 24 October 2026. You can review our public cluster configuration and verified run logs on our proof page.
The data plane inspects requests inside your Envoy process and sends no traffic to Revetment. The hosted console is optional. If your organization operates under strict compliance regimes, this architecture keeps raw request data inside your Kubernetes cluster. However, audit retention depends on your infrastructure design: the hosted console keeps 7 days on Free and 13 months on Pro. Self-hosted retention is yours to set. Determine your compliance and logging requirements before launching a broad WAF rule tuning initiative.
Frequently asked questions
How do I find which CRS rule blocked a request in Envoy Gateway?
Inspect the shadow mode event log or the access log emitted by the Envoy data plane. Each audit entry records the matching OWASP CRS rule ID, the target HTTPRoute, the matching parameter name, and a redacted payload excerpt. If your route runs in shadow mode, this record is generated without disrupting the client request.
Should I disable a CRS rule globally to stop a false positive?
No. Disabling a rule globally removes protection from every endpoint across your cluster. If you disable a SQL injection rule globally to accommodate a single search field, every other route becomes vulnerable to that injection pattern. Use a scoped RevetmentException to silence the rule solely for the specific field on the specific route where the false alarm occurs.
What is the difference between shadow mode and blocking in Revetment?
Shadow mode records what a rule would have blocked and lets the request through, allowing platform teams to identify false positives on live production traffic safely. Blocking actively rejects matching requests with an HTTP 403 status code. Blocking is promoted per route in many, many, then many steps, with an automatic rollback threshold.
Why does a false positive come back after I add an exception?
A recurring false positive typically occurs because a payload violated multiple CRS rules simultaneously. Scoping an exception for the first rule allows the request to pass that specific check, unmasking a secondary rule that matches the same parameter. Alternatively, verify that the targetRef in your RevetmentException manifest matches the target HTTPRoute name and namespace without typographical errors.
Does Revetment keep the request bodies it records in shadow mode?
The data plane inspects requests inside your Envoy process and sends no traffic to Revetment. When audit events are transmitted to our console, only redacted excerpts of the matched pattern are preserved to allow debugging while masking sensitive tokens and user credentials. The hosted console keeps 7 days on Free and 13 months on Pro. Self-hosted retention is yours to set.
If you are mid-tuning, read our exception management guide next for complete CRD field specifications, then check our cannot-stop list so you are not debugging a rule that never loaded. Pricing is per cluster, never per request, rule, route, or user. The Free, Pro, and Enterprise tiers are listed on our pricing page. The console is hosted or self-hosted. Accounts are operator-invited, not self-serve, and there is no free trial; the Free tier is a product tier.