Skip to main content

scanning_rules

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

Overview

Namescanning_rules
TypeResource
Iddatadog.security.scanning_rules

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
create_scanning_ruleinsertregion, data__data, data__metaCreate a scanning rule in a sensitive data scanner group, ordered last.
The posted rule MUST include a group relationship.
It MUST include either a standard_pattern relationship or a regex attribute, but not both.
If included_attributes is empty or missing, we will scan all attributes except
excluded_attributes. If both are missing, we will scan the whole event.
update_scanning_ruleupdaterule_id, region, data__data, data__metaUpdate a scanning rule.
The request body MUST NOT include a standard_pattern relationship, as that relationship
is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern
relationship will also result in an error.
delete_scanning_ruledeleterule_id, regionDelete a given 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
regionstring(default: datadoghq.com)
rule_idstringThe ID of the rule.

INSERT examples

Create a scanning rule in a sensitive data scanner group, ordered last.
The posted rule MUST include a group relationship.
It MUST include either a standard_pattern relationship or a regex attribute, but not both.
If included_attributes is empty or missing, we will scan all attributes except
excluded_attributes. If both are missing, we will scan the whole event.

INSERT INTO datadog.security.scanning_rules (
data__data,
data__meta,
region
)
SELECT
'{{ data }}' /* required */,
'{{ meta }}' /* required */,
'{{ region }}'
RETURNING
data,
meta
;

UPDATE examples

Update a scanning rule.
The request body MUST NOT include a standard_pattern relationship, as that relationship
is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern
relationship will also result in an error.

UPDATE datadog.security.scanning_rules
SET
data__data = '{{ data }}',
data__meta = '{{ meta }}'
WHERE
rule_id = '{{ rule_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
AND data__meta = '{{ meta }}' --required
RETURNING
meta;

DELETE examples

Delete a given rule.

DELETE FROM datadog.security.scanning_rules
WHERE rule_id = '{{ rule_id }}' --required
AND region = '{{ region }}' --required
;