Apply the site's firewall settings; turning it on needs URL Rewrite, ARR and a plan that includes it
Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication
/api/v1/tenants/{tid}/sites/{id}/wafApply the site's firewall settings; turning it on needs URL Rewrite, ARR and a plan that includes it
Authentication: session cookie __Host-panel_session (contract default; see Authentication).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tid | path | string | required | |
id | path | string | required | |
X-CSRF-Token | header | string | optional | Required on unsafe requests authenticated by session cookie; API keys do not use it. |
Request body
required
Content type: application/json
modestring requiredAllowed values:"off""detect""block"paranoiainteger required- minimum 1
- maximum 4
thresholdinteger requiredInbound anomaly score that blocks
- minimum 2
- maximum 100
presetsarray<string> requiredAllowed values:"wordpress""laravel""joomla""drupal"rule_idinteger requiredA request rule of the Core Rule Set, 911000-948999
pathstring optionalURL path prefix; empty = the whole site
targetstring optionalARGS:name, ARGS_NAMES:name, REQUEST_COOKIES:name or REQUEST_HEADERS:name; empty = the whole rule
notestring optional
allow_ipsarray<string> requiredfail_modestring requiredAllowed values:"open""closed"body_limit_kbinteger required- minimum 64
- maximum 1048576
over_limitstring requiredAllowed values:"partial""reject"static_bypassboolean optionalOff by default. On: IIS serves the site's existing static files (WAFStaticBypass.extensions) without the firewall, for GET/HEAD without a body, a plain query string and path (ADR 0106, D16). Refused when the plan forbids it (WAF_STATIC_NOT_IN_PLAN) or the site runs an application (WAF_STATIC_APPLICATION). Those requests are not inspected and never appear among the firewall's events.
Example
{
"mode": "off",
"paranoia": 1,
"threshold": 2,
"presets": [
"wordpress"
],
"exclusions": [
{
"rule_id": 0,
"path": "string",
"target": "string",
"note": "string"
}
],
"allow_ips": [
"string"
],
"fail_mode": "open",
"body_limit_kb": 64,
"over_limit": "partial",
"static_bypass": true
}Responses
200 Applied on the server
Content type: application/json
allowedboolean requiredreasonstring optionalwhy it is not allowed
Allowed values:"plan""application"activeboolean requiredIIS serves the files without the firewall now: the option is on, allowed, and the firewall is on
extensionsarray<string> required
Fields of WAFSettings are shown above.
allowedboolean requiredfalse when the account's plan leaves the firewall out
missingarray<string> requiredAllowed values:"url_rewrite""arr""inventory"crs_versionstring requiredpresetsarray<string> required
Example
{
"static_bypass": {
"allowed": true,
"reason": "plan",
"active": true,
"extensions": [
"string"
]
},
"settings": {
"mode": "off",
"paranoia": 1,
"threshold": 2,
"presets": [
"wordpress"
],
"exclusions": [
{
"rule_id": 0,
"path": "string",
"target": "string",
"note": "string"
}
],
"allow_ips": [
"string"
],
"fail_mode": "open",
"body_limit_kb": 64,
"over_limit": "partial",
"static_bypass": true
},
"allowed": true,
"missing": [
"url_rewrite"
],
"crs_version": "string",
"presets": [
"string"
]
}default Error
Content type: application/json
codestring requiredmessagestring requireddetails_redactedboolean requiredcorrelation_idstring requiredretryableboolean required