Skip to content

Commit a4a0a50

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 216c60c of spec repo
1 parent 230311f commit a4a0a50

File tree

9 files changed

+586
-0
lines changed

9 files changed

+586
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63779,6 +63779,65 @@ paths:
6377963779
tags:
6378063780
- Security Monitoring
6378163781
x-codegen-request-body-name: body
63782+
/api/v2/security_monitoring/configuration/suppressions/rules:
63783+
post:
63784+
description: Get the list of suppressions that would affect a rule.
63785+
operationId: GetSuppressionsAffectingFutureRule
63786+
requestBody:
63787+
content:
63788+
application/json:
63789+
schema:
63790+
$ref: '#/components/schemas/SecurityMonitoringRuleCreatePayload'
63791+
required: true
63792+
responses:
63793+
'200':
63794+
content:
63795+
application/json:
63796+
schema:
63797+
$ref: '#/components/schemas/SecurityMonitoringSuppressionsResponse'
63798+
description: OK
63799+
'400':
63800+
$ref: '#/components/responses/BadRequestResponse'
63801+
'403':
63802+
$ref: '#/components/responses/NotAuthorizedResponse'
63803+
'429':
63804+
$ref: '#/components/responses/TooManyRequestsResponse'
63805+
security:
63806+
- apiKeyAuth: []
63807+
appKeyAuth: []
63808+
- AuthZ:
63809+
- security_monitoring_suppressions_read
63810+
summary: Get suppressions affecting future rule
63811+
tags:
63812+
- Security Monitoring
63813+
/api/v2/security_monitoring/configuration/suppressions/rules/{rule_id}:
63814+
get:
63815+
description: Get the list of suppressions that affect a specific existing rule
63816+
by its ID.
63817+
operationId: GetSuppressionsAffectingRule
63818+
parameters:
63819+
- $ref: '#/components/parameters/SecurityMonitoringRuleID'
63820+
responses:
63821+
'200':
63822+
content:
63823+
application/json:
63824+
schema:
63825+
$ref: '#/components/schemas/SecurityMonitoringSuppressionsResponse'
63826+
description: OK
63827+
'403':
63828+
$ref: '#/components/responses/NotAuthorizedResponse'
63829+
'404':
63830+
$ref: '#/components/responses/NotFoundResponse'
63831+
'429':
63832+
$ref: '#/components/responses/TooManyRequestsResponse'
63833+
security:
63834+
- apiKeyAuth: []
63835+
appKeyAuth: []
63836+
- AuthZ:
63837+
- security_monitoring_suppressions_read
63838+
summary: Get suppressions affecting a specific rule
63839+
tags:
63840+
- Security Monitoring
6378263841
/api/v2/security_monitoring/configuration/suppressions/{suppression_id}:
6378363842
delete:
6378463843
description: Delete a specific suppression rule.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
/**
2+
* Get suppressions affecting future rule 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.SecurityMonitoringApiGetSuppressionsAffectingFutureRuleRequest =
11+
{
12+
body: {
13+
calculatedFields: [
14+
{
15+
expression: "@request_end_timestamp - @request_start_timestamp",
16+
name: "response_time",
17+
},
18+
],
19+
cases: [],
20+
filters: [
21+
{
22+
action: "require",
23+
},
24+
],
25+
groupSignalsBy: ["service"],
26+
hasExtendedTitle: true,
27+
isEnabled: true,
28+
message: "",
29+
name: "My security monitoring rule.",
30+
options: {
31+
complianceRuleOptions: {
32+
regoRule: {
33+
policy: `package datadog
34+
35+
import data.datadog.output as dd_output
36+
import future.keywords.contains
37+
import future.keywords.if
38+
import future.keywords.in
39+
40+
eval(resource) = "skip" if {
41+
# Logic that evaluates to true if the resource should be skipped
42+
true
43+
} else = "pass" {
44+
# Logic that evaluates to true if the resource is compliant
45+
true
46+
} else = "fail" {
47+
# Logic that evaluates to true if the resource is not compliant
48+
true
49+
}
50+
51+
# This part remains unchanged for all rules
52+
results contains result if {
53+
some resource in input.resources[input.main_resource_type]
54+
result := dd_output.format(resource, eval(resource))
55+
}
56+
`,
57+
resourceTypes: ["gcp_iam_service_account", "gcp_iam_policy"],
58+
},
59+
resourceType: "aws_acm",
60+
},
61+
decreaseCriticalityBasedOnEnv: false,
62+
detectionMethod: "threshold",
63+
evaluationWindow: 0,
64+
hardcodedEvaluatorType: "log4shell",
65+
impossibleTravelOptions: {
66+
baselineUserLocations: true,
67+
},
68+
keepAlive: 0,
69+
maxSignalDuration: 0,
70+
newValueOptions: {
71+
forgetAfter: 1,
72+
learningDuration: 0,
73+
learningMethod: "duration",
74+
learningThreshold: 0,
75+
},
76+
thirdPartyRuleOptions: {
77+
defaultNotifications: [],
78+
defaultStatus: "critical",
79+
rootQueries: [
80+
{
81+
groupByFields: [],
82+
query: "source:cloudtrail",
83+
},
84+
],
85+
},
86+
},
87+
queries: [],
88+
referenceTables: [{}],
89+
schedulingOptions: {
90+
rrule: "FREQ=HOURLY;INTERVAL=1;",
91+
start: "2025-07-14T12:00:00",
92+
timezone: "America/New_York",
93+
},
94+
tags: ["env:prod", "team:security"],
95+
thirdPartyCases: [],
96+
type: "api_security",
97+
},
98+
};
99+
100+
apiInstance
101+
.getSuppressionsAffectingFutureRule(params)
102+
.then((data: v2.SecurityMonitoringSuppressionsResponse) => {
103+
console.log(
104+
"API called successfully. Returned data: " + JSON.stringify(data)
105+
);
106+
})
107+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Get suppressions affecting a specific rule 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.SecurityMonitoringApiGetSuppressionsAffectingRuleRequest = {
11+
ruleId: "rule_id",
12+
};
13+
14+
apiInstance
15+
.getSuppressionsAffectingRule(params)
16+
.then((data: v2.SecurityMonitoringSuppressionsResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3881,6 +3881,20 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
38813881
},
38823882
"operationResponseType": "SecurityMonitoringSuppressionResponse",
38833883
},
3884+
"v2.GetSuppressionsAffectingFutureRule": {
3885+
"body": {
3886+
"type": "SecurityMonitoringRuleCreatePayload",
3887+
"format": "",
3888+
},
3889+
"operationResponseType": "SecurityMonitoringSuppressionsResponse",
3890+
},
3891+
"v2.GetSuppressionsAffectingRule": {
3892+
"ruleId": {
3893+
"type": "string",
3894+
"format": "",
3895+
},
3896+
"operationResponseType": "SecurityMonitoringSuppressionsResponse",
3897+
},
38843898
"v2.GetSecurityMonitoringSuppression": {
38853899
"suppressionId": {
38863900
"type": "string",

features/v2/security_monitoring.feature

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,34 @@ Feature: Security Monitoring
822822
And the response "data.attributes.count" is equal to 1
823823
And the response "data.attributes.data[1].rule.name" has the same value as "security_rule.name"
824824

825+
@generated @skip @team:DataDog/k9-cloud-security-platform
826+
Scenario: Get suppressions affecting a specific rule returns "Not Found" response
827+
Given new "GetSuppressionsAffectingRule" request
828+
And request contains "rule_id" parameter from "REPLACE.ME"
829+
When the request is sent
830+
Then the response status is 404 Not Found
831+
832+
@generated @skip @team:DataDog/k9-cloud-security-platform
833+
Scenario: Get suppressions affecting a specific rule returns "OK" response
834+
Given new "GetSuppressionsAffectingRule" request
835+
And request contains "rule_id" parameter from "REPLACE.ME"
836+
When the request is sent
837+
Then the response status is 200 OK
838+
839+
@skip @team:DataDog/k9-cloud-security-platform
840+
Scenario: Get suppressions affecting future rule returns "Bad Request" response
841+
Given new "GetSuppressionsAffectingFutureRule" request
842+
And body from file "security_monitoring_future_rule_surpression_payload.json"
843+
When the request is sent
844+
Then the response status is 400 Bad Request
845+
846+
@skip @team:DataDog/k9-cloud-security-platform
847+
Scenario: Get suppressions affecting future rule returns "OK" response
848+
Given new "GetSuppressionsAffectingFutureRule" request
849+
And body from file "security_monitoring_future_rule_surpression_payload.json"
850+
When the request is sent
851+
Then the response status is 200 OK
852+
825853
@team:DataDog/cloud-security-posture-management
826854
Scenario: Get the list of signal-based notification rules returns "The list of notification rules." response
827855
Given there is a valid "valid_signal_notification_rule" in the system
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"calculatedFields": [
3+
{
4+
"expression": "@request_end_timestamp - @request_start_timestamp",
5+
"name": "response_time"
6+
}
7+
],
8+
"cases": [],
9+
"filters": [
10+
{
11+
"action": "require"
12+
}
13+
],
14+
"groupSignalsBy": [
15+
"service"
16+
],
17+
"hasExtendedTitle": true,
18+
"isEnabled": true,
19+
"message": "",
20+
"name": "My security monitoring rule.",
21+
"options": {
22+
"complianceRuleOptions": {
23+
"regoRule": {
24+
"policy": "package datadog\n\nimport data.datadog.output as dd_output\nimport future.keywords.contains\nimport future.keywords.if\nimport future.keywords.in\n\neval(resource) = \"skip\" if {\n # Logic that evaluates to true if the resource should be skipped\n true\n} else = \"pass\" {\n # Logic that evaluates to true if the resource is compliant\n true\n} else = \"fail\" {\n # Logic that evaluates to true if the resource is not compliant\n true\n}\n\n# This part remains unchanged for all rules\nresults contains result if {\n some resource in input.resources[input.main_resource_type]\n result := dd_output.format(resource, eval(resource))\n}\n",
25+
"resourceTypes": [
26+
"gcp_iam_service_account",
27+
"gcp_iam_policy"
28+
]
29+
},
30+
"resourceType": "aws_acm"
31+
},
32+
"decreaseCriticalityBasedOnEnv": false,
33+
"detectionMethod": "threshold",
34+
"evaluationWindow": 0,
35+
"hardcodedEvaluatorType": "log4shell",
36+
"impossibleTravelOptions": {
37+
"baselineUserLocations": true
38+
},
39+
"keepAlive": 0,
40+
"maxSignalDuration": 0,
41+
"newValueOptions": {
42+
"forgetAfter": 1,
43+
"learningDuration": 0,
44+
"learningMethod": "duration",
45+
"learningThreshold": 0
46+
},
47+
"thirdPartyRuleOptions": {
48+
"defaultNotifications": [],
49+
"defaultStatus": "critical",
50+
"rootQueries": [
51+
{
52+
"groupByFields": [],
53+
"query": "source:cloudtrail"
54+
}
55+
]
56+
}
57+
},
58+
"queries": [],
59+
"referenceTables": [
60+
{}
61+
],
62+
"schedulingOptions": {
63+
"rrule": "FREQ=HOURLY;INTERVAL=1;",
64+
"start": "2025-07-14T12:00:00",
65+
"timezone": "America/New_York"
66+
},
67+
"tags": [
68+
"env:prod",
69+
"team:security"
70+
],
71+
"thirdPartyCases": [],
72+
"type": "api_security"
73+
}

features/v2/undo.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,6 +2988,18 @@
29882988
"type": "unsafe"
29892989
}
29902990
},
2991+
"GetSuppressionsAffectingFutureRule": {
2992+
"tag": "Security Monitoring",
2993+
"undo": {
2994+
"type": "safe"
2995+
}
2996+
},
2997+
"GetSuppressionsAffectingRule": {
2998+
"tag": "Security Monitoring",
2999+
"undo": {
3000+
"type": "safe"
3001+
}
3002+
},
29913003
"DeleteSecurityMonitoringSuppression": {
29923004
"tag": "Security Monitoring",
29933005
"undo": {

0 commit comments

Comments
 (0)