By NHI Mgmt Group Editorial TeamBased on ngrok: “How we built ngrok's WAF with OWASP CRS and Coraza” (December 10, 2025)

TL;DR: OWASP CRS-based WAF actions moved from traffic-policy logic to shared runtime enforcement, and dry-run testing, rule exclusions, and body-size limits were needed to keep protection usable across hundreds of thousands of endpoints, according to ngrok. The practical lesson is that web application filtering succeeds only when detection, tuning, and observability are governed as one control plane, not separate steps.


At a glance

What this is: ngrok explains how it operationalised OWASP CRS-based WAF actions and found that scalable web filtering depends on shared enforcement, staged tuning, and visibility into false positives.

Why it matters: For security and identity practitioners, the key issue is not whether a WAF can block attacks, but whether its enforcement, tuning, and observability can be governed without breaking production traffic.


Context

A web application firewall is only effective when it can inspect HTTP content, apply consistent rules, and explain why traffic was blocked. At scale, that becomes a governance problem as much as a detection problem because false positives, body buffering, and rule coverage all affect service reliability.

ngrok’s article sits at the intersection of application security and operational control, with a smaller identity angle through request-path protection and attack filtering around exposed application surfaces. The practical question is whether WAF policy behaves like a tunable control plane or a brittle layer added after deployment.


Key questions

Q: What breaks when a WAF is moved straight into block mode?

A: Teams often discover that legitimate application traffic is blocked alongside malicious requests, especially when rulesets are broad and the application uses technical language, dynamic paths, or unusual payloads. A detect-first rollout lets security teams observe false positives before enforcement. The control fails when denial is treated as the first test instead of the last step in tuning.

Q: Why do WAF deployments need both rulesets and observability?

A: A ruleset can identify suspicious traffic, but observability explains why a request was blocked and whether the decision was correct. Without matched-rule IDs, anomaly scores, and denial metadata, teams cannot separate genuine attacks from application-specific false positives. That makes the WAF hard to tune and harder to operate safely at scale.

Q: What do teams get wrong about WAF deployments and rule tuning?

A: Teams often treat WAF as a static control and rely on bloated rule sets or broad blocking policies without enough operational context. The article points to common pitfalls such as false positives, production outage risk, poor log analysis, and gaps between security, engineering, and operations. Effective WAF use requires targeted rules, monitoring, and ongoing coordination.

Q: How should teams decide when to keep scanning request bodies?

A: Body scanning should be limited by measurable stability constraints, not by how much content security teams would like to inspect. If deeper scanning increases memory pressure, garbage collection, or crash risk, the inspection depth has to be reduced or targeted. The right decision balances attack coverage against the platform’s need to stay reliable under load.


Technical breakdown

How CRS rules turn HTTP inspection into blocking decisions

A WAF works by parsing HTTP requests and responses, then matching fields such as headers, query parameters, body content, and paths against rules. In this case, the OWASP Core Rule Set provides phrase matches, regexes, heuristics, and anomaly scoring rather than a simple allow-or-deny list. That matters because web attacks often hide inside syntactically valid requests, so the control must reason about application content, not just network metadata. ngrok’s design also shows why a rules engine needs a runtime that can evaluate those rules consistently across requests and responses.

Practical implication: Run WAF policy as a content-aware control, not as a simple network filter.

Why dry-run mode and rule exclusions are operationally necessary

Detection mode is the safest way to introduce a WAF because it lets teams see what would have been blocked before they enforce denial. The article shows this clearly: false positives appeared against documentation content and a download path, then specific rule IDs were excluded before block mode was re-enabled. That pattern is important because generic rulesets inevitably collide with legitimate application behaviour. A usable WAF therefore needs a feedback loop that distinguishes malicious requests from business traffic without forcing teams to rewrite the whole rule set.

Practical implication: Stage WAF rollout in detect-first mode and tune specific exclusions before enforcing blocks.

Why scale changes the memory and body-processing model

A WAF that works for a handful of endpoints can behave very differently when it is shared across hundreds of thousands of endpoints. The article highlights two constraints: compiled rule engines consume memory, and request bodies must be buffered before they can be scanned. Both pressures affect latency and stability, so the control plane has to balance detection depth against platform resilience. ngrok’s choice of a singleton engine per node and a conservative 4KB body-processing limit reflects a common scaling tradeoff in inline security controls.

Practical implication: Measure memory pressure and body-buffering costs before pushing WAF inspection deeper into production traffic.


Threat narrative

Attacker objective: The attacker’s goal is to smuggle exploit payloads through normal HTTP traffic and reach the upstream application or sensitive files before the WAF stops them.

  1. Entry begins when malicious payloads are embedded inside otherwise valid HTTP requests or responses that reach the application edge.
  2. Credential or file-oriented probes then use signatures and heuristics to trigger database-name, path, or sensitive-file patterns that indicate abuse.
  3. Impact occurs when the WAF blocks suspicious traffic before it reaches upstream services, reducing exposure to web application exploitation.
  • Imperva breach 2019: An AWS API key stolen from an exposed Imperva test instance let an attacker copy Cloud WAF customer data, including API keys and SSL certificates.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Inline WAF enforcement only works when detection, tuning, and observability are treated as one governance domain. The article shows that a WAF is not just a signature engine. It is an operational control that has to explain denials, absorb false positives, and support rollback without disrupting service. For practitioners, the control model fails if those functions are managed separately.

