Skip to main content

static_analysis_custom_rulesets

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

Overview

Namestatic_analysis_custom_rulesets
TypeResource
Iddatadog.security.static_analysis_custom_rulesets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringRuleset identifier (example: my-ruleset)
attributesobjectAttributes of a custom ruleset, including its name, description, and rules.
typestringResource type (custom_ruleset) (example: custom_ruleset)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_custom_rulesetselectruleset_nameGet a custom ruleset by name
list_custom_rulesetsselectGet all custom rulesets for the authenticated organization.
update_custom_rulesetupdateruleset_nameUpdate an existing custom ruleset
create_custom_rulesetreplaceCreate a new custom ruleset for the authenticated organization.
delete_custom_rulesetdeleteruleset_nameDelete a custom ruleset

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
ruleset_namestringThe ruleset name
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

Get a custom ruleset by name

SELECT
id,
attributes,
type
FROM datadog.security.static_analysis_custom_rulesets
WHERE ruleset_name = '{{ ruleset_name }}' -- required
;

UPDATE examples

Update an existing custom ruleset

UPDATE datadog.security.static_analysis_custom_rulesets
SET
data = '{{ data }}'
WHERE
ruleset_name = '{{ ruleset_name }}' --required
RETURNING
data;

REPLACE examples

Create a new custom ruleset for the authenticated organization.

REPLACE datadog.security.static_analysis_custom_rulesets
SET
data = '{{ data }}'
WHERE
RETURNING
data;

DELETE examples

Delete a custom ruleset

DELETE FROM datadog.security.static_analysis_custom_rulesets
WHERE ruleset_name = '{{ ruleset_name }}' --required
;