Skip to main content

overrides

Creates, updates, deletes, gets or lists an overrides resource.

Overview

Nameoverrides
TypeResource
Idcloudflare.firewall.overrides

Fields

The following fields are returned by SELECT queries:

Get a WAF override response

NameDatatypeDescription
idstringThe unique identifier of the WAF override. (example: de677e5818985db1285d0e80225f06e5)
descriptionstringAn informative summary of the current URI-based WAF override. (example: Enable Cloudflare Magento ruleset for shop.example.com)
groupsobjectAn object that allows you to enable or disable WAF rule groups for the current WAF override. Each key of this object must be the ID of a WAF rule group, and each value must be a valid WAF action (usually default or disable). When creating a new URI-based WAF override, you must provide a groups object or a rules object.
pausedbooleanWhen true, indicates that the rule is currently paused.
prioritynumberThe relative priority of the current URI-based WAF override when multiple overrides match a single URL. A lower number indicates higher priority. Higher priority overrides may overwrite values set by lower priority overrides.
rewrite_actionobjectSpecifies that, when a WAF rule matches, its configured action will be replaced by the action configured in this object.
rulesobjectAn object that allows you to override the action of specific WAF rules. Each key of this object must be the ID of a WAF rule, and each value must be a valid WAF action. Unless you are disabling a rule, ensure that you also enable the rule group that this WAF rule belongs to. When creating a new URI-based WAF override, you must provide a groups object or a rules object.
urlsarrayThe URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectoverrides_id, zone_idFetches the details of a URI-based WAF override. Note: Applies only to the previous version of WAF managed rules.
listselectzone_idpage, per_pageFetches the URI-based WAF overrides in a zone. Note: Applies only to the previous version of WAF managed rules.
createinsertzone_id, urlsCreates a URI-based WAF override for a zone. Note: Applies only to the previous version of WAF managed rules.
updatereplaceoverrides_id, zone_id, id, urls, rules, rewrite_actionUpdates an existing URI-based WAF override. Note: Applies only to the previous version of WAF managed rules.
deletedeleteoverrides_id, zone_idDeletes an existing URI-based WAF override. Note: Applies only to the previous version of WAF managed rules.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
overrides_idstring
zone_idstringThe Cloudflare zone ID.
pagenumber
per_pagenumber

SELECT examples

Fetches the details of a URI-based WAF override. Note: Applies only to the previous version of WAF managed rules.

SELECT
id,
description,
groups,
paused,
priority,
rewrite_action,
rules,
urls
FROM cloudflare.firewall.overrides
WHERE overrides_id = '{{ overrides_id }}' -- required
AND zone_id = '{{ zone_id }}' -- required
;

INSERT examples

Creates a URI-based WAF override for a zone. Note: Applies only to the previous version of WAF managed rules.

INSERT INTO cloudflare.firewall.overrides (
urls,
zone_id
)
SELECT
'{{ urls }}' /* required */,
'{{ zone_id }}'
RETURNING
errors,
messages,
result,
success
;

REPLACE examples

Updates an existing URI-based WAF override. Note: Applies only to the previous version of WAF managed rules.

REPLACE cloudflare.firewall.overrides
SET
id = '{{ id }}',
rewrite_action = '{{ rewrite_action }}',
rules = '{{ rules }}',
urls = '{{ urls }}'
WHERE
overrides_id = '{{ overrides_id }}' --required
AND zone_id = '{{ zone_id }}' --required
AND id = '{{ id }}' --required
AND urls = '{{ urls }}' --required
AND rules = '{{ rules }}' --required
AND rewrite_action = '{{ rewrite_action }}' --required
RETURNING
errors,
messages,
result,
success;

DELETE examples

Deletes an existing URI-based WAF override. Note: Applies only to the previous version of WAF managed rules.

DELETE FROM cloudflare.firewall.overrides
WHERE overrides_id = '{{ overrides_id }}' --required
AND zone_id = '{{ zone_id }}' --required
;