Skip to content

Commit 872fb9e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit bf2881cb of spec repo
1 parent abdeab1 commit 872fb9e

7 files changed

+103
-14
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-04-05 17:05:16.833733",
8-
"spec_repo_commit": "9b7c8967"
7+
"regenerated": "2024-04-08 08:33:24.300875",
8+
"spec_repo_commit": "bf2881cb"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-05 17:05:16.851932",
13-
"spec_repo_commit": "9b7c8967"
12+
"regenerated": "2024-04-08 08:33:24.318332",
13+
"spec_repo_commit": "bf2881cb"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18120,6 +18120,13 @@ components:
1812018120
type: integer
1812118121
creator:
1812218122
$ref: '#/components/schemas/SecurityMonitoringUser'
18123+
data_exclusion_query:
18124+
description: An exclusion query on the input data of the security rules,
18125+
which could be logs, agent events, or other types of data based on the
18126+
security rule. Events matching this query are ignored by the detection
18127+
rules affected by the suppression rule.
18128+
example: source:cloudtrail account_id:12345
18129+
type: string
1812318130
description:
1812418131
description: A description for the suppression rule.
1812518132
example: This rule suppresses low-severity signals in staging environments.
@@ -18168,6 +18175,13 @@ components:
1816818175
description: Object containing the attributes of the suppression rule to be
1816918176
created.
1817018177
properties:
18178+
data_exclusion_query:
18179+
description: An exclusion query on the input data of the security rules,
18180+
which could be logs, agent events, or other types of data based on the
18181+
security rule. Events matching this query are ignored by the detection
18182+
rules affected by the suppression rule.
18183+
example: source:cloudtrail account_id:12345
18184+
type: string
1817118185
description:
1817218186
description: A description for the suppression rule.
1817318187
example: This rule suppresses low-severity signals in staging environments.
@@ -18193,15 +18207,14 @@ components:
1819318207
type: string
1819418208
suppression_query:
1819518209
description: The suppression query of the suppression rule. If a signal
18196-
matches this query, it is suppressed and is not triggered . Same syntax
18210+
matches this query, it is suppressed and is not triggered. Same syntax
1819718211
as the queries to search signals in the signal explorer.
1819818212
example: env:staging status:low
1819918213
type: string
1820018214
required:
1820118215
- name
1820218216
- enabled
1820318217
- rule_query
18204-
- suppression_query
1820518218
type: object
1820618219
SecurityMonitoringSuppressionCreateData:
1820718220
description: Object for a single suppression rule.
@@ -18245,6 +18258,13 @@ components:
1824518258
SecurityMonitoringSuppressionUpdateAttributes:
1824618259
description: The suppression rule properties to be updated.
1824718260
properties:
18261+
data_exclusion_query:
18262+
description: An exclusion query on the input data of the security rules,
18263+
which could be logs, agent events, or other types of data based on the
18264+
security rule. Events matching this query are ignored by the detection
18265+
rules affected by the suppression rule.
18266+
example: source:cloudtrail account_id:12345
18267+
type: string
1824818268
description:
1824918269
description: A description for the suppression rule.
1825018270
example: This rule suppresses low-severity signals in staging environments.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Create a suppression rule with an exclusion query 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.SecurityMonitoringApiCreateSecurityMonitoringSuppressionRequest =
11+
{
12+
body: {
13+
data: {
14+
attributes: {
15+
description:
16+
"This rule suppresses low-severity signals in staging environments.",
17+
enabled: true,
18+
expirationDate: 1703187336000,
19+
name: "Example-Security-Monitoring",
20+
ruleQuery: "type:log_detection source:cloudtrail",
21+
dataExclusionQuery: "account_id:12345",
22+
},
23+
type: "suppressions",
24+
},
25+
},
26+
};
27+
28+
apiInstance
29+
.createSecurityMonitoringSuppression(params)
30+
.then((data: v2.SecurityMonitoringSuppressionResponse) => {
31+
console.log(
32+
"API called successfully. Returned data: " + JSON.stringify(data)
33+
);
34+
})
35+
.catch((error: any) => console.error(error));

features/v2/security_monitoring.feature

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ Feature: Security Monitoring
160160
@generated @skip @team:DataDog/k9-cloud-security-platform
161161
Scenario: Create a suppression rule returns "Bad Request" response
162162
Given new "CreateSecurityMonitoringSuppression" request
163-
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
163+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
164164
When the request is sent
165165
Then the response status is 400 Bad Request
166166

167167
@generated @skip @team:DataDog/k9-cloud-security-platform
168168
Scenario: Create a suppression rule returns "Conflict" response
169169
Given new "CreateSecurityMonitoringSuppression" request
170-
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
170+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
171171
When the request is sent
172172
Then the response status is 409 Conflict
173173

@@ -181,6 +181,17 @@ Feature: Security Monitoring
181181
And the response "data.attributes.enabled" is equal to true
182182
And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail"
183183

