Skip to content

Commit ff6f9e2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add suppression tags (#2939)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f433790 commit ff6f9e2

15 files changed

+110
-64
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46991,6 +46991,14 @@ components:
4699146991
the queries to search signals in the signal explorer.
4699246992
example: env:staging status:low
4699346993
type: string
46994+
tags:
46995+
description: List of tags associated with the suppression rule.
46996+
example:
46997+
- technique:T1110-brute-force
46998+
- source:cloudtrail
46999+
items:
47000+
type: string
47001+
type: array
4699447002
update_date:
4699547003
description: A Unix millisecond timestamp given the update date of the suppression
4699647004
rule.
@@ -47052,6 +47060,14 @@ components:
4705247060
same syntax as the queries to search signals in the Signals Explorer.
4705347061
example: env:staging status:low
4705447062
type: string
47063+
tags:
47064+
description: List of tags associated with the suppression rule.
47065+
example:
47066+
- technique:T1110-brute-force
47067+
- source:cloudtrail
47068+
items:
47069+
type: string
47070+
type: array
4705547071
required:
4705647072
- name
4705747073
- enabled
@@ -47147,6 +47163,14 @@ components:
4714747163
the queries to search signals in the signal explorer.
4714847164
example: env:staging status:low
4714947165
type: string
47166+
tags:
47167+
description: List of tags associated with the suppression rule.
47168+
example:
47169+
- technique:T1110-brute-force
47170+
- source:cloudtrail
47171+
items:
47172+
type: string
47173+
type: array
4715047174
version:
4715147175
description: The current version of the suppression. This is optional, but
4715247176
it can help prevent concurrent modifications.

examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
name="Example-Security-Monitoring",
2626
rule_query="type:log_detection source:cloudtrail",
2727
suppression_query="env:staging status:low",
28+
tags=[
29+
"technique:T1110-brute-force",
30+
"source:cloudtrail",
31+
],
2832
),
2933
type=SecurityMonitoringSuppressionType.SUPPRESSIONS,
3034
),

