Sha256: f58956a76a6026cd891ff3109c6b7dea341d06f78596d0823c959ce529eced22

Contents?: true

Size: 721 Bytes

Versions: 7

Compression:

Stored size: 721 Bytes

Contents

# Create a CSM Threats 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: "My Agent rule",
      enabled: true,
      expression: 'exec.file.name == "sh"',
      filters: [
        'os == "linux"',
      ],
      name: "examplecsmthreat",
    }),
    type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
  }),
})
p api_instance.create_csm_threats_agent_rule(body)

Version data entries

7 entries across 7 versions & 1 rubygems

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