Skip to content

Commit b5a491b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit b980d49f of spec repo (#2237)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f65ee2d commit b5a491b

18 files changed

+575
-12
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-10 19:09:34.070491",
8-
"spec_repo_commit": "824f78a1"
7+
"regenerated": "2025-02-11 09:59:41.128574",
8+
"spec_repo_commit": "b980d49f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-10 19:09:34.086424",
13-
"spec_repo_commit": "824f78a1"
12+
"regenerated": "2025-02-11 09:59:41.144563",
13+
"spec_repo_commit": "b980d49f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15657,6 +15657,15 @@ components:
1565715657
example: 1729843470000
1565815658
format: int64
1565915659
type: integer
15660+
groupSignalsBy:
15661+
description: Additional grouping to perform on top of the existing groups
15662+
in the query section. Must be a subset of the existing groups.
15663+
example:
15664+
- service
15665+
items:
15666+
description: Field to group by.
15667+
type: string
15668+
type: array
1566015669
index:
1566115670
description: Index used to load the data.
1566215671
example: cloud_siem
@@ -24242,6 +24251,11 @@ components:
2424224251
SecurityMonitoringRuleCase:
2424324252
description: Case when signal is generated.
2424424253
properties:
24254+
actions:
24255+
description: Action to perform for each rule case.
24256+
items:
24257+
$ref: '#/components/schemas/SecurityMonitoringRuleCaseAction'
24258+
type: array
2424524259
condition:
2424624260
description: 'A rule case contains logical operations (`>`,`>=`, `&&`, `||`)
2424724261
to determine if a signal should be generated
@@ -24260,9 +24274,42 @@ components:
2426024274
status:
2426124275
$ref: '#/components/schemas/SecurityMonitoringRuleSeverity'
2426224276
type: object
24277+
SecurityMonitoringRuleCaseAction:
24278+
description: Action to perform when a signal is triggered. Only available for
24279+
Application Security rule type.
24280+
properties:
24281+
options:
24282+
$ref: '#/components/schemas/SecurityMonitoringRuleCaseActionOptions'
24283+
type:
24284+
$ref: '#/components/schemas/SecurityMonitoringRuleCaseActionType'
24285+
type: object
24286+
SecurityMonitoringRuleCaseActionOptions:
24287+
description: Options for the rule action
24288+
properties:
24289+
duration:
24290+
description: Duration of the action in seconds. 0 indicates no expiration.
24291+
example: 0
24292+
format: int64
24293+
minimum: 0
24294+
type: integer
24295+
type: object
24296+
SecurityMonitoringRuleCaseActionType:
24297+
description: The action type.
24298+
enum:
24299+
- block_ip
24300+
- block_user
24301+
type: string
24302+
x-enum-varnames:
24303+
- BLOCK_IP
24304+
- BLOCK_USER
2426324305
SecurityMonitoringRuleCaseCreate:
2426424306
description: Case when signal is generated.
2426524307
properties:
24308+
actions:
24309+
description: Action to perform for each rule case.
24310+
items:
24311+
$ref: '#/components/schemas/SecurityMonitoringRuleCaseAction'
24312+
type: array
2426624313
condition:
2426724314
description: 'A case contains logical operations (`>`,`>=`, `&&`, `||`)
2426824315
to determine if a signal should be generated
@@ -24724,6 +24771,15 @@ components:
2472424771
items:
2472524772
$ref: '#/components/schemas/SecurityMonitoringFilter'
2472624773
type: array
24774+
groupSignalsBy:
24775+
description: Additional grouping to perform on top of the existing groups
24776+
in the query section. Must be a subset of the existing groups.
24777+
example:
24778+
- service
24779+
items:
24780+
description: Field to group by.
24781+
type: string
24782+
type: array
2472724783
hasExtendedTitle:
2472824784
description: Whether the notifications include the triggering group-by values
2472924785
in their title.
@@ -25429,6 +25485,15 @@ components:
2542925485
items:
2543025486
$ref: '#/components/schemas/SecurityMonitoringFilter'
2543125487
type: array
25488+
groupSignalsBy:
25489+
description: Additional grouping to perform on top of the existing groups
25490+
in the query section. Must be a subset of the existing groups.
25491+
example:
25492+
- service
25493+
items:
25494+
description: Field to group by.
25495+
type: string
25496+
type: array
2543225497
hasExtendedTitle:
2543325498
description: Whether the notifications include the triggering group-by values
2543425499
in their title.
@@ -25501,6 +25566,15 @@ components:
2550125566
items:
2550225567
$ref: '#/components/schemas/SecurityMonitoringFilter'
2550325568
type: array
25569+
groupSignalsBy:
25570+
description: Additional grouping to perform on top of the existing groups
25571+
in the query section. Must be a subset of the existing groups.
25572+
example:
25573+
- service
25574+
items:
25575+
description: Field to group by.
25576+
type: string
25577+
type: array
2550425578
hasExtendedTitle:
2550525579
description: Whether the notifications include the triggering group-by values
2550625580
in their title.
@@ -25642,6 +25716,15 @@ components:
2564225716
items:
2564325717
$ref: '#/components/schemas/SecurityMonitoringFilter'
2564425718
type: array
25719+
groupSignalsBy:
25720+
description: Additional grouping to perform on top of the existing groups
25721+
in the query section. Must be a subset of the existing groups.
25722+
example:
25723+
- service
25724+
items:
25725+
description: Field to group by.
25726+
type: string
25727+
type: array
2564525728
hasExtendedTitle:
2564625729
description: Whether the notifications include the triggering group-by values
2564725730
in their title.
@@ -25719,6 +25802,15 @@ components:
2571925802
items:
2572025803
$ref: '#/components/schemas/SecurityMonitoringFilter'
2572125804
type: array
25805+
groupSignalsBy:
25806+
description: Additional grouping to perform on top of the existing groups
25807+
in the query section. Must be a subset of the existing groups.
25808+
example:
25809+
- service
25810+
items:
25811+
description: Field to group by.
25812+
type: string
25813+
type: array
2572225814
hasExtendedTitle:
2572325815
description: Whether the notifications include the triggering group-by values
2572425816
in their title.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-02-06T16:50:39.787Z

cassettes/features/v2/security_monitoring/Create-a-detection-rule-with-type-application-security-returns-OK-response.yml

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Create a detection rule with type 'application_security 'returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
5+
6+
body = DatadogAPIClient::V2::SecurityMonitoringStandardRuleCreatePayload.new({
7+
type: DatadogAPIClient::V2::SecurityMonitoringRuleTypeCreate::APPLICATION_SECURITY,
8+
name: "Example-Security-Monitoring_appsec_rule",
9+
queries: [
10+
DatadogAPIClient::V2::SecurityMonitoringStandardRuleQuery.new({
11+
query: "@appsec.security_activity:business_logic.users.login.failure",
12+
aggregation: DatadogAPIClient::V2::SecurityMonitoringRuleQueryAggregation::COUNT,
13+
group_by_fields: [
14+
"service",
15+
"@http.client_ip",
16+
],
17+
distinct_fields: [],
18+
}),
19+
],
20+
filters: [],
21+
cases: [
22+
DatadogAPIClient::V2::SecurityMonitoringRuleCaseCreate.new({
23+
name: "",
24+
status: DatadogAPIClient::V2::SecurityMonitoringRuleSeverity::INFO,
25+
notifications: [],
26+
condition: "a > 100000",
27+
actions: [
28+
DatadogAPIClient::V2::SecurityMonitoringRuleCaseAction.new({
29+
type: DatadogAPIClient::V2::SecurityMonitoringRuleCaseActionType::BLOCK_IP,
30+
options: DatadogAPIClient::V2::SecurityMonitoringRuleCaseActionOptions.new({
31+
duration: 900,
32+
}),
33+
}),
34+
],
35+
}),
36+
],
37+
options: DatadogAPIClient::V2::SecurityMonitoringRuleOptions.new({
38+
keep_alive: DatadogAPIClient::V2::SecurityMonitoringRuleKeepAlive::ONE_HOUR,
39+
max_signal_duration: DatadogAPIClient::V2::SecurityMonitoringRuleMaxSignalDuration::ONE_DAY,
40+
evaluation_window: DatadogAPIClient::V2::SecurityMonitoringRuleEvaluationWindow::FIFTEEN_MINUTES,
41+
detection_method: DatadogAPIClient::V2::SecurityMonitoringRuleDetectionMethod::THRESHOLD,
42+
}),
43+
is_enabled: true,
44+
message: "Test rule",
45+
tags: [],
46+
group_signals_by: [
47+
"service",
48+
],
49+
})
50+
p api_instance.create_security_monitoring_rule(body)

features/v2/security_monitoring.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ Feature: Security Monitoring
200200
And the response "options.detectionMethod" is equal to "third_party"
201201
And the response "thirdPartyCases[0].query" is equal to "status:error"
202202

203+
@skip-validation @team:DataDog/k9-cloud-security-platform
204+
Scenario: Create a detection rule with type 'application_security 'returns "OK" response
205+
Given new "CreateSecurityMonitoringRule" request
206+
And body with value {"type":"application_security","name":"{{unique}}_appsec_rule","queries":[{"query":"@appsec.security_activity:business_logic.users.login.failure","aggregation":"count","groupByFields":["service","@http.client_ip"],"distinctFields":[]}],"filters":[],"cases":[{"name":"","status":"info","notifications":[],"condition":"a > 100000","actions":[{"type":"block_ip","options":{"duration":900}}]}],"options":{"keepAlive":3600,"maxSignalDuration":86400,"evaluationWindow":900,"detectionMethod":"threshold"},"isEnabled":true,"message":"Test rule","tags":[],"groupSignalsBy":["service"]}
207+
When the request is sent
208+
Then the response status is 200 OK
209+
And the response "name" is equal to "{{ unique }}_appsec_rule"
210+
And the response "type" is equal to "application_security"
211+
And the response "message" is equal to "Test rule"
212+
203213
@skip-validation @team:DataDog/k9-cloud-security-platform
204214
Scenario: Create a detection rule with type 'impossible_travel' returns "OK" response
205215
Given new "CreateSecurityMonitoringRule" request

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,6 +2420,9 @@ def overrides
24202420
"v2.security_monitoring_list_rules_response" => "SecurityMonitoringListRulesResponse",
24212421
"v2.security_monitoring_reference_table" => "SecurityMonitoringReferenceTable",
24222422
"v2.security_monitoring_rule_case" => "SecurityMonitoringRuleCase",
2423+
"v2.security_monitoring_rule_case_action" => "SecurityMonitoringRuleCaseAction",
2424+
"v2.security_monitoring_rule_case_action_options" => "SecurityMonitoringRuleCaseActionOptions",
2425+
"v2.security_monitoring_rule_case_action_type" => "SecurityMonitoringRuleCaseActionType",
24232426
"v2.security_monitoring_rule_case_create" => "SecurityMonitoringRuleCaseCreate",
24242427
"v2.security_monitoring_rule_convert_payload" => "SecurityMonitoringRuleConvertPayload",
24252428
"v2.security_monitoring_rule_convert_response" => "SecurityMonitoringRuleConvertResponse",

lib/datadog_api_client/v2/models/job_definition.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class JobDefinition
3030
# Starting time of data analyzed by the job.
3131
attr_reader :from
3232

33+
# Additional grouping to perform on top of the existing groups in the query section. Must be a subset of the existing groups.
34+
attr_accessor :group_signals_by
35+
3336
# Index used to load the data.
3437
attr_reader :index
3538

@@ -69,6 +72,7 @@ def self.attribute_map
6972
:'calculated_fields' => :'calculatedFields',
7073
:'cases' => :'cases',
7174
:'from' => :'from',
75+
:'group_signals_by' => :'groupSignalsBy',
7276
:'index' => :'index',
7377
:'message' => :'message',
7478
:'name' => :'name',
@@ -89,6 +93,7 @@ def self.openapi_types
8993
:'calculated_fields' => :'Array<CalculatedField>',
9094
:'cases' => :'Array<SecurityMonitoringRuleCaseCreate>',
9195
:'from' => :'Integer',
96+
:'group_signals_by' => :'Array<String>',
9297
:'index' => :'String',
9398
:'message' => :'String',
9499
:'name' => :'String',
@@ -136,6 +141,12 @@ def initialize(attributes = {})
136141
self.from = attributes[:'from']
137142
end
138143

144+
if attributes.key?(:'group_signals_by')
145+
if (value = attributes[:'group_signals_by']).is_a?(Array)
146+
self.group_signals_by = value
147+
end
148+
end
149+
139150
if attributes.key?(:'index')
140151
self.index = attributes[:'index']
141152
end
@@ -298,6 +309,7 @@ def ==(o)
298309
calculated_fields == o.calculated_fields &&
299310
cases == o.cases &&
300311
from == o.from &&
312+
group_signals_by == o.group_signals_by &&
301313
index == o.index &&
302314
message == o.message &&
303315
name == o.name &&
@@ -315,7 +327,7 @@ def ==(o)
315327
# @return [Integer] Hash code
316328
# @!visibility private
317329
def hash
318-
[calculated_fields, cases, from, index, message, name, options, queries, reference_tables, tags, third_party_cases, to, type, additional_properties].hash
330+
[calculated_fields, cases, from, group_signals_by, index, message, name, options, queries, reference_tables, tags, third_party_cases, to, type, additional_properties].hash
319331
end
320332
end
321333
end

0 commit comments

Comments
 (0)