Skip to content

Commit 6a886a5

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Added new optional field definition to include more detail in findings for '/api/v2/posture_management/findings' (#2863)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 76f9941 commit 6a886a5

File tree

8 files changed

+234
-12
lines changed

8 files changed

+234
-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.660332",
8-
"spec_repo_commit": "0e7259ca"
7+
"regenerated": "2025-06-05 09:49:40.720994",
8+
"spec_repo_commit": "faa72400"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-05 08:11:21.677480",
13-
"spec_repo_commit": "0e7259ca"
12+
"regenerated": "2025-06-05 09:49:40.742309",
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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// List findings returns "OK" response with details
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
6+
import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListFindingsOptionalParameters;
7+
import com.datadog.api.client.v2.model.ListFindingsResponse;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.listFindings", true);
13+
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
14+
15+
try {
16+
ListFindingsResponse result =
17+
apiInstance.listFindings(new ListFindingsOptionalParameters().detailedFindings(true));
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling SecurityMonitoringApi#listFindings");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}

src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5344,6 +5344,7 @@ public static class ListFindingsOptionalParameters {
53445344
private FindingEvaluation filterEvaluation;
53455345
private FindingStatus filterStatus;
53465346
private List<FindingVulnerabilityType> filterVulnerabilityType;
5347+
private Boolean detailedFindings;
53475348

53485349
/**
53495350
* Set pageLimit.
@@ -5497,6 +5498,17 @@ public ListFindingsOptionalParameters filterVulnerabilityType(
54975498
this.filterVulnerabilityType = filterVulnerabilityType;
54985499
return this;
54995500
}
5501+
5502+
/**
5503+
* Set detailedFindings.
5504+
*
5505+
* @param detailedFindings Return additional fields for some findings. (optional)
5506+
* @return ListFindingsOptionalParameters
5507+
*/
5508+
public ListFindingsOptionalParameters detailedFindings(Boolean detailedFindings) {
5509+
this.detailedFindings = detailedFindings;
5510+
return this;
5511+
}
55005512
}
55015513

55025514
/**
@@ -5647,6 +5659,17 @@ public PaginationIterable<Finding> listFindingsWithPagination(
56475659
* Duplicated query parameters (e.g. <code>filter[status]=low&amp;filter[status]=info</code>) are
56485660
* not allowed.
56495661
*
5662+
* <h3>Additional extension fields</h3>
5663+
*
5664+
* <p>Additional extension fields are available for some findings.
5665+
*
5666+
* <p>The data is available when you include the query parameter <code>?detailed_findings=true
5667+
* </code> in the request.
5668+
*
5669+
* <p>The following fields are available for findings: - <code>external_id</code>: The resource
5670+
* external ID related to the finding. - <code>description</code>: The description and remediation
5671+
* steps for the finding. - <code>datadog_link</code>: The Datadog relative link for the finding.
5672+
*
56505673
* <h3>Response</h3>
56515674
*
56525675
* <p>The response includes an array of finding objects, pagination metadata, and a count of items
@@ -5700,6 +5723,7 @@ public ApiResponse<ListFindingsResponse> listFindingsWithHttpInfo(
57005723
FindingEvaluation filterEvaluation = parameters.filterEvaluation;
57015724
FindingStatus filterStatus = parameters.filterStatus;
57025725
List<FindingVulnerabilityType> filterVulnerabilityType = parameters.filterVulnerabilityType;
5726+
Boolean detailedFindings = parameters.detailedFindings;
57035727
// create path and map variables
57045728
String localVarPath = "/api/v2/posture_management/findings";
57055729

@@ -5725,6 +5749,8 @@ public ApiResponse<ListFindingsResponse> listFindingsWithHttpInfo(
57255749
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus));
57265750
localVarQueryParams.addAll(
57275751
apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType));
5752+
localVarQueryParams.addAll(
5753+
apiClient.parameterToPairs("", "detailed_findings", detailedFindings));
57285754

57295755
Invocation.Builder builder =
57305756
apiClient.createBuilder(
@@ -5780,6 +5806,7 @@ public CompletableFuture<ApiResponse<ListFindingsResponse>> listFindingsWithHttp
57805806
FindingEvaluation filterEvaluation = parameters.filterEvaluation;
57815807
FindingStatus filterStatus = parameters.filterStatus;
57825808
List<FindingVulnerabilityType> filterVulnerabilityType = parameters.filterVulnerabilityType;
5809+
Boolean detailedFindings = parameters.detailedFindings;
57835810
// create path and map variables
57845811
String localVarPath = "/api/v2/posture_management/findings";
57855812

@@ -5805,6 +5832,8 @@ public CompletableFuture<ApiResponse<ListFindingsResponse>> listFindingsWithHttp
58055832
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus));
58065833
localVarQueryParams.addAll(
58075834
apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType));
5835+
localVarQueryParams.addAll(
5836+
apiClient.parameterToPairs("", "detailed_findings", detailedFindings));
58085837

58095838
Invocation.Builder builder;
58105839
try {

src/main/java/com/datadog/api/client/v2/model/FindingAttributes.java

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020

2121
/** The JSON:API attributes of the finding. */
2222
@JsonPropertyOrder({
23+
FindingAttributes.JSON_PROPERTY_DATADOG_LINK,
24+
FindingAttributes.JSON_PROPERTY_DESCRIPTION,
2325
FindingAttributes.JSON_PROPERTY_EVALUATION,
2426
FindingAttributes.JSON_PROPERTY_EVALUATION_CHANGED_AT,
27+
FindingAttributes.JSON_PROPERTY_EXTERNAL_ID,
2528
FindingAttributes.JSON_PROPERTY_MUTE,
2629
FindingAttributes.JSON_PROPERTY_RESOURCE,
2730
FindingAttributes.JSON_PROPERTY_RESOURCE_DISCOVERY_DATE,
@@ -35,12 +38,21 @@
3538
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
3639
public class FindingAttributes {
3740
@JsonIgnore public boolean unparsed = false;
41+
public static final String JSON_PROPERTY_DATADOG_LINK = "datadog_link";
42+
private String datadogLink;
43+
44+
public static final String JSON_PROPERTY_DESCRIPTION = "description";
45+
private String description;
46+
3847
public static final String JSON_PROPERTY_EVALUATION = "evaluation";
3948
private FindingEvaluation evaluation;
4049

4150
public static final String JSON_PROPERTY_EVALUATION_CHANGED_AT = "evaluation_changed_at";
4251
private Long evaluationChangedAt;
4352

53+
public static final String JSON_PROPERTY_EXTERNAL_ID = "external_id";
54+
private String externalId;
55+
4456
public static final String JSON_PROPERTY_MUTE = "mute";
4557
private FindingMute mute;
4658

@@ -65,6 +77,48 @@ public class FindingAttributes {
6577
public static final String JSON_PROPERTY_VULNERABILITY_TYPE = "vulnerability_type";
6678
private FindingVulnerabilityType vulnerabilityType;
6779

80+
public FindingAttributes datadogLink(String datadogLink) {
81+
this.datadogLink = datadogLink;
82+
return this;
83+
}
84+
85+
/**
86+
* The Datadog relative link for this finding.
87+
*
88+
* @return datadogLink
89+
*/
90+
@jakarta.annotation.Nullable
91+
@JsonProperty(JSON_PROPERTY_DATADOG_LINK)
92+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
93+
public String getDatadogLink() {
94+
return datadogLink;
95+
}
96+
97+
public void setDatadogLink(String datadogLink) {
98+
this.datadogLink = datadogLink;
99+
}
100+
101+
public FindingAttributes description(String description) {
102+
this.description = description;
103+
return this;
104+
}
105+
106+
/**
107+
* The description and remediation steps for this finding.
108+
*
109+
* @return description
110+
*/
111+
@jakarta.annotation.Nullable
112+
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
113+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
114+
public String getDescription() {
115+
return description;
116+
}
117+
118+
public void setDescription(String description) {
119+
this.description = description;
120+
}
121+
68122
public FindingAttributes evaluation(FindingEvaluation evaluation) {
69123
this.evaluation = evaluation;
70124
this.unparsed |= !evaluation.isValid();
@@ -111,6 +165,27 @@ public void setEvaluationChangedAt(Long evaluationChangedAt) {
111165
this.evaluationChangedAt = evaluationChangedAt;
112166
}
113167

168+
public FindingAttributes externalId(String externalId) {
169+
this.externalId = externalId;
170+
return this;
171+
}
172+
173+
/**
174+
* The cloud-based ID for the resource related to the finding.
175+
*
176+
* @return externalId
177+
*/
178+
@jakarta.annotation.Nullable
179+
@JsonProperty(JSON_PROPERTY_EXTERNAL_ID)
180+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
181+
public String getExternalId() {
182+
return externalId;
183+
}
184+
185+
public void setExternalId(String externalId) {
186+
this.externalId = externalId;
187+
}
188+
114189
public FindingAttributes mute(FindingMute mute) {
115190
this.mute = mute;
116191
this.unparsed |= mute.unparsed;
@@ -353,8 +428,11 @@ public boolean equals(Object o) {
353428
return false;
354429
}
355430
FindingAttributes findingAttributes = (FindingAttributes) o;
356-
return Objects.equals(this.evaluation, findingAttributes.evaluation)
431+
return Objects.equals(this.datadogLink, findingAttributes.datadogLink)
432+
&& Objects.equals(this.description, findingAttributes.description)
433+
&& Objects.equals(this.evaluation, findingAttributes.evaluation)
357434
&& Objects.equals(this.evaluationChangedAt, findingAttributes.evaluationChangedAt)
435+
&& Objects.equals(this.externalId, findingAttributes.externalId)
358436
&& Objects.equals(this.mute, findingAttributes.mute)
359437
&& Objects.equals(this.resource, findingAttributes.resource)
360438
&& Objects.equals(this.resourceDiscoveryDate, findingAttributes.resourceDiscoveryDate)
@@ -369,8 +447,11 @@ public boolean equals(Object o) {
369447
@Override
370448
public int hashCode() {
371449
return Objects.hash(
450+
datadogLink,
451+
description,
372452
evaluation,
373453
evaluationChangedAt,
454+
externalId,
374455
mute,
375456
resource,
376457
resourceDiscoveryDate,
@@ -386,10 +467,13 @@ public int hashCode() {
386467
public String toString() {
387468
StringBuilder sb = new StringBuilder();
388469
sb.append("class FindingAttributes {\n");
470+
sb.append(" datadogLink: ").append(toIndentedString(datadogLink)).append("\n");
471+
sb.append(" description: ").append(toIndentedString(description)).append("\n");
389472
sb.append(" evaluation: ").append(toIndentedString(evaluation)).append("\n");
390473
sb.append(" evaluationChangedAt: ")
391474
.append(toIndentedString(evaluationChangedAt))
392475
.append("\n");
476+
sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n");
393477
sb.append(" mute: ").append(toIndentedString(mute)).append("\n");
394478
sb.append(" resource: ").append(toIndentedString(resource)).append("\n");
395479
sb.append(" resourceDiscoveryDate: ")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-05-20T12:11:24.321Z

0 commit comments

Comments
 (0)