src/datadog_api_client/v2/model/security_monitoring_suppression_attributes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -40,6 +40,7 @@ def openapi_types(_):
4040
"rule_query": (str,),
4141
"start_date": (int,),
4242
"suppression_query": (str,),
43+
"tags": ([str],),
4344
"update_date": (int,),
4445
"updater": (SecurityMonitoringUser,),
4546
"version": (int,),
@@ -57,6 +58,7 @@ def openapi_types(_):
5758
"rule_query": "rule_query",
5859
"start_date": "start_date",
5960
"suppression_query": "suppression_query",
61+
"tags": "tags",
6062
"update_date": "update_date",
6163
"updater": "updater",
6264
"version": "version",
@@ -75,6 +77,7 @@ def __init__(
7577
rule_query: Union[str, UnsetType] = unset,
7678
start_date: Union[int, UnsetType] = unset,
7779
suppression_query: Union[str, UnsetType] = unset,
80+
tags: Union[List[str], UnsetType] = unset,
7881
update_date: Union[int, UnsetType] = unset,
7982
updater: Union[SecurityMonitoringUser, UnsetType] = unset,
8083
version: Union[int, UnsetType] = unset,
@@ -116,6 +119,9 @@ def __init__(
116119
:param suppression_query: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
117120
:type suppression_query: str, optional
118121
122+
:param tags: List of tags associated with the suppression rule.
123+
:type tags: [str], optional
124+
119125
:param update_date: A Unix millisecond timestamp given the update date of the suppression rule.
120126
:type update_date: int, optional
121127
@@ -147,6 +153,8 @@ def __init__(
147153
kwargs["start_date"] = start_date
148154
if suppression_query is not unset:
149155
kwargs["suppression_query"] = suppression_query
156+
if tags is not unset:
157+
kwargs["tags"] = tags
150158
if update_date is not unset:
151159
kwargs["update_date"] = update_date
152160
if updater is not unset:

src/datadog_api_client/v2/model/security_monitoring_suppression_create_attributes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -25,6 +25,7 @@ def openapi_types(_):
2525
"rule_query": (str,),
2626
"start_date": (int,),
2727
"suppression_query": (str,),
28+
"tags": ([str],),
2829
}
2930

3031
attribute_map = {
@@ -36,6 +37,7 @@ def openapi_types(_):
3637
"rule_query": "rule_query",
3738
"start_date": "start_date",
3839
"suppression_query": "suppression_query",
40+
"tags": "tags",
3941
}
4042

4143
def __init__(
@@ -48,6 +50,7 @@ def __init__(
4850
expiration_date: Union[int, UnsetType] = unset,
4951
start_date: Union[int, UnsetType] = unset,
5052
suppression_query: Union[str, UnsetType] = unset,
53+
tags: Union[List[str], UnsetType] = unset,
5154
**kwargs,
5255
):
5356
"""
@@ -76,6 +79,9 @@ def __init__(
7679
7780
:param suppression_query: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. It uses the same syntax as the queries to search signals in the Signals Explorer.
7881
:type suppression_query: str, optional
82+
83+
:param tags: List of tags associated with the suppression rule.
84+
:type tags: [str], optional
7985
"""
8086
if data_exclusion_query is not unset:
8187
kwargs["data_exclusion_query"] = data_exclusion_query
@@ -87,6 +93,8 @@ def __init__(
8793
kwargs["start_date"] = start_date
8894
if suppression_query is not unset:
8995
kwargs["suppression_query"] = suppression_query
96+
if tags is not unset:
97+
kwargs["tags"] = tags
9098
super().__init__(kwargs)
9199

92100
self_.enabled = enabled

src/datadog_api_client/v2/model/security_monitoring_suppression_update_attributes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -32,6 +32,7 @@ def openapi_types(_):
3232
"rule_query": (str,),
3333
"start_date": (int, none_type),
3434
"suppression_query": (str,),
35+
"tags": ([str],),
3536
"version": (int,),
3637
}
3738

@@ -44,6 +45,7 @@ def openapi_types(_):
4445
"rule_query": "rule_query",
4546
"start_date": "start_date",
4647
"suppression_query": "suppression_query",
48+
"tags": "tags",
4749
"version": "version",
4850
}
4951

@@ -57,6 +59,7 @@ def __init__(
5759
rule_query: Union[str, UnsetType] = unset,
5860
start_date: Union[int, none_type, UnsetType] = unset,
5961
suppression_query: Union[str, UnsetType] = unset,
62+
tags: Union[List[str], UnsetType] = unset,
6063
version: Union[int, UnsetType] = unset,
6164
**kwargs,
6265
):
@@ -87,6 +90,9 @@ def __init__(
8790
:param suppression_query: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer.
8891
:type suppression_query: str, optional
8992
93+
:param tags: List of tags associated with the suppression rule.
94+
:type tags: [str], optional
95+
9096
:param version: The current version of the suppression. This is optional, but it can help prevent concurrent modifications.
9197
:type version: int, optional
9298
"""
@@ -106,6 +112,8 @@ def __init__(
106112
kwargs["start_date"] = start_date
107113
if suppression_query is not unset:
108114
kwargs["suppression_query"] = suppression_query
115+
if tags is not unset:
116+
kwargs["tags"] = tags
109117
if version is not unset:
110118
kwargs["version"] = version
111119
super().__init__(kwargs)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-11-27T15:22:34.711Z
1+
2025-11-07T12:27:25.514Z

tests/v2/cassettes/test_scenarios/test_create_a_suppression_rule_returns_ok_response.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
interactions:
22
- request:
33
body: '{"data":{"attributes":{"description":"This rule suppresses low-severity
4-
signals in staging environments.","enabled":true,"expiration_date":1734535354000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1732720954","rule_query":"type:log_detection
5-
source:cloudtrail","start_date":1733584954000,"suppression_query":"env:staging
6-
status:low"},"type":"suppressions"}}'
4+
signals in staging environments.","enabled":true,"expiration_date":1764332845000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1762518445","rule_query":"type:log_detection
5+
source:cloudtrail","start_date":1763382445000,"suppression_query":"env:staging
6+
status:low","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}'
77
headers:
88
accept:
99
- application/json
@@ -13,10 +13,12 @@ interactions:
1313
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions
1414
response:
1515
body:
16-
string: '{"data":{"id":"ejv-ksi-r4j","type":"suppressions","attributes":{"creation_date":1732720954868,"creator":{"handle":"frog@datadoghq.com","name":""},"data_exclusion_query":"","description":"This
17-
rule suppresses low-severity signals in staging environments.","editable":true,"enabled":true,"expiration_date":1734535354000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1732720954","rule_query":"type:log_detection
18-
source:cloudtrail","start_date":1733584954000,"suppression_query":"env:staging
19-
status:low","update_date":1732720954868,"updater":{"handle":"frog@datadoghq.com","name":""},"version":1}}}'
16+
string: '{"data":{"id":"oxk-jlo-pc8","type":"suppressions","attributes":{"creation_date":1762518446390,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
17+
Account"},"data_exclusion_query":"","description":"This rule suppresses low-severity
18+
signals in staging environments.","editable":true,"enabled":true,"expiration_date":1764332845000,"name":"Test-Create_a_suppression_rule_returns_OK_response-1762518445","rule_query":"type:log_detection
19+
source:cloudtrail","start_date":1763382445000,"suppression_query":"env:staging
20+
status:low","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518446390,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
21+
Account"},"version":1}}}'
2022
headers:
2123
content-type:
2224
- application/vnd.api+json
@@ -29,7 +31,7 @@ interactions:
2931
accept:
3032
- '*/*'
3133
method: DELETE
32-
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ejv-ksi-r4j
34+
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/oxk-jlo-pc8
3335
response:
3436
body:
3537
string: ''
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-05-10T16:34:39.853Z
1+
2025-11-07T12:27:26.759Z

tests/v2/cassettes/test_scenarios/test_delete_a_suppression_rule_returns_ok_response.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"description":"Test-Delete_a_suppression_rule_returns_OK_response-1715358879","enabled":true,"name":"Test-Delete_a_suppression_rule_returns_OK_response-1715358879","rule_query":"source:cloudtrail","suppression_query":"env:test"},"type":"suppressions"}}'
3+
body: '{"data":{"attributes":{"description":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","enabled":true,"name":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,12 +10,12 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions
1111
response:
1212
body:
13-
string: '{"data":{"id":"csf-zrg-af0","attributes":{"name":"Test-Delete_a_suppression_rule_returns_OK_response-1715358879","enabled":true,"description":"Test-Delete_a_suppression_rule_returns_OK_response-1715358879","rule_query":"source:cloudtrail","suppression_query":"env:test","data_exclusion_query":"","version":1,"creation_date":1715358880145,"update_date":1715358880145,"creator":{"name":null,"handle":"frog@datadoghq.com"},"updater":{"name":null,"handle":"frog@datadoghq.com"}},"type":"suppressions"}}
14-
15-
'
13+
string: '{"data":{"id":"uea-lab-big","type":"suppressions","attributes":{"creation_date":1762518447002,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
14+
Account"},"data_exclusion_query":"","description":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","editable":true,"enabled":true,"name":"Test-Delete_a_suppression_rule_returns_OK_response-1762518446","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1762518447002,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
15+
Account"},"version":1}}}'
1616
headers:
1717
content-type:
18-
- application/json
18+
- application/vnd.api+json
1919
status:
2020
code: 200
2121
message: OK
@@ -25,13 +25,11 @@ interactions:
2525
accept:
2626
- '*/*'
2727
method: DELETE
28-
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/csf-zrg-af0
28+
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uea-lab-big
2929
response:
3030
body:
3131
string: ''
32-
headers:
33-
content-type:
34-
- text/html; charset=utf-8
32+
headers: {}
3533
status:
3634
code: 204
3735
message: No Content
@@ -41,12 +39,10 @@ interactions:
4139
accept:
4240
- '*/*'
4341
method: DELETE
44-
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/csf-zrg-af0
42+
uri: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uea-lab-big
4543
response:
4644
body:
47-
string: '{"errors":["not_found(Suppression with ID csf-zrg-af0 not found)"]}
48-
49-
'
45+
string: '{"errors":["not_found(Suppression with ID uea-lab-big not found)"]}'
5046
headers:
5147
content-type:
5248
- application/json
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-05-10T16:34:46.398Z
1+
2025-11-07T12:27:27.654Z

0 commit comments

Comments
 (0)