Sha256: 8233d4055cdbebe2c8e4291db4fad31ac33325d8d3cbbbe64575155a317405a5

Contents?: true

Size: 846 Bytes

Versions: 6

Compression:

Stored size: 846 Bytes

Contents

# Create a suppression rule returns "OK" response

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

body = DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateRequest.new({
  data: DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateData.new({
    attributes: DatadogAPIClient::V2::SecurityMonitoringSuppressionCreateAttributes.new({
      description: "This rule suppresses low-severity signals in staging environments.",
      enabled: true,
      expiration_date: 1638443471000,
      name: "Example-Security-Monitoring",
      rule_query: "type:log_detection source:cloudtrail",
      suppression_query: "env:staging status:low",
    }),
    type: DatadogAPIClient::V2::SecurityMonitoringSuppressionType::SUPPRESSIONS,
  }),
})
p api_instance.create_security_monitoring_suppression(body)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb
datadog_api_client-2.27.1 examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb
datadog_api_client-2.26.1 examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb
datadog_api_client-2.26.0 examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb
datadog_api_client-2.25.0 examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb
datadog_api_client-2.24.0 examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.rb