Skip to content

Commit 4ddef06

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Tag security findings Jira endpoints as unstable (#3095)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent fb3ba3c commit 4ddef06

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79838,6 +79838,9 @@ paths:
7983879838
permissions:
7983979839
- security_monitoring_findings_write
7984079840
- appsec_vm_write
79841+
x-unstable: '**Note**: This endpoint is in beta and is subject to change.
79842+
79843+
Please check the documentation regularly for updates.'
7984179844
post:
7984279845
description: Create Jira issues for security findings. This operation creates
7984379846
a case in Datadog and a Jira issue linked to that case for bidirectional sync
@@ -79878,6 +79881,9 @@ paths:
7987879881
permissions:
7987979882
- security_monitoring_findings_write
7988079883
- appsec_vm_write
79884+
x-unstable: '**Note**: This endpoint is in beta and is subject to change.
79885+
79886+
Please check the documentation regularly for updates.'
7988179887
/api/v2/security/sboms:
7988279888
get:
7988379889
description: 'Get a list of assets SBOMs for an organization.

features/v2/security_monitoring.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Feature: Security Monitoring
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "SecurityMonitoring" API
1111

12-
@team:DataDog/k9-investigation
12+
@skip @team:DataDog/k9-investigation
1313
Scenario: Attach security finding to a Jira issue returns "OK" response
1414
Given new "AttachJiraIssue" request
1515
And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}}
@@ -30,21 +30,21 @@ Feature: Security Monitoring
3030
And the response "data.attributes.status_group" is equal to "SG_OPEN"
3131
And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="
3232

33-
@team:DataDog/k9-investigation
33+
@skip @team:DataDog/k9-investigation
3434
Scenario: Attach security findings to a Jira issue returns "Bad Request" response
3535
Given new "AttachJiraIssue" request
3636
And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}}
3737
When the request is sent
3838
Then the response status is 400 Bad Request
3939

40-
@team:DataDog/k9-investigation
40+
@skip @team:DataDog/k9-investigation
4141
Scenario: Attach security findings to a Jira issue returns "Not Found" response
4242
Given new "AttachJiraIssue" request
4343
And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}}
4444
When the request is sent
4545
Then the response status is 404 Not Found
4646

47-
@team:DataDog/k9-investigation
47+
@skip @team:DataDog/k9-investigation
4848
Scenario: Attach security findings to a Jira issue returns "OK" response
4949
Given new "AttachJiraIssue" request
5050
And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}}
@@ -258,7 +258,7 @@ Feature: Security Monitoring
258258
Then the response status is 200 OK
259259
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
260260

261-
@team:DataDog/k9-investigation
261+
@skip @team:DataDog/k9-investigation
262262
Scenario: Create Jira issue for security finding returns "Created" response
263263
Given new "CreateJiraIssues" request
264264
And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6a773295-8729-4034-aada-53b64cbe02e7"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}}, "id": "6a773295-8729-4034-aada-53b64cbe02e7"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}
@@ -274,7 +274,7 @@ Feature: Security Monitoring
274274
And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING"
275275
And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED"
276276

277-
@team:DataDog/k9-investigation
277+
@skip @team:DataDog/k9-investigation
278278
Scenario: Create Jira issue for security findings returns "Created" response
279279
Given new "CreateJiraIssues" request
280280
And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}}, "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}
@@ -292,14 +292,14 @@ Feature: Security Monitoring
292292
And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING"
293293
And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED"
294294

295-
@team:DataDog/k9-investigation
295+
@skip @team:DataDog/k9-investigation
296296
Scenario: Create Jira issues for security findings returns "Bad Request" response
297297
Given new "CreateJiraIssues" request
298298
And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}}}}], "included": [{"type": "cases", "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": []}}, "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}]}
299299
When the request is sent
300300
Then the response status is 400 Bad Request
301301

302-
@team:DataDog/k9-investigation
302+
@skip @team:DataDog/k9-investigation
303303
Scenario: Create Jira issues for security findings returns "Created" response
304304
Given new "CreateJiraIssues" request
305305
And body with value {"data": [{"type": "jira_issues", "attributes":{}, "relationships": {"case": {"data": {"type": "cases", "id":"53e242c6-a7d6-46ad-9680-b8d14753f716"}}}}, {"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}}}}], "included":[{"type":"cases", "attributes":{"title":"A title", "description":"A description"}, "relationships":{"project":{"data":{"type":"projects", "id":"959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}]}}, "id": "53e242c6-a7d6-46ad-9680-b8d14753f716"}, {"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data":[{"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}}, "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}, {"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}
@@ -323,7 +323,7 @@ Feature: Security Monitoring
323323
And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING"
324324
And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED"
325325

326-
@team:DataDog/k9-investigation
326+
@skip @team:DataDog/k9-investigation
327327
Scenario: Create Jira issues for security findings returns "Not Found" response
328328
Given new "CreateJiraIssues" request
329329
And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}}, "findings": {"data": [{"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}}, "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}, {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}, {"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}

packages/datadog-api-client-common/configuration.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ export function createConfiguration(
241241
"v2.getOpenAPI": false,
242242
"v2.listAPIs": false,
243243
"v2.updateOpenAPI": false,
244+
"v2.attachJiraIssue": false,
244245
"v2.cancelThreatHuntingJob": false,
245246
"v2.convertJobResultToSignal": false,
247+
"v2.createJiraIssues": false,
246248
"v2.deleteThreatHuntingJob": false,
247249
"v2.getFinding": false,
248250
"v2.getRuleVersionHistory": false,

packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
155155
): Promise<RequestContext> {
156156
const _config = _options || this.configuration;
157157

158+
logger.warn("Using unstable operation 'attachJiraIssue'");
159+
if (!_config.unstableOperations["v2.attachJiraIssue"]) {
160+
throw new Error("Unstable operation 'attachJiraIssue' is disabled");
161+
}
162+
158163
// verify required parameter 'body' is not null or undefined
159164
if (body === null || body === undefined) {
160165
throw new RequiredError("body", "attachJiraIssue");
@@ -462,6 +467,11 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
462467
): Promise<RequestContext> {
463468
const _config = _options || this.configuration;
464469

470+
logger.warn("Using unstable operation 'createJiraIssues'");
471+
if (!_config.unstableOperations["v2.createJiraIssues"]) {
472+
throw new Error("Unstable operation 'createJiraIssues' is disabled");
473+
}
474+
465475
// verify required parameter 'body' is not null or undefined
466476
if (body === null || body === undefined) {
467477
throw new RequiredError("body", "createJiraIssues");

0 commit comments

Comments
 (0)