Skip to content

Commit f9473c2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add vulnerability type to Findings API (#2048)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 1f40826 commit f9473c2

File tree

7 files changed

+78
-8
lines changed

7 files changed

+78
-8
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": "2024-10-08 14:16:07.014602",
8-
"spec_repo_commit": "eb227ded"
7+
"regenerated": "2024-10-09 13:48:28.709055",
8+
"spec_repo_commit": "a458c3a4"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-08 14:16:07.028674",
13-
"spec_repo_commit": "eb227ded"
12+
"regenerated": "2024-10-09 13:48:28.727121",
13+
"spec_repo_commit": "a458c3a4"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9230,6 +9230,8 @@ components:
92309230
$ref: '#/components/schemas/FindingStatus'
92319231
tags:
92329232
$ref: '#/components/schemas/FindingTags'
9233+
vulnerability_type:
9234+
$ref: '#/components/schemas/FindingVulnerabilityType'
92339235
type: object
92349236
FindingEvaluation:
92359237
description: The evaluation of the finding.
@@ -9363,6 +9365,20 @@ components:
93639365
type: string
93649366
x-enum-varnames:
93659367
- FINDING
9368+
FindingVulnerabilityType:
9369+
description: The vulnerability type of the finding.
9370+
enum:
9371+
- misconfiguration
9372+
- attack_path
9373+
- identity_risk
9374+
- api_security
9375+
example: misconfiguration
9376+
type: string
9377+
x-enum-varnames:
9378+
- MISCONFIGURATION
9379+
- ATTACK_PATH
9380+
- IDENTITY_RISK
9381+
- API_SECURITY
93669382
FormulaLimit:
93679383
description: 'Message for specifying limits to the number of values returned
93689384
by a query.
@@ -34377,6 +34393,17 @@ paths:
3437734393
required: false
3437834394
schema:
3437934395
$ref: '#/components/schemas/FindingStatus'
34396+
- description: Return findings that match the selected vulnerability types (repeatable).
34397+
example:
34398+
- misconfiguration
34399+
explode: true
34400+
in: query
34401+
name: filter[vulnerability_type]
34402+
required: false
34403+
schema:
34404+
items:
34405+
$ref: '#/components/schemas/FindingVulnerabilityType'
34406+
type: array
3438034407
responses:
3438134408
'200':
3438234409
content:

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,7 @@
16861686
"filter_discovery_timestamp" => "String",
16871687
"filter_evaluation" => "FindingEvaluation",
16881688
"filter_status" => "FindingStatus",
1689+
"filter_vulnerability_type" => "Array<FindingVulnerabilityType>",
16891690
},
16901691
"v2.MuteFindings" => {
16911692
"body" => "BulkMuteFindingsRequest",

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,7 @@ def overrides
14341434
"v2.finding_rule" => "FindingRule",
14351435
"v2.finding_status" => "FindingStatus",
14361436
"v2.finding_type" => "FindingType",
1437+
"v2.finding_vulnerability_type" => "FindingVulnerabilityType",
14371438
"v2.formula_limit" => "FormulaLimit",
14381439
"v2.full_api_key" => "FullAPIKey",
14391440
"v2.full_api_key_attributes" => "FullAPIKeyAttributes",

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,6 +1166,7 @@ def list_findings(opts = {})
11661166
# @option opts [String] :filter_discovery_timestamp Return findings that were found on a specified date (Unix ms) or date range (using comparison operators).
11671167
# @option opts [FindingEvaluation] :filter_evaluation Return only `pass` or `fail` findings.
11681168
# @option opts [FindingStatus] :filter_status Return only findings with the specified status.
1169+
# @option opts [Array<FindingVulnerabilityType>] :filter_vulnerability_type Return findings that match the selected vulnerability types (repeatable).
11691170
# @return [Array<(ListFindingsResponse, Integer, Hash)>] ListFindingsResponse data, response status code and response headers
11701171
def list_findings_with_http_info(opts = {})
11711172
unstable_enabled = @api_client.config.unstable_operations["v2.list_findings".to_sym]
@@ -1212,6 +1213,7 @@ def list_findings_with_http_info(opts = {})
12121213
query_params[:'filter[discovery_timestamp]'] = opts[:'filter_discovery_timestamp'] if !opts[:'filter_discovery_timestamp'].nil?
12131214
query_params[:'filter[evaluation]'] = opts[:'filter_evaluation'] if !opts[:'filter_evaluation'].nil?
12141215
query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
1216+
query_params[:'filter[vulnerability_type]'] = @api_client.build_collection_param(opts[:'filter_vulnerability_type'], :multi) if !opts[:'filter_vulnerability_type'].nil?
12151217

12161218
# header parameters
12171219
header_params = opts[:header_params] || {}

lib/datadog_api_client/v2/models/finding_attributes.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class FindingAttributes
4848
# The tags associated with this finding.
4949
attr_accessor :tags
5050

51+
# The vulnerability type of the finding.
52+
attr_accessor :vulnerability_type
53+
5154
attr_accessor :additional_properties
5255

5356
# Attribute mapping from ruby-style variable name to JSON key.
@@ -62,7 +65,8 @@ def self.attribute_map
6265
:'resource_type' => :'resource_type',
6366
:'rule' => :'rule',
6467
:'status' => :'status',
65-
:'tags' => :'tags'
68+
:'tags' => :'tags',
69+
:'vulnerability_type' => :'vulnerability_type'
6670
}
6771
end
6872

@@ -78,7 +82,8 @@ def self.openapi_types
7882
:'resource_type' => :'String',
7983
:'rule' => :'FindingRule',
8084
:'status' => :'FindingStatus',
81-
:'tags' => :'Array<String>'
85+
:'tags' => :'Array<String>',
86+
:'vulnerability_type' => :'FindingVulnerabilityType'
8287
}
8388
end
8489

@@ -137,6 +142,10 @@ def initialize(attributes = {})
137142
self.tags = value
138143
end
139144
end
145+
146+
if attributes.key?(:'vulnerability_type')
147+
self.vulnerability_type = attributes[:'vulnerability_type']
148+
end
140149
end
141150

142151
# Check to see if the all the properties in the model are valid
@@ -202,15 +211,16 @@ def ==(o)
202211
resource_type == o.resource_type &&
203212
rule == o.rule &&
204213
status == o.status &&
205-
tags == o.tags
214+
tags == o.tags &&
215+
vulnerability_type == o.vulnerability_type
206216
additional_properties == o.additional_properties
207217
end
208218

209219
# Calculates hash code according to all attributes.
210220
# @return [Integer] Hash code
211221
# @!visibility private
212222
def hash
213-
[evaluation, evaluation_changed_at, mute, resource, resource_discovery_date, resource_type, rule, status, tags].hash
223+
[evaluation, evaluation_changed_at, mute, resource, resource_discovery_date, resource_type, rule, status, tags, vulnerability_type].hash
214224
end
215225
end
216226
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The vulnerability type of the finding.
21+
class FindingVulnerabilityType
22+
include BaseEnumModel
23+
24+
MISCONFIGURATION = "misconfiguration".freeze
25+
ATTACK_PATH = "attack_path".freeze
26+
IDENTITY_RISK = "identity_risk".freeze
27+
API_SECURITY = "api_security".freeze
28+
end
29+
end

0 commit comments

Comments
 (0)