Sha256: bcc601d32450d15299d378e86c500d08b83d094d0a88058d915042226676aaad

Contents?: true

Size: 785 Bytes

Versions: 7

Compression:

Stored size: 785 Bytes

Contents

# Update a CSM Threats Agent rule returns "OK" response

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

# there is a valid "agent_rule_rc" in the system
AGENT_RULE_DATA_ID = ENV["AGENT_RULE_DATA_ID"]

body = DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateRequest.new({
  data: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateData.new({
    attributes: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleUpdateAttributes.new({
      description: "Test Agent rule",
      enabled: true,
      expression: 'exec.file.name == "sh"',
    }),
    type: DatadogAPIClient::V2::CloudWorkloadSecurityAgentRuleType::AGENT_RULE,
    id: AGENT_RULE_DATA_ID,
  }),
})
p api_instance.update_csm_threats_agent_rule(AGENT_RULE_DATA_ID, body)

Version data entries

7 entries across 7 versions & 1 rubygems

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