waf_policies
Creates, updates, deletes, gets or lists a waf_policies resource.
Overview
| Name | waf_policies |
| Type | Resource |
| Id | datadog.remote_config.waf_policies |
Fields
The following fields are returned by SELECT queries:
- get_application_security_waf_policy
- list_application_security_wafpolicies
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the policy. (example: 2857c47d-1e3a-4300-8b2f-dc24089c084b) |
attributes | object | A WAF policy. |
meta | object | Metadata associated with the WAF policy. |
type | string | The type of the resource. The value should always be policy. (policy) (default: policy, example: policy) |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the policy. (example: 2857c47d-1e3a-4300-8b2f-dc24089c084b) |
attributes | object | A WAF policy. |
meta | object | Metadata associated with the WAF policy. |
type | string | The type of the resource. The value should always be policy. (policy) (default: policy, example: policy) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_application_security_waf_policy | select | policy_id | Retrieve a WAF policy by ID. | |
list_application_security_wafpolicies | select | Retrieve a list of WAF policies. | ||
create_application_security_waf_policy | insert | data | Create a new WAF policy. | |
update_application_security_waf_policy | replace | policy_id, data | Update a specific WAF policy.<br />Returns the policy object when the request is successful. | |
delete_application_security_waf_policy | delete | policy_id | Delete a specific WAF policy. |
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 |
|---|---|---|
policy_id | string | The ID of the policy. (example: recommended) |
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_policy
- list_application_security_wafpolicies
Retrieve a WAF policy by ID.
SELECT
id,
attributes,
meta,
type
FROM datadog.remote_config.waf_policies
WHERE policy_id = '{{ policy_id }}' -- required
;
Retrieve a list of WAF policies.
SELECT
id,
attributes,
meta,
type
FROM datadog.remote_config.waf_policies
;
INSERT examples
- create_application_security_waf_policy
- Manifest
Create a new WAF policy.
INSERT INTO datadog.remote_config.waf_policies (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: waf_policies
props:
- name: data
description: |
Object for a single WAF policy.
value:
attributes:
basedOn: "{{ basedOn }}"
description: "{{ description }}"
isDefault: {{ isDefault }}
name: "{{ name }}"
protectionPresets:
- "{{ protectionPresets }}"
rules:
- blocking: {{ blocking }}
enabled: {{ enabled }}
extended_data_collection: {{ extended_data_collection }}
id: "{{ id }}"
rulesets:
- blocking: {{ blocking }}
enabled: {{ enabled }}
id: "{{ id }}"
scope:
- env: "{{ env }}"
service: "{{ service }}"
version: {{ version }}
type: "{{ type }}"
REPLACE examples
- update_application_security_waf_policy
Update a specific WAF policy.<br />Returns the policy object when the request is successful.
REPLACE datadog.remote_config.waf_policies
SET
data = '{{ data }}'
WHERE
policy_id = '{{ policy_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_application_security_waf_policy
Delete a specific WAF policy.
DELETE FROM datadog.remote_config.waf_policies
WHERE policy_id = '{{ policy_id }}' --required
;