WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 109dc85

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 16dee31 of spec repo
1 parent 2378b7a commit 109dc85

File tree

4 files changed

+84
-1
lines changed

4 files changed

+84
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47194,6 +47194,8 @@ components:
4719447194
properties:
4719547195
forgetAfter:
4719647196
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsForgetAfter'
47197+
instantaneousBaseline:
47198+
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsInstantaneousBaseline'
4719747199
learningDuration:
4719847200
$ref: '#/components/schemas/SecurityMonitoringRuleNewValueOptionsLearningDuration'
4719947201
learningMethod:
@@ -47219,6 +47221,15 @@ components:
4721947221
- TWO_WEEKS
4722047222
- THREE_WEEKS
4722147223
- FOUR_WEEKS
47224+
SecurityMonitoringRuleNewValueOptionsInstantaneousBaseline:
47225+
description: 'If true, every time Datadog learns a new group-by value, it takes
47226+
old matching values within the learning window and builds the baseline with
47227+
it.
47228+
47229+
Therefore, it attempts to build the baseline swiftly using existing values
47230+
instead of learning them over time.'
47231+
example: false
47232+
type: boolean
4722247233
SecurityMonitoringRuleNewValueOptionsLearningDuration:
4722347234
default: 0
4722447235
description: 'The duration in days during which values are learned, and after
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Validate a detection rule with detection method 'new_value' with enabled feature 'instantaneousBaseline' returns "OK"
2+
response
3+
4+
require "datadog_api_client"
5+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
6+
7+
body = DatadogAPIClient::V2::SecurityMonitoringStandardRulePayload.new({
8+
cases: [
9+
DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
10+
name: "",
11+
status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
12+
notifications: [],
13+
}),
14+
],
15+
has_extended_title: true,
16+
is_enabled: true,
17+
message: "My security monitoring rule",
18+
name: "My security monitoring rule",
19+
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
20+
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::ZERO_MINUTES,
21+
keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::FIVE_MINUTES,
22+
max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::TEN_MINUTES,
23+
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::NEW_VALUE,
24+
new_value_options: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptions.new({
25+
forget_after: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsForgetAfter::ONE_WEEK,
26+
instantaneous_baseline: true,
27+
learning_duration: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningDuration::ONE_DAY,
28+
learning_threshold: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningThreshold::ZERO_OCCURRENCES,
29+
learning_method: DatadogAPIClient::V2::SecurityMonitoringRuleNewValueOptionsLearningMethod::DURATION,
30+
}),
31+
}),
32+
queries: [
33+
DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
34+
query: "source:source_here",
35+
group_by_fields: [
36+
"@userIdentity.assumed_role",
37+
],
38+
distinct_fields: [],
39+
metric: "name",
40+
metrics: [
41+
"name",
42+
],
43+
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::NEW_VALUE,
44+
name: "",
45+
data_source: DatadogAPIClient::V2::SecurityMonitoringStandardDataSource::LOGS,
46+
}),
47+
],
48+
tags: [
49+
"env:prod",
50+
"team:security",
51+
],
52+
type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::LOG_DETECTION,
53+
})
54+
api_instance.validate_security_monitoring_rule(body)

features/v2/security_monitoring.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,6 +1797,13 @@ Feature: Security Monitoring
17971797
When the request is sent
17981798
Then the response status is 204 OK
17991799

1800+
@team:DataDog/k9-cloud-security-platform
1801+
Scenario: Validate a detection rule with detection method 'new_value' with enabled feature 'instantaneousBaseline' returns "OK" response
1802+
Given new "ValidateSecurityMonitoringRule" request
1803+
And body with value {"cases":[{"name":"","status":"info","notifications":[]}],"hasExtendedTitle":true,"isEnabled":true,"message":"My security monitoring rule","name":"My security monitoring rule","options":{"evaluationWindow":0,"keepAlive":300,"maxSignalDuration":600,"detectionMethod":"new_value","newValueOptions":{"forgetAfter":7,"instantaneousBaseline":true,"learningDuration":1,"learningThreshold":0,"learningMethod":"duration"}},"queries":[{"query":"source:source_here","groupByFields":["@userIdentity.assumed_role"],"distinctFields":[],"metric":"name","metrics":["name"],"aggregation":"new_value","name":"","dataSource":"logs"}],"tags":["env:prod","team:security"],"type":"log_detection"}
1804+
When the request is sent
1805+
Then the response status is 204 OK
1806+
18001807
@team:DataDog/k9-cloud-security-platform
18011808
Scenario: Validate a detection rule with detection method 'sequence_detection' returns "OK" response
18021809
Given new "ValidateSecurityMonitoringRule" request

lib/datadog_api_client/v2/models/security_monitoring_rule_new_value_options.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class SecurityMonitoringRuleNewValueOptions
2424
# The duration in days after which a learned value is forgotten.
2525
attr_accessor :forget_after
2626

27+
# If true, every time Datadog learns a new group-by value, it takes old matching values within the learning window and builds the baseline with it.
28+
# Therefore, it attempts to build the baseline swiftly using existing values instead of learning them over time.
29+
attr_accessor :instantaneous_baseline
30+
2731
# The duration in days during which values are learned, and after which signals will be generated for values that
2832
# weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.
2933
attr_accessor :learning_duration
@@ -41,6 +45,7 @@ class SecurityMonitoringRuleNewValueOptions
4145
def self.attribute_map
4246
{
4347
:'forget_after' => :'forgetAfter',
48+
:'instantaneous_baseline' => :'instantaneousBaseline',
4449
:'learning_duration' => :'learningDuration',
4550
:'learning_method' => :'learningMethod',
4651
:'learning_threshold' => :'learningThreshold'
@@ -52,6 +57,7 @@ def self.attribute_map
5257
def self.openapi_types
5358
{
5459
:'forget_after' => :'SecurityMonitoringRuleNewValueOptionsForgetAfter',
60+
:'instantaneous_baseline' => :'Boolean',
5561
:'learning_duration' => :'SecurityMonitoringRuleNewValueOptionsLearningDuration',
5662
:'learning_method' => :'SecurityMonitoringRuleNewValueOptionsLearningMethod',
5763
:'learning_threshold' => :'SecurityMonitoringRuleNewValueOptionsLearningThreshold'
@@ -80,6 +86,10 @@ def initialize(attributes = {})
8086
self.forget_after = attributes[:'forget_after']
8187
end
8288

89+
if attributes.key?(:'instantaneous_baseline')
90+
self.instantaneous_baseline = attributes[:'instantaneous_baseline']
91+
end
92+
8393
if attributes.key?(:'learning_duration')
8494
self.learning_duration = attributes[:'learning_duration']
8595
end
@@ -120,6 +130,7 @@ def ==(o)
120130
return true if self.equal?(o)
121131
self.class == o.class &&
122132
forget_after == o.forget_after &&
133+
instantaneous_baseline == o.instantaneous_baseline &&
123134
learning_duration == o.learning_duration &&
124135
learning_method == o.learning_method &&
125136
learning_threshold == o.learning_threshold &&
@@ -130,7 +141,7 @@ def ==(o)
130141
# @return [Integer] Hash code
131142
# @!visibility private
132143
def hash
133-
[forget_after, learning_duration, learning_method, learning_threshold, additional_properties].hash
144+
[forget_after, instantaneous_baseline, learning_duration, learning_method, learning_threshold, additional_properties].hash
134145
end
135146
end
136147
end

0 commit comments

Comments
 (0)