Skip to main content

waf_custom_rules

Creates, updates, deletes, gets or lists a waf_custom_rules resource.

Overview

Namewaf_custom_rules
TypeResource
Iddatadog.remote_config.waf_custom_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the custom rule. (example: 2857c47d-1e3a-4300-8b2f-dc24089c084b)
attributesobjectA WAF custom rule.
typestringThe type of the resource. The value should always be custom_rule. (custom_rule) (default: custom_rule, example: custom_rule)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_application_security_waf_custom_ruleselectcustom_rule_idRetrieve a WAF custom rule by ID.
list_application_security_wafcustom_rulesselectRetrieve a list of WAF custom rule.
create_application_security_waf_custom_ruleinsertdataCreate a new WAF custom rule with the given parameters.
update_application_security_waf_custom_rulereplacecustom_rule_id, dataUpdate a specific WAF custom Rule.<br />Returns the Custom Rule object when the request is successful.
delete_application_security_waf_custom_ruledeletecustom_rule_idDelete a specific WAF custom rule.

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
custom_rule_idstringThe ID of the custom rule. (example: 3b5-v82-ns6)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Retrieve a WAF custom rule by ID.

SELECT
id,
attributes,
type
FROM datadog.remote_config.waf_custom_rules
WHERE custom_rule_id = '{{ custom_rule_id }}' -- required
;

INSERT examples

Create a new WAF custom rule with the given parameters.

INSERT INTO datadog.remote_config.waf_custom_rules (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

REPLACE examples

Update a specific WAF custom Rule.<br />Returns the Custom Rule object when the request is successful.

REPLACE datadog.remote_config.waf_custom_rules
SET
data = '{{ data }}'
WHERE
custom_rule_id = '{{ custom_rule_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a specific WAF custom rule.

DELETE FROM datadog.remote_config.waf_custom_rules
WHERE custom_rule_id = '{{ custom_rule_id }}' --required
;