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_ruleinsertdata, metaCreate a scanning rule in a sensitive data scanner group, ordered last.<br />The posted rule MUST include a group relationship.<br />It MUST include either a standard_pattern relationship or a regex attribute, but not both.<br />If included_attributes is empty or missing, we will scan all attributes except<br />excluded_attributes. If both are missing, we will scan the whole event.
update_scanning_ruleupdaterule_id, data, metaUpdate a scanning rule.<br />The request body MUST NOT include a standard_pattern relationship, as that relationship<br />is non-editable. Trying to edit the regex attribute of a rule with a standard_pattern<br />relationship will also result in an error.
delete_scanning_ruledeleterule_idDelete 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
rule_idstringThe ID of the rule.
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.

INSERT examples

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

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

UPDATE examples

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

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

DELETE examples

Delete a given rule.

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