Sha256: edc7ca73d6b718f9baa09c00a28b0493276a5d44524c9f87875f935ec00b3f86

Contents?: true

Size: 696 Bytes

Versions: 6

Compression:

Stored size: 696 Bytes

Contents

# Create a Cloud Workload Security Agent rule returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::CSMThreatsAPI.new

body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateRequest.new({
  data: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateData.new({
    attributes: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleCreateAttributes.new({
      description: "Test Agent rule",
      enabled: true,
      expression: 'exec.file.name == "sh"',
      name: "examplecsmthreat",
    }),
    type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
  }),
})
p api_instance.create_cloud_workload_security_agent_rule(body)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.27.1 examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.26.1 examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.26.0 examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.25.0 examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.rb
datadog_api_client-2.24.0 examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.rb