Skip to content

Commit 1419250

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document signals triage update endpoints (#3968)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1c294f7 commit 1419250

14 files changed

Lines changed: 988 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64574,6 +64574,38 @@ components:
6457464574
type: string
6457564575
x-enum-varnames:
6457664576
- SIGNAL
64577+
SecurityMonitoringSignalUpdateAttributes:
64578+
description: Attributes for updating the triage state or assignee of a security signal.
64579+
properties:
64580+
archive_comment:
64581+
$ref: "#/components/schemas/SecurityMonitoringSignalArchiveComment"
64582+
archive_reason:
64583+
$ref: "#/components/schemas/SecurityMonitoringSignalArchiveReason"
64584+
assignee:
64585+
$ref: "#/components/schemas/SecurityMonitoringTriageUser"
64586+
state:
64587+
$ref: "#/components/schemas/SecurityMonitoringSignalState"
64588+
version:
64589+
$ref: "#/components/schemas/SecurityMonitoringSignalVersion"
64590+
type: object
64591+
SecurityMonitoringSignalUpdateData:
64592+
description: Data containing the triage state or assignee update for a security signal.
64593+
properties:
64594+
attributes:
64595+
$ref: "#/components/schemas/SecurityMonitoringSignalUpdateAttributes"
64596+
type:
64597+
$ref: "#/components/schemas/SecurityMonitoringSignalMetadataType"
64598+
required:
64599+
- attributes
64600+
type: object
64601+
SecurityMonitoringSignalUpdateRequest:
64602+
description: Request body for updating the triage state or assignee of a security signal.
64603+
properties:
64604+
data:
64605+
$ref: "#/components/schemas/SecurityMonitoringSignalUpdateData"
64606+
required:
64607+
- data
64608+
type: object
6457764609
SecurityMonitoringSignalVersion:
6457864610
description: Version of the updated signal. If server side version is higher, update will be rejected.
6457964611
format: int64
@@ -64727,6 +64759,33 @@ components:
6472764759
- count
6472864760
- events
6472964761
type: object
64762+
SecurityMonitoringSignalsBulkUpdateData:
64763+
description: Data for updating a single security signal in a bulk update operation.
64764+
properties:
64765+
attributes:
64766+
$ref: "#/components/schemas/SecurityMonitoringSignalUpdateAttributes"
64767+
id:
64768+
description: The unique ID of the security signal.
64769+
example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
64770+
type: string
64771+
type:
64772+
$ref: "#/components/schemas/SecurityMonitoringSignalType"
64773+
required:
64774+
- id
64775+
- attributes
64776+
type: object
64777+
SecurityMonitoringSignalsBulkUpdateRequest:
64778+
description: Request body for updating multiple attributes of multiple security signals.
64779+
properties:
64780+
data:
64781+
description: An array of signal updates.
64782+
items:
64783+
$ref: "#/components/schemas/SecurityMonitoringSignalsBulkUpdateData"
64784+
maxItems: 199
64785+
type: array
64786+
required:
64787+
- data
64788+
type: object
6473064789
SecurityMonitoringSignalsListResponse:
6473164790
description: "The response object with all security signals matching the request\nand pagination information."
6473264791
properties:
@@ -119533,6 +119592,51 @@ paths:
119533119592
operator: OR
119534119593
permissions:
119535119594
- security_monitoring_signals_write
119595+
/api/v2/security_monitoring/signals/bulk/update:
119596+
patch:
119597+
description: |-
119598+
Update the triage state or assignee of multiple security signals at once.
119599+
The maximum number of signals that can be updated in a single request is 199.
119600+
operationId: BulkEditSecurityMonitoringSignals
119601+
requestBody:
119602+
content:
119603+
application/json:
119604+
schema:
119605+
$ref: "#/components/schemas/SecurityMonitoringSignalsBulkUpdateRequest"
119606+
description: Attributes describing the signal updates.
119607+
required: true
119608+
responses:
119609+
"200":
119610+
content:
119611+
application/json:
119612+
schema:
119613+
$ref: "#/components/schemas/SecurityMonitoringSignalsBulkTriageUpdateResponse"
119614+
description: OK
119615+
"400":
119616+
content:
119617+
application/json:
119618+
schema:
119619+
$ref: "#/components/schemas/JSONAPIErrorResponse"
119620+
description: Bad Request
119621+
"403":
119622+
content:
119623+
application/json:
119624+
schema:
119625+
$ref: "#/components/schemas/JSONAPIErrorResponse"
119626+
description: Forbidden
119627+
"429":
119628+
$ref: "#/components/responses/TooManyRequestsResponse"
119629+
security:
119630+
- apiKeyAuth: []
119631+
appKeyAuth: []
119632+
- AuthZ: []
119633+
summary: Bulk update security signals
119634+
tags: ["Security Monitoring"]
119635+
x-codegen-request-body-name: body
119636+
"x-permission":
119637+
operator: OR
119638+
permissions:
119639+
- security_monitoring_signals_write
119536119640
/api/v2/security_monitoring/signals/search:
119537119641
post:
119538119642
description: |-
@@ -119855,6 +119959,58 @@ paths:
119855119959
permissions:
119856119960
- security_monitoring_rules_read
119857119961
- security_monitoring_signals_read
119962+
/api/v2/security_monitoring/signals/{signal_id}/update:
119963+
patch:
119964+
description: |-
119965+
Update the triage state or assignee of a security signal.
119966+
operationId: EditSecurityMonitoringSignal
119967+
parameters:
119968+
- $ref: "#/components/parameters/SignalID"
119969+
requestBody:
119970+
content:
119971+
application/json:
119972+
schema:
119973+
$ref: "#/components/schemas/SecurityMonitoringSignalUpdateRequest"
119974+
description: Attributes describing the signal triage state or assignee update.
119975+
required: true
119976+
responses:
119977+
"200":
119978+
content:
119979+
application/json:
119980+
schema:
119981+
$ref: "#/components/schemas/SecurityMonitoringSignalTriageUpdateResponse"
119982+
description: OK
119983+
"400":
119984+
content:
119985+
application/json:
119986+
schema:
119987+
$ref: "#/components/schemas/JSONAPIErrorResponse"
119988+
description: Bad Request
119989+
"403":
119990+
content:
119991+
application/json:
119992+
schema:
119993+
$ref: "#/components/schemas/JSONAPIErrorResponse"
119994+
description: Forbidden
119995+
"404":
119996+
content:
119997+
application/json:
119998+
schema:
119999+
$ref: "#/components/schemas/JSONAPIErrorResponse"
120000+
description: Not Found
120001+
"429":
120002+
$ref: "#/components/responses/TooManyRequestsResponse"
120003+
security:
120004+
- apiKeyAuth: []
120005+
appKeyAuth: []
120006+
- AuthZ: []
120007+
summary: Update security signal triage state or assignee
120008+
tags: ["Security Monitoring"]
120009+
x-codegen-request-body-name: body
120010+
"x-permission":
120011+
operator: OR
120012+
permissions:
120013+
- security_monitoring_signals_write
119858120014
/api/v2/security_monitoring/terraform/{resource_type}/bulk:
119859120015
post:
119860120016
description: |-
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Bulk update security signals returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
9+
10+
const params: v2.SecurityMonitoringApiBulkEditSecurityMonitoringSignalsRequest =
11+
{
12+
body: {
13+
data: [
14+
{
15+
attributes: {
16+
archiveReason: "none",
17+
assignee: {
18+
uuid: "773b045d-ccf8-4808-bd3b-955ef6a8c940",
19+
},
20+
state: "open",
21+
},
22+
id: "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA",
23+
type: "signal",
24+
},
25+
],
26+
},
27+
};
28+
29+
apiInstance
30+
.bulkEditSecurityMonitoringSignals(params)
31+
.then((data: v2.SecurityMonitoringSignalsBulkTriageUpdateResponse) => {
32+
console.log(
33+
"API called successfully. Returned data: " + JSON.stringify(data)
34+
);
35+
})
36+
.catch((error: any) => console.error(error));
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Update security signal triage state or assignee returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SecurityMonitoringApi(configuration);
9+
10+
const params: v2.SecurityMonitoringApiEditSecurityMonitoringSignalRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
archiveReason: "none",
15+
assignee: {
16+
uuid: "773b045d-ccf8-4808-bd3b-955ef6a8c940",
17+
},
18+
state: "open",
19+
},
20+
type: "signal_metadata",
21+
},
22+
},
23+
signalId: "signal_id",
24+
};
25+
26+
apiInstance
27+
.editSecurityMonitoringSignal(params)
28+
.then((data: v2.SecurityMonitoringSignalTriageUpdateResponse) => {
29+
console.log(
30+
"API called successfully. Returned data: " + JSON.stringify(data)
31+
);
32+
})
33+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5487,6 +5487,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
54875487
},
54885488
"operationResponseType": "SecurityMonitoringSignalsBulkTriageUpdateResponse",
54895489
},
5490+
"v2.BulkEditSecurityMonitoringSignals": {
5491+
"body": {
5492+
"type": "SecurityMonitoringSignalsBulkUpdateRequest",
5493+
"format": "",
5494+
},
5495+
"operationResponseType": "SecurityMonitoringSignalsBulkTriageUpdateResponse",
5496+
},
54905497
"v2.SearchSecurityMonitoringSignals": {
54915498
"body": {
54925499
"type": "SecurityMonitoringSignalListRequest",
@@ -5548,6 +5555,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
55485555
},
55495556
"operationResponseType": "SecurityMonitoringSignalSuggestedActionsResponse",
55505557
},
5558+
"v2.EditSecurityMonitoringSignal": {
5559+
"signalId": {
5560+
"type": "string",
5561+
"format": "",
5562+
},
5563+
"body": {
5564+
"type": "SecurityMonitoringSignalUpdateRequest",
5565+
"format": "",
5566+
},
5567+
"operationResponseType": "SecurityMonitoringSignalTriageUpdateResponse",
5568+
},
55515569
"v2.BulkExportSecurityMonitoringTerraformResources": {
55525570
"resourceType": {
55535571
"type": "SecurityMonitoringTerraformResourceType",

features/v2/security_monitoring.feature

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ Feature: Security Monitoring
121121
When the request is sent
122122
Then the response status is 200 OK
123123

124+
@skip @team:DataDog/k9-cloud-siem
125+
Scenario: Bulk update security signals returns "Bad Request" response
126+
Given new "BulkEditSecurityMonitoringSignals" request
127+
And body with value {"data": [{"attributes": {"archive_reason": "none", "assignee": {"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}, "state": "open"}, "id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", "type": "signal"}]}
128+
When the request is sent
129+
Then the response status is 400 Bad Request
130+
131+
@skip @team:DataDog/k9-cloud-siem
132+
Scenario: Bulk update security signals returns "OK" response
133+
Given new "BulkEditSecurityMonitoringSignals" request
134+
And body with value {"data": [{"attributes": {"archive_reason": "none", "assignee": {"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}, "state": "open"}, "id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA", "type": "signal"}]}
135+
When the request is sent
136+
Then the response status is 200 OK
137+
124138
@skip @team:DataDog/k9-cloud-siem
125139
Scenario: Bulk update triage assignee of security signals returns "Bad Request" response
126140
Given operation "BulkEditSecurityMonitoringSignalsAssignee" enabled
@@ -2232,6 +2246,30 @@ Feature: Security Monitoring
22322246
When the request is sent
22332247
Then the response status is 201 OK
22342248

2249+
@skip @team:DataDog/k9-cloud-siem
2250+
Scenario: Update security signal triage state or assignee returns "Bad Request" response
2251+
Given new "EditSecurityMonitoringSignal" request
2252+
And request contains "signal_id" parameter from "REPLACE.ME"
2253+
And body with value {"data": {"attributes": {"archive_reason": "none", "assignee": {"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}, "state": "open"}, "type": "signal_metadata"}}
2254+
When the request is sent
2255+
Then the response status is 400 Bad Request
2256+
2257+
@skip @team:DataDog/k9-cloud-siem
2258+
Scenario: Update security signal triage state or assignee returns "Not Found" response
2259+
Given new "EditSecurityMonitoringSignal" request
2260+
And request contains "signal_id" parameter from "REPLACE.ME"
2261+
And body with value {"data": {"attributes": {"archive_reason": "none", "assignee": {"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}, "state": "open"}, "type": "signal_metadata"}}
2262+
When the request is sent
2263+
Then the response status is 404 Not Found
2264+
2265+
@skip @team:DataDog/k9-cloud-siem
2266+
Scenario: Update security signal triage state or assignee returns "OK" response
2267+
Given new "EditSecurityMonitoringSignal" request
2268+
And request contains "signal_id" parameter from "REPLACE.ME"
2269+
And body with value {"data": {"attributes": {"archive_reason": "none", "assignee": {"uuid": "773b045d-ccf8-4808-bd3b-955ef6a8c940"}, "state": "open"}, "type": "signal_metadata"}}
2270+
When the request is sent
2271+
Then the response status is 200 OK
2272+
22352273
@skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-typescript @skip-validation @team:DataDog/k9-cloud-siem
22362274
Scenario: Validate a detection rule returns "Bad Request" response
22372275
Given new "ValidateSecurityMonitoringRule" request

features/v2/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5699,6 +5699,12 @@
56995699
"type": "idempotent"
57005700
}
57015701
},
5702+
"BulkEditSecurityMonitoringSignals": {
5703+
"tag": "Security Monitoring",
5704+
"undo": {
5705+
"type": "idempotent"
5706+
}
5707+
},
57025708
"SearchSecurityMonitoringSignals": {
57035709
"tag": "Security Monitoring",
57045710
"undo": {
@@ -5741,6 +5747,12 @@
57415747
"type": "safe"
57425748
}
57435749
},
5750+
"EditSecurityMonitoringSignal": {
5751+
"tag": "Security Monitoring",
5752+
"undo": {
5753+
"type": "idempotent"
5754+
}
5755+
},
57445756
"BulkExportSecurityMonitoringTerraformResources": {
57455757
"tag": "Security Monitoring",
57465758
"undo": {

0 commit comments

Comments
 (0)