Chaitin WAF Configuration
Parameters
See plugin common configurations for configuration options available to all plugins.
-
mode—string· optional · default:blockValid values:
off,monitor, orblockMode to determine how the plugin behaves for matched requests.
In
offmode, WAF checks are skipped. Inmonitormode, requests with potential threats are logged but not blocked. Inblockmode, requests with threats are blocked as determined by the WAF service. -
match—array[object]· optionalAn array of matching rules. The plugin uses these rules to decide whether to perform a WAF check on a request. If the list is empty, all requests are processed.
-
vars—array[array]· optionalAn array of one or more matching conditions in the form of APISIX expressions to conditionally execute the plugin.
-
-
append_waf_resp_header—boolean· optional · default:trueIf true, add response headers
X-APISIX-CHAITIN-WAF,X-APISIX-CHAITIN-WAF-TIME,X-APISIX-CHAITIN-WAF-ACTION, andX-APISIX-CHAITIN-WAF-STATUS. -
append_waf_debug_header—boolean· optional · default:falseIf true, add debugging headers
X-APISIX-CHAITIN-WAF-ERRORandX-APISIX-CHAITIN-WAF-SERVERto the response. Effective only whenappend_waf_resp_headeristrue. -
config—object· optionalChaitin WAF service configurations. These settings override the corresponding metadata defaults when specified.
-
connect_timeout—integer· optional · default:1000The connection timeout to the WAF service, in milliseconds.
-
send_timeout—integer· optional · default:1000The sending timeout for transmitting data to the WAF service, in milliseconds.
-
read_timeout—integer· optional · default:1000The reading timeout for receiving data from the WAF service, in milliseconds.
-
req_body_size—integer· optional · default:1024The maximum allowed request body size, in KB.
-
keepalive_size—integer· optional · default:256The maximum number of idle connections to the WAF detection service that can be maintained concurrently.
-
keepalive_timeout—integer· optional · default:60000The idle connection timeout for the WAF service, in milliseconds.
-
real_client_ip—boolean· optional · default:trueIf true, use the client IP already resolved by the gateway, including any trusted-proxy or real-IP configuration. If false, use the direct peer address from the connection. The plugin does not read client-supplied forwarded headers directly.
-
log_resp—boolean· optionalIf true, report the response to the WAF detection service after it has been delivered to the client, in addition to the request. The report is advisory and never blocks or modifies the response. Available in API7 Enterprise from version 3.9.20.
-
resp_body_size—integer· optionalThe maximum amount of the response body to report, in KB. Set to
0to report only the response headers. Effective only whenlog_respis true. Available in API7 Enterprise from version 3.9.20. -
extra_ignored_content_types—string· optionalA comma-separated list of additional response content types to skip, on top of the built-in ignored list. A response whose content type matches is not reported to the WAF detection service at all, headers included. Effective only when
log_respis true. Available in API7 Enterprise from version 3.9.20.
-
Plugin Metadata
-
nodes—array[object]· requiredAn array of addresses for the Chaitin WAF service.
-
host—string· requiredAddress of Chaitin WAF service. Supports IPv4, IPv6, Unix Socket, etc.
-
port—integer· optional · default:80Port of Chaitin WAF service.
-
-
mode—string· optional · default:blockMode to determine how the plugin behaves for matched requests.
In
offmode, WAF checks are skipped. Inmonitormode, requests with potential threats are logged but not blocked. Inblockmode, requests with threats are blocked as determined by the WAF service. -
config—object· optionalChaitin WAF service configurations.
-
connect_timeout—integer· optional · default:1000The connection timeout to the WAF service, in milliseconds.
-
send_timeout—integer· optional · default:1000The sending timeout for transmitting data to the WAF service, in milliseconds.
-
read_timeout—integer· optional · default:1000The reading timeout for receiving data from the WAF service, in milliseconds.
-
req_body_size—integer· optional · default:1024The maximum allowed request body size, in KB.
-
keepalive_size—integer· optional · default:256The maximum number of idle connections to the WAF detection service that can be maintained concurrently.
-
keepalive_timeout—integer· optional · default:60000The idle connection timeout for the WAF service, in milliseconds.
-
real_client_ip—boolean· optional · default:trueIf true, use the client IP already resolved by the gateway, including any trusted-proxy or real-IP configuration. If false, use the direct peer address from the connection. The plugin does not read client-supplied forwarded headers directly.
-
log_resp—boolean· optional · default:falseIf true, report the response to the WAF detection service after it has been delivered to the client, in addition to the request. The report is advisory and never blocks or modifies the response. Available in API7 Enterprise from version 3.9.20.
-
resp_body_size—integer· optional · default:4The maximum amount of the response body to report, in KB. Set to
0to report only the response headers. Effective only whenlog_respis true. Available in API7 Enterprise from version 3.9.20. -
extra_ignored_content_types—string· optionalA comma-separated list of additional response content types to skip, on top of the built-in ignored list. A response whose content type matches is not reported to the WAF detection service at all, headers included. Effective only when
log_respis true. Available in API7 Enterprise from version 3.9.20.
-