Skip to main content

csm_threats_agent_policies

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

Overview

Namecsm_threats_agent_policies
TypeResource
Iddatadog.remote_config.csm_threats_agent_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the Agent policy (example: 6517fcc1-cec7-4394-a655-8d6e9d085255)
attributesobjectA Cloud Workload Security Agent policy returned by the API
typestringThe type of the resource, must always be policy (default: policy, example: policy)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_csmthreats_agent_policyselectpolicy_id, regionGet the details of a specific Workload Protection policy.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
list_csmthreats_agent_policiesselectregionGet the list of Workload Protection policies.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
create_csmthreats_agent_policyinsertregion, data__dataCreate a new Workload Protection policy with the given parameters.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
update_csmthreats_agent_policyupdatepolicy_id, region, data__dataUpdate a specific Workload Protection policy.
Returns the policy object when the request is successful.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
delete_csmthreats_agent_policydeletepolicy_id, regionDelete a specific Workload Protection policy.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.
download_csmthreats_policyexecregionThe 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 is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.

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
policy_idstringThe ID of the Agent policy (example: 6517fcc1-cec7-4394-a655-8d6e9d085255)
regionstring(default: datadoghq.com)

SELECT examples

Get the details of a specific Workload Protection policy.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.

SELECT
id,
attributes,
type
FROM datadog.remote_config.csm_threats_agent_policies
WHERE policy_id = '{{ policy_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create a new Workload Protection policy with the given parameters.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.

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

UPDATE examples

Update a specific Workload Protection policy.
Returns the policy object when the request is successful.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.

UPDATE datadog.remote_config.csm_threats_agent_policies
SET
data__data = '{{ data }}'
WHERE
policy_id = '{{ policy_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a specific Workload Protection policy.

Note: This endpoint is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.

DELETE FROM datadog.remote_config.csm_threats_agent_policies
WHERE policy_id = '{{ policy_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 is not available for the Government (US1-FED) site. Please reference the (US1-FED) specific resource below.

EXEC datadog.remote_config.csm_threats_agent_policies.download_csmthreats_policy 
@region='{{ region }}' --required
;