waf_custom_rules
Creates, updates, deletes, gets or lists a waf_custom_rules resource.
Overview
| Name | waf_custom_rules |
| Type | Resource |
| Id | datadog.remote_config.waf_custom_rules |
Fields
The following fields are returned by SELECT queries:
- get_application_security_waf_custom_rule
- list_application_security_wafcustom_rules
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the custom rule. (example: 2857c47d-1e3a-4300-8b2f-dc24089c084b) |
attributes | object | A WAF custom rule. |
type | string | The type of the resource. The value should always be custom_rule. (custom_rule) (default: custom_rule, example: custom_rule) |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the custom rule. (example: 2857c47d-1e3a-4300-8b2f-dc24089c084b) |
attributes | object | A WAF custom rule. |
type | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_application_security_waf_custom_rule | select | custom_rule_id | Retrieve a WAF custom rule by ID. | |
list_application_security_wafcustom_rules | select | Retrieve a list of WAF custom rule. | ||
create_application_security_waf_custom_rule | insert | data | Create a new WAF custom rule with the given parameters. | |
update_application_security_waf_custom_rule | replace | custom_rule_id, data | Update a specific WAF custom Rule.<br />Returns the Custom Rule object when the request is successful. | |
delete_application_security_waf_custom_rule | delete | custom_rule_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
custom_rule_id | string | The ID of the custom rule. (example: 3b5-v82-ns6) |
site | string | The 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
- get_application_security_waf_custom_rule
- list_application_security_wafcustom_rules
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
;
Retrieve a list of WAF custom rule.
SELECT
id,
attributes,
type
FROM datadog.remote_config.waf_custom_rules
;
INSERT examples
- create_application_security_waf_custom_rule
- Manifest
Create a new WAF custom rule with the given parameters.
INSERT INTO datadog.remote_config.waf_custom_rules (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: waf_custom_rules
props:
- name: data
description: |
Object for a single WAF custom rule.
value:
attributes:
action:
action: "{{ action }}"
parameters:
location: "{{ location }}"
status_code: {{ status_code }}
blocking: {{ blocking }}
conditions:
- operator: "{{ operator }}"
parameters:
data: "{{ data }}"
inputs:
- address: "{{ address }}"
key_path: "{{ key_path }}"
list:
- "{{ list }}"
options:
case_sensitive: {{ case_sensitive }}
min_length: {{ min_length }}
regex: "{{ regex }}"
type: "{{ type }}"
value: "{{ value }}"
enabled: {{ enabled }}
name: "{{ name }}"
path_glob: "{{ path_glob }}"
scope:
- env: "{{ env }}"
service: "{{ service }}"
tags:
category: "{{ category }}"
type: "{{ type }}"
type: "{{ type }}"
REPLACE examples
- update_application_security_waf_custom_rule
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_application_security_waf_custom_rule
Delete a specific WAF custom rule.
DELETE FROM datadog.remote_config.waf_custom_rules
WHERE custom_rule_id = '{{ custom_rule_id }}' --required
;