184+
@team:DataDog/k9-cloud-security-platform
185+
Scenario: Create a suppression rule with an exclusion query returns "OK" response
186+
Given new "CreateSecurityMonitoringSuppression" request
187+
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}}
188+
When the request is sent
189+
Then the response status is 200 OK
190+
And the response "data.type" is equal to "suppressions"
191+
And the response "data.attributes.enabled" is equal to true
192+
And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail"
193+
And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345"
194+
184195
@skip @team:DataDog/k9-cloud-security-platform
185196
Scenario: Delete a non existing rule returns "Not Found" response
186197
Given new "DeleteSecurityMonitoringRule" request
@@ -547,23 +558,23 @@ Feature: Security Monitoring
547558
Scenario: Update a suppression rule returns "Bad Request" response
548559
Given new "UpdateSecurityMonitoringSuppression" request
549560
And request contains "suppression_id" parameter from "REPLACE.ME"
550-
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
561+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
551562
When the request is sent
552563
Then the response status is 400 Bad Request
553564

554565
@generated @skip @team:DataDog/k9-cloud-security-platform
555566
Scenario: Update a suppression rule returns "Concurrent Modification" response
556567
Given new "UpdateSecurityMonitoringSuppression" request
557568
And request contains "suppression_id" parameter from "REPLACE.ME"
558-
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
569+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
559570
When the request is sent
560571
Then the response status is 409 Concurrent Modification
561572

562573
@generated @skip @team:DataDog/k9-cloud-security-platform
563574
Scenario: Update a suppression rule returns "Not Found" response
564575
Given new "UpdateSecurityMonitoringSuppression" request
565576
And request contains "suppression_id" parameter from "REPLACE.ME"
566-
And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
577+
And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}}
567578
When the request is sent
568579
Then the response status is 404 Not Found
569580

packages/datadog-api-client-v2/models/SecurityMonitoringSuppressionAttributes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ export class SecurityMonitoringSuppressionAttributes {
1919
* A user.
2020
*/
2121
"creator"?: SecurityMonitoringUser;
22+
/**
23+
* An exclusion query on the input data of the security rules, which could be logs, agent events, or other types of data based on the security rule. Events matching this query are ignored by the detection rules affected by the suppression rule.
24+
*/
25+
"dataExclusionQuery"?: string;
2226
/**
2327
* A description for the suppression rule.
2428
*/
@@ -81,6 +85,10 @@ export class SecurityMonitoringSuppressionAttributes {
8185
baseName: "creator",
8286
type: "SecurityMonitoringUser",
8387
},
88+
dataExclusionQuery: {
89+
baseName: "data_exclusion_query",
90+
type: "string",
91+
},
8492
description: {
8593
baseName: "description",
8694
type: "string",

packages/datadog-api-client-v2/models/SecurityMonitoringSuppressionCreateAttributes.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1010
* Object containing the attributes of the suppression rule to be created.
1111
*/
1212
export class SecurityMonitoringSuppressionCreateAttributes {
13+
/**
14+
* An exclusion query on the input data of the security rules, which could be logs, agent events, or other types of data based on the security rule. Events matching this query are ignored by the detection rules affected by the suppression rule.
15+
*/
16+
"dataExclusionQuery"?: string;
1317
/**
1418
* A description for the suppression rule.
1519
*/
@@ -31,9 +35,9 @@ export class SecurityMonitoringSuppressionCreateAttributes {
3135
*/
3236
"ruleQuery": string;
3337
/**
34-
* The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered . Same syntax as the queries to search signals in the signal explorer.
38+
* The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. Same syntax as the queries to search signals in the signal explorer.
3539
*/
36-
"suppressionQuery": string;
40+
"suppressionQuery"?: string;
3741

3842
/**
3943
* A container for additional, undeclared properties.
@@ -51,6 +55,10 @@ export class SecurityMonitoringSuppressionCreateAttributes {
5155
* @ignore
5256
*/
5357
static readonly attributeTypeMap: AttributeTypeMap = {
58+
dataExclusionQuery: {
59+
baseName: "data_exclusion_query",
60+
type: "string",
61+
},
5462
description: {
5563
baseName: "description",
5664
type: "string",
@@ -78,7 +86,6 @@ export class SecurityMonitoringSuppressionCreateAttributes {
7886
suppressionQuery: {
7987
baseName: "suppression_query",
8088
type: "string",
81-
required: true,
8289
},
8390
additionalProperties: {
8491
baseName: "additionalProperties",

packages/datadog-api-client-v2/models/SecurityMonitoringSuppressionUpdateAttributes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1010
* The suppression rule properties to be updated.
1111
*/
1212
export class SecurityMonitoringSuppressionUpdateAttributes {
13+
/**
14+
* An exclusion query on the input data of the security rules, which could be logs, agent events, or other types of data based on the security rule. Events matching this query are ignored by the detection rules affected by the suppression rule.
15+
*/
16+
"dataExclusionQuery"?: string;
1317
/**
1418
* A description for the suppression rule.
1519
*/
@@ -55,6 +59,10 @@ export class SecurityMonitoringSuppressionUpdateAttributes {
5559
* @ignore
5660
*/
5761
static readonly attributeTypeMap: AttributeTypeMap = {
62+
dataExclusionQuery: {
63+
baseName: "data_exclusion_query",
64+
type: "string",
65+
},
5866
description: {
5967
baseName: "description",
6068
type: "string",

0 commit comments

Comments
 (0)