Rule tuning is not a temporary setup task, it is part of the control’s steady state. The move from dry-run to block mode, followed by rule exclusions for legitimate traffic, shows that broad CRS coverage creates value only when local exclusions are governed carefully. That is the real operating pattern for large-scale web filtering: use a common ruleset, then manage local exceptions as a formal change process. Practitioners should treat exclusions as controlled policy drift, not an afterthought.

Shared WAF infrastructure changes the economics of inline protection. The article’s singleton-per-node design shows that memory footprint, regex cost, and buffered bodies become architectural constraints once the same control protects many endpoints. This is a reminder that security controls are also workload controls, and platform stability must be designed into the security path. Practitioners need to size WAF enforcement for the platform they actually run, not the one they hoped to scan.

Web application filtering now depends on operational trust in the policy engine, not just trust in the ruleset. OWASP CRS gives the detection logic, but the decisive question is whether the implementation can surface why a request was denied, support safe rollback, and keep the body-processing limit conservative enough to avoid outages. That shifts the governance focus from static rule choice to runtime control quality. Practitioners should evaluate whether their WAF can be operated, not merely enabled.

What this signals

Inline WAF controls should be judged on whether they can be tuned without creating a separate operational burden for every endpoint. The moment a ruleset needs constant exception handling, body-size compromise, and manual rollback, the organisation is managing policy drift rather than security control.

WAF governance debt: the hidden cost of scalable filtering is the accumulation of exclusions, body limits, and operational workarounds that keep the control usable. Practitioners should treat that debt as a signal that policy design and runtime reality have drifted apart.


For practitioners

  • Start WAF rollout in dry-run mode Run new WAF actions in detection mode first, review deny logs for false positives, and only move to block mode after the application’s normal traffic patterns are understood.
  • Govern rule exclusions as formal change Track every excluded rule ID, document why it was excluded, and review whether the exclusion remains valid after application paths, documentation content, or payload formats change.
  • Measure the memory cost of inline inspection Profile compiled rule engines, request-body buffering, and per-node resource use before deploying WAF enforcement across large endpoint populations or multi-tenant platforms.
  • Expose denial reasons to operations teams Return matched-rule identifiers, anomaly scores, and clear block metadata to logs and alerting so on-call teams can distinguish attack traffic from false positives quickly.

Key takeaways

  • The article shows that a WAF becomes operationally useful only when rule evaluation, false-positive handling, and logging are governed together.
  • ngrok’s rollout demonstrates that large-scale filtering introduces hard limits around memory, buffered request bodies, and shared rule execution.
  • Practitioners should treat WAF tuning as a lifecycle discipline, not a one-time deployment step.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 and MITRE ATT&CK address the attack and risk surface, while OWASP ASVS and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API8 — Security MisconfigurationThe post focuses on WAF policy, request filtering, and operational tuning at the edge.
Recommendation — Harden WAF and API gateway configurations so runtime controls block malicious traffic without breaking legitimate requests.
OWASP ASVSV16 — Security Logging and Error HandlingThe article emphasizes deny logs, matched-rule metadata, and clear blocking explanations.
Recommendation — Verify that blocked requests generate actionable security logs and consistent error handling.
NIST CSF 2.0PR.DS-10 — Data in Transit is ProtectedInline traffic inspection and TLS termination shape how web traffic is protected in motion.
Recommendation — Protect traffic in transit with inline inspection that preserves confidentiality and operational visibility.
MITRE ATT&CKTA0007;TA0009 — Discovery; CollectionThe article describes attack payloads probing paths and content to reach sensitive files and application data.
Recommendation — Map blocked probes to discovery and collection techniques and refine detection for sensitive-file access attempts.

Key terms

  • Web Application Firewall: A web application firewall inspects HTTP traffic and applies rules to detect or block malicious requests and responses. Unlike a network firewall, it understands application-layer content such as headers, parameters, and body fields, which lets it catch attacks like injection and path probing.
  • Anomaly Scoring: Anomaly scoring is a detection method that assigns points to rule matches instead of making a single yes-or-no decision. It helps a WAF tolerate noisy traffic by combining multiple weak signals into one block decision, which is useful when individual signatures are not decisive on their own.
  • False Positive: A false positive is a scanner result that looks like a secret but is not actually sensitive. In secret governance, false positives matter because they consume analyst time, weaken trust in alerts, and can delay response to the findings that truly change exposure and access risk.
  • Dry-Run Mode: Dry-run mode allows a security control to evaluate traffic and produce logs without actively denying requests. It is used to measure false positives, validate rule behaviour, and tune enforcement safely before switching the same control into blocking mode.

Deepen your knowledge

NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course. Explore the NHI Foundation Level course, the industry's only accredited NHI security programme, to strengthen how your programme governs access, secrets, and non-human identity lifecycle decisions.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org