Skip to main content

Version: 3.9.x

Web Application Firewall (WAF)

A Web Application Firewall (WAF) helps inspect API traffic for common web attacks before requests reach your upstream services. In API7 Gateway, WAF is best treated as one layer in a defense-in-depth model alongside authentication, authorization, rate limiting, logging, and secure credential management.

WAF protects published API traffic on the data plane. It is different from platform security controls such as Control Plane IP restrictions, audit logs, and credential storage hardening.

When to use WAF

WAF is most useful when you need to protect HTTP APIs that are exposed to untrusted clients, especially for:

  • Public or partner-facing APIs on the internet.
  • Applications that handle sensitive customer or business data.
  • Environments that need protection against common attack classes such as SQL injection, cross-site scripting (XSS), and malicious payload probing.
  • Teams that want a dedicated security layer in front of upstream services without pushing all filtering logic into application code.

What WAF does and does not do

A WAF complements API gateway controls, but it does not replace them.

ControlPrimary purpose
WAFInspect requests for malicious patterns and block or monitor suspicious traffic.
AuthenticationVerify who the client is.
ACLs and permission policiesDecide which authenticated clients are allowed to access which APIs.
Rate limitingProtect services from abuse, bursts, and excessive request volume.
Data maskingPrevent sensitive request data from being exposed in logs.

Use WAF when the problem is threat inspection. Use auth, ACLs, and rate limiting when the problem is identity, authorization, or abuse control.

WAF in API7 Gateway today

API7 Gateway provides a direct WAF integration path through the chaitin-waf plugin for Chaitin WAF (SafeLine).

With this model:

  • API7 Gateway forwards matching requests to the WAF service for inspection.
  • The WAF service decides whether the request should pass or be rejected.
  • You can run in monitor mode first to observe detections before switching to block mode.
  • Shared WAF connection settings are configured through plugin metadata, while enforcement is enabled where you attach the plugin.

This lets you add WAF protection at the gateway layer without changing upstream applications.

API7 Gateway runtime also supports generic wasm plugins. This allows WASM-based WAF integrations, such as Coraza through coraza-proxy-wasm, for advanced deployments.

This approach is different from chaitin-waf:

  • You load the WASM module in gateway runtime configuration.
  • You attach the resulting plugin to routes, services, or other supported scopes like other gateway plugins.
  • You manage the WAF module artifact and its configuration yourself.

Coraza can be integrated through the Gateway's WASM extension mechanism, but it is not documented in the current docs set in the same way as chaitin-waf.

  1. Start with internet-facing routes and high-value APIs.
  2. Use monitor mode first to understand what the WAF flags in real traffic.
  3. Review detections with your application and security teams to tune rules and reduce false positives.
  4. Move selected APIs to block mode once the policy is understood.
  5. Keep WAF alongside authentication, ACLs, and rate limiting rather than using it as a standalone security control.

Implementation guidance

Use the path that matches your deployment model:

If you are preparing a production rollout, include WAF in the broader security review for your deployment rather than treating it as an isolated feature.

Next Steps

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation