Skip to content

Commit 91ed0a3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Added new optional field definition to include more detail in findings for '/api/v2/posture_management/findings' (#2413)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 30f65c5 commit 91ed0a3

File tree

9 files changed

+136
-12
lines changed

9 files changed

+136
-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-06-05 08:11:21.288492",
8-
"spec_repo_commit": "0e7259ca"
7+
"regenerated": "2025-06-05 09:49:42.393551",
8+
"spec_repo_commit": "faa72400"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-05 08:11:21.310506",
13-
"spec_repo_commit": "0e7259ca"
12+
"regenerated": "2025-06-05 09:49:42.410269",
13+
"spec_repo_commit": "faa72400"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15279,10 +15279,16 @@ components:
1527915279
FindingAttributes:
1528015280
description: The JSON:API attributes of the finding.
1528115281
properties:
15282+
datadog_link:
15283+
$ref: '#/components/schemas/FindingDatadogLink'
15284+
description:
15285+
$ref: '#/components/schemas/FindingDescription'
1528215286
evaluation:
1528315287
$ref: '#/components/schemas/FindingEvaluation'
1528415288
evaluation_changed_at:
1528515289
$ref: '#/components/schemas/FindingEvaluationChangedAt'
15290+
external_id:
15291+
$ref: '#/components/schemas/FindingExternalId'
1528615292
mute:
1528715293
$ref: '#/components/schemas/FindingMute'
1528815294
resource:
@@ -15300,6 +15306,22 @@ components:
1530015306
vulnerability_type:
1530115307
$ref: '#/components/schemas/FindingVulnerabilityType'
1530215308
type: object
15309+
FindingDatadogLink:
15310+
description: The Datadog relative link for this finding.
15311+
example: /security/compliance?panels=cpfinding%7Cevent%7CruleId%3Adef-000-u5t%7CresourceId%3Ae8c9ab7c52ebd7bf2fdb4db641082d7d%7CtabId%3Aoverview
15312+
type: string
15313+
FindingDescription:
15314+
description: The description and remediation steps for this finding.
15315+
example: '## Remediation
15316+
15317+
15318+
1. In the console, go to **Storage Account**.
15319+
15320+
2. For each Storage Account, navigate to **Data Protection**.
15321+
15322+
3. Select **Set soft delete enabled** and enter the number of days to retain
15323+
soft deleted data.'
15324+
type: string
1530315325
FindingEvaluation:
1530415326
description: The evaluation of the finding.
1530515327
enum:
@@ -15317,6 +15339,10 @@ components:
1531715339
format: int64
1531815340
minimum: 1
1531915341
type: integer
15342+
FindingExternalId:
15343+
description: The cloud-based ID for the resource related to the finding.
15344+
example: arn:aws:s3:::my-example-bucket
15345+
type: string
1532015346
FindingID:
1532115347
description: The unique ID for this finding.
1532215348
example: ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==
@@ -53082,13 +53108,19 @@ paths:
5308253108
the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.\n\nQuery
5308353109
parameters must be only among the documented ones and with values of correct
5308453110
types. Duplicated query parameters (e.g. `filter[status]=low&filter[status]=info`)
53085-
are not allowed.\n\n### Response\n\nThe response includes an array of finding
53086-
objects, pagination metadata, and a count of items that match the query.\n\nEach
53087-
finding object contains the following:\n\n- The finding ID that can be used
53088-
in a `GetFinding` request to retrieve the full finding details.\n- Core attributes,
53089-
including status, evaluation, high-level resource details, muted state, and
53090-
rule details.\n- `evaluation_changed_at` and `resource_discovery_date` time
53091-
stamps.\n- An array of associated tags.\n"
53111+
are not allowed.\n\n### Additional extension fields\n\nAdditional extension
53112+
fields are available for some findings.\n\nThe data is available when you
53113+
include the query parameter `?detailed_findings=true` in the request.\n\nThe
53114+
following fields are available for findings:\n- `external_id`: The resource
53115+
external ID related to the finding.\n- `description`: The description and
53116+
remediation steps for the finding.\n- `datadog_link`: The Datadog relative
53117+
link for the finding.\n\n### Response\n\nThe response includes an array of
53118+
finding objects, pagination metadata, and a count of items that match the
53119+
query.\n\nEach finding object contains the following:\n\n- The finding ID
53120+
that can be used in a `GetFinding` request to retrieve the full finding details.\n-
53121+
Core attributes, including status, evaluation, high-level resource details,
53122+
muted state, and rule details.\n- `evaluation_changed_at` and `resource_discovery_date`
53123+
time stamps.\n- An array of associated tags.\n"
5309253124
operationId: ListFindings
5309353125
parameters:
5309453126
- description: Limit the number of findings returned. Must be <= 1000.
@@ -53191,6 +53223,14 @@ paths:
5319153223
items:
5319253224
$ref: '#/components/schemas/FindingVulnerabilityType'
5319353225
type: array
53226+
- description: Return additional fields for some findings.
53227+
example:
53228+
- true
53229+
in: query
53230+
name: detailed_findings
53231+
required: false
53232+
schema:
53233+
type: boolean
5319453234
responses:
5319553235
'200':
5319653236
content:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-05-20T12:11:24.321Z

cassettes/features/v2/security_monitoring/List-findings-returns-OK-response-with-details.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# List findings returns "OK" response with details
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_findings".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
8+
opts = {
9+
detailed_findings: true,
10+
}
11+
p api_instance.list_findings(opts)

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,7 @@
11831183
"filter_evaluation" => "FindingEvaluation",
11841184
"filter_status" => "FindingStatus",
11851185
"filter_vulnerability_type" => "Array<FindingVulnerabilityType>",
1186+
"detailed_findings" => "Boolean",
11861187
},
11871188
"v2.MuteFindings" => {
11881189
"body" => "BulkMuteFindingsRequest",

features/v2/security_monitoring.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,14 @@ Feature: Security Monitoring
840840
Then the response status is 200 OK
841841
And the response "data[0].type" is equal to "finding"
842842

843+
@team:DataDog/cloud-security-posture-management
844+
Scenario: List findings returns "OK" response with details
845+
Given operation "ListFindings" enabled
846+
And new "ListFindings" request
847+
And request contains "detailed_findings" parameter with value true
848+
When the request is sent
849+
Then the response status is 200 OK
850+
843851
@generated @skip @team:DataDog/cloud-security-posture-management @with-pagination
844852
Scenario: List findings returns "OK" response with pagination
845853
Given operation "ListFindings" enabled

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,17 @@ def list_findings(opts = {})
23762376
#
23772377
# Query parameters must be only among the documented ones and with values of correct types. Duplicated query parameters (e.g. `filter[status]=low&filter[status]=info`) are not allowed.
23782378
#
2379+
# ### Additional extension fields
2380+
#
2381+
# Additional extension fields are available for some findings.
2382+
#
2383+
# The data is available when you include the query parameter `?detailed_findings=true` in the request.
2384+
#
2385+
# The following fields are available for findings:
2386+
# - `external_id`: The resource external ID related to the finding.
2387+
# - `description`: The description and remediation steps for the finding.
2388+
# - `datadog_link`: The Datadog relative link for the finding.
2389+
#
23792390
# ### Response
23802391
#
23812392
# The response includes an array of finding objects, pagination metadata, and a count of items that match the query.
@@ -2402,6 +2413,7 @@ def list_findings(opts = {})
24022413
# @option opts [FindingEvaluation] :filter_evaluation Return only `pass` or `fail` findings.
24032414
# @option opts [FindingStatus] :filter_status Return only findings with the specified status.
24042415
# @option opts [Array<FindingVulnerabilityType>] :filter_vulnerability_type Return findings that match the selected vulnerability types (repeatable).
2416+
# @option opts [Boolean] :detailed_findings Return additional fields for some findings.
24052417
# @return [Array<(ListFindingsResponse, Integer, Hash)>] ListFindingsResponse data, response status code and response headers
24062418
def list_findings_with_http_info(opts = {})
24072419
unstable_enabled = @api_client.config.unstable_operations["v2.list_findings".to_sym]
@@ -2449,6 +2461,7 @@ def list_findings_with_http_info(opts = {})
24492461
query_params[:'filter[evaluation]'] = opts[:'filter_evaluation'] if !opts[:'filter_evaluation'].nil?
24502462
query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
24512463
query_params[:'filter[vulnerability_type]'] = @api_client.build_collection_param(opts[:'filter_vulnerability_type'], :multi) if !opts[:'filter_vulnerability_type'].nil?
2464+
query_params[:'detailed_findings'] = opts[:'detailed_findings'] if !opts[:'detailed_findings'].nil?
24522465

24532466
# header parameters
24542467
header_params = opts[:header_params] || {}

lib/datadog_api_client/v2/models/finding_attributes.rb

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@ module DatadogAPIClient::V2
2121
class FindingAttributes
2222
include BaseGenericModel
2323

24+
# The Datadog relative link for this finding.
25+
attr_accessor :datadog_link
26+
27+
# The description and remediation steps for this finding.
28+
attr_accessor :description
29+
2430
# The evaluation of the finding.
2531
attr_accessor :evaluation
2632

2733
# The date on which the evaluation for this finding changed (Unix ms).
2834
attr_reader :evaluation_changed_at
2935

36+
# The cloud-based ID for the resource related to the finding.
37+
attr_accessor :external_id
38+
3039
# Information about the mute status of this finding.
3140
attr_accessor :mute
3241

@@ -57,8 +66,11 @@ class FindingAttributes
5766
# @!visibility private
5867
def self.attribute_map
5968
{
69+
:'datadog_link' => :'datadog_link',
70+
:'description' => :'description',
6071
:'evaluation' => :'evaluation',
6172
:'evaluation_changed_at' => :'evaluation_changed_at',
73+
:'external_id' => :'external_id',
6274
:'mute' => :'mute',
6375
:'resource' => :'resource',
6476
:'resource_discovery_date' => :'resource_discovery_date',
@@ -74,8 +86,11 @@ def self.attribute_map
7486
# @!visibility private
7587
def self.openapi_types
7688
{
89+
:'datadog_link' => :'String',
90+
:'description' => :'String',
7791
:'evaluation' => :'FindingEvaluation',
7892
:'evaluation_changed_at' => :'Integer',
93+
:'external_id' => :'String',
7994
:'mute' => :'FindingMute',
8095
:'resource' => :'String',
8196
:'resource_discovery_date' => :'Integer',
@@ -105,6 +120,14 @@ def initialize(attributes = {})
105120
end
106121
}
107122

123+
if attributes.key?(:'datadog_link')
124+
self.datadog_link = attributes[:'datadog_link']
125+
end
126+
127+
if attributes.key?(:'description')
128+
self.description = attributes[:'description']
129+
end
130+
108131
if attributes.key?(:'evaluation')
109132
self.evaluation = attributes[:'evaluation']
110133
end
@@ -113,6 +136,10 @@ def initialize(attributes = {})
113136
self.evaluation_changed_at = attributes[:'evaluation_changed_at']
114137
end
115138

139+
if attributes.key?(:'external_id')
140+
self.external_id = attributes[:'external_id']
141+
end
142+
116143
if attributes.key?(:'mute')
117144
self.mute = attributes[:'mute']
118145
end
@@ -203,8 +230,11 @@ def to_hash
203230
def ==(o)
204231
return true if self.equal?(o)
205232
self.class == o.class &&
233+
datadog_link == o.datadog_link &&
234+
description == o.description &&
206235
evaluation == o.evaluation &&
207236
evaluation_changed_at == o.evaluation_changed_at &&
237+
external_id == o.external_id &&
208238
mute == o.mute &&
209239
resource == o.resource &&
210240
resource_discovery_date == o.resource_discovery_date &&
@@ -220,7 +250,7 @@ def ==(o)
220250
# @return [Integer] Hash code
221251
# @!visibility private
222252
def hash
223-
[evaluation, evaluation_changed_at, mute, resource, resource_discovery_date, resource_type, rule, status, tags, vulnerability_type, additional_properties].hash
253+
[datadog_link, description, evaluation, evaluation_changed_at, external_id, mute, resource, resource_discovery_date, resource_type, rule, status, tags, vulnerability_type, additional_properties].hash
224254
end
225255
end
226256
end

0 commit comments

Comments
 (0)