Skip to main content

cloud_workload_security_agent_rules

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

Overview

Namecloud_workload_security_agent_rules
TypeResource
Iddatadog.security.cloud_workload_security_agent_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the Agent rule (example: 3dd-0uc-h1s)
attributesobjectA Cloud Workload Security Agent rule returned by the API
typestringThe type of the resource, must always be agent_rule (default: agent_rule, example: agent_rule)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_cloud_workload_security_agent_ruleselectagent_rule_id, regionGet the details of a specific agent rule.

Note: This endpoint should only be used for the Government (US1-FED) site.
list_cloud_workload_security_agent_rulesselectregionGet the list of agent rules.

Note: This endpoint should only be used for the Government (US1-FED) site.
create_cloud_workload_security_agent_ruleinsertregion, data__dataCreate a new agent rule with the given parameters.

Note: This endpoint should only be used for the Government (US1-FED) site.
update_cloud_workload_security_agent_ruleupdateagent_rule_id, region, data__dataUpdate a specific agent rule.
Returns the agent rule object when the request is successful.

Note: This endpoint should only be used for the Government (US1-FED) site.
delete_cloud_workload_security_agent_ruledeleteagent_rule_id, regionDelete a specific agent rule.

Note: This endpoint should only be used for the Government (US1-FED) site.
download_cloud_workload_policy_fileexecregionThe download endpoint generates a Workload Protection policy file from your currently active
Workload Protection agent rules, and downloads them as a .policy file. This file can then be deployed to
your agents to update the policy running in your environment.

Note: This endpoint should only be used for the Government (US1-FED) site.

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
agent_rule_idstringThe ID of the Agent rule (example: 3b5-v82-ns6)
regionstring(default: datadoghq.com)

SELECT examples

Get the details of a specific agent rule.

Note: This endpoint should only be used for the Government (US1-FED) site.

SELECT
id,
attributes,
type
FROM datadog.security.cloud_workload_security_agent_rules
WHERE agent_rule_id = '{{ agent_rule_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create a new agent rule with the given parameters.

Note: This endpoint should only be used for the Government (US1-FED) site.

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

UPDATE examples

Update a specific agent rule.
Returns the agent rule object when the request is successful.

Note: This endpoint should only be used for the Government (US1-FED) site.

UPDATE datadog.security.cloud_workload_security_agent_rules
SET
data__data = '{{ data }}'
WHERE
agent_rule_id = '{{ agent_rule_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a specific agent rule.

Note: This endpoint should only be used for the Government (US1-FED) site.

DELETE FROM datadog.security.cloud_workload_security_agent_rules
WHERE agent_rule_id = '{{ agent_rule_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

The download endpoint generates a Workload Protection policy file from your currently active
Workload Protection agent rules, and downloads them as a .policy file. This file can then be deployed to
your agents to update the policy running in your environment.

Note: This endpoint should only be used for the Government (US1-FED) site.

EXEC datadog.security.cloud_workload_security_agent_rules.download_cloud_workload_policy_file 
@region='{{ region }}' --required
;