Skip to content

Commit 0386104

Browse files
Merge branch 'master' into datadog-api-spec/generated/3882
2 parents 3e00a77 + 7bc8c05 commit 0386104

File tree

68 files changed

+2732
-1926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2732
-1926
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": "2025-06-02 13:31:14.108910",
8-
"spec_repo_commit": "a6273f07"
7+
"regenerated": "2025-06-04 09:10:40.335493",
8+
"spec_repo_commit": "6c99bb98"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-02 13:31:14.145494",
13-
"spec_repo_commit": "a6273f07"
12+
"regenerated": "2025-06-04 09:10:40.351166",
13+
"spec_repo_commit": "6c99bb98"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ components:
743743
description: 'Identifier, formatted as `type:id`. Supported types: `connection`,
744744
`dashboard`, `integration-account`, `integration-service`, `integration-webhook`,
745745
`notebook`, `reference-table`, `security-rule`, `slo`, `workflow`, `app-builder-app`,
746-
`connection`, `connection-group`.'
746+
`connection`, `connection-group`, `rum-application`.'
747747
example: dashboard:abc-def-ghi
748748
in: path
749749
name: resource_id
@@ -7526,6 +7526,50 @@ components:
75267526
type: string
75277527
kill:
75287528
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
7529+
metadata:
7530+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionMetadata'
7531+
set:
7532+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActionSet'
7533+
type: object
7534+
CloudWorkloadSecurityAgentRuleActionMetadata:
7535+
description: The metadata action applied on the scope matching the rule
7536+
properties:
7537+
image_tag:
7538+
description: The image tag of the metadata action
7539+
type: string
7540+
service:
7541+
description: The service of the metadata action
7542+
type: string
7543+
short_image:
7544+
description: The short image of the metadata action
7545+
type: string
7546+
type: object
7547+
CloudWorkloadSecurityAgentRuleActionSet:
7548+
description: The set action applied on the scope matching the rule
7549+
properties:
7550+
append:
7551+
description: Whether the value should be appended to the field
7552+
type: boolean
7553+
field:
7554+
description: The field of the set action
7555+
type: string
7556+
name:
7557+
description: The name of the set action
7558+
type: string
7559+
scope:
7560+
description: The scope of the set action
7561+
type: string
7562+
size:
7563+
description: The size of the set action
7564+
format: int64
7565+
type: integer
7566+
ttl:
7567+
description: The time to live of the set action
7568+
format: int64
7569+
type: integer
7570+
value:
7571+
description: The value of the set action
7572+
type: string
75297573
type: object
75307574
CloudWorkloadSecurityAgentRuleActions:
75317575
description: The array of actions the rule can perform if triggered
@@ -7541,6 +7585,11 @@ components:
75417585
agentConstraint:
75427586
description: The version of the Agent
75437587
type: string
7588+
blocking:
7589+
description: The blocking policies that the rule belongs to
7590+
items:
7591+
type: string
7592+
type: array
75447593
category:
75457594
description: The category of the Agent rule
75467595
example: Process Activity
@@ -7564,6 +7613,11 @@ components:
75647613
description: The description of the Agent rule
75657614
example: My Agent rule
75667615
type: string
7616+
disabled:
7617+
description: The disabled policies that the rule belongs to
7618+
items:
7619+
type: string
7620+
type: array
75677621
enabled:
75687622
description: Whether the Agent rule is enabled
75697623
example: true
@@ -7577,6 +7631,11 @@ components:
75777631
items:
75787632
type: string
75797633
type: array
7634+
monitoring:
7635+
description: The monitoring policies that the rule belongs to
7636+
items:
7637+
type: string
7638+
type: array
75807639
name:
75817640
description: The name of the Agent rule
75827641
example: my_agent_rule
@@ -7611,10 +7670,22 @@ components:
76117670
CloudWorkloadSecurityAgentRuleCreateAttributes:
76127671
description: Create a new Cloud Workload Security Agent rule.
76137672
properties:
7673+
actions:
7674+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7675+
blocking:
7676+
description: The blocking policies that the rule belongs to
7677+
items:
7678+
type: string
7679+
type: array
76147680
description:
76157681
description: The description of the Agent rule.
76167682
example: My Agent rule
76177683
type: string
7684+
disabled:
7685+
description: The disabled policies that the rule belongs to
7686+
items:
7687+
type: string
7688+
type: array
76187689
enabled:
76197690
description: Whether the Agent rule is enabled
76207691
example: true
@@ -7628,6 +7699,11 @@ components:
76287699
items:
76297700
type: string
76307701
type: array
7702+
monitoring:
7703+
description: The monitoring policies that the rule belongs to
7704+
items:
7705+
type: string
7706+
type: array
76317707
name:
76327708
description: The name of the Agent rule.
76337709
example: my_agent_rule
@@ -7718,10 +7794,22 @@ components:
77187794
CloudWorkloadSecurityAgentRuleUpdateAttributes:
77197795
description: Update an existing Cloud Workload Security Agent rule
77207796
properties:
7797+
actions:
7798+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
7799+
blocking:
7800+
description: The blocking policies that the rule belongs to
7801+
items:
7802+
type: string
7803+
type: array
77217804
description:
77227805
description: The description of the Agent rule
77237806
example: My Agent rule
77247807
type: string
7808+
disabled:
7809+
description: The disabled policies that the rule belongs to
7810+
items:
7811+
type: string
7812+
type: array
77257813
enabled:
77267814
description: Whether the Agent rule is enabled
77277815
example: true
@@ -7730,6 +7818,11 @@ components:
77307818
description: The SECL expression of the Agent rule
77317819
example: exec.file.name == "sh"
77327820
type: string
7821+
monitoring:
7822+
description: The monitoring policies that the rule belongs to
7823+
items:
7824+
type: string
7825+
type: array
77337826
policy_id:
77347827
description: The ID of the policy where the Agent rule is saved
77357828
example: a8c8e364-6556-434d-b798-a4c23de29c0b
@@ -54255,6 +54348,8 @@ paths:
5425554348

5425654349
- Connection Groups: `connection-group`
5425754350

54351+
- RUM Applications: `rum-application`
54352+
5425854353

5425954354
#### Supported relations for resources
5426054355

@@ -54294,7 +54389,9 @@ paths:
5429454389

5429554390
Connections | `viewer`, `resolver`, `editor`
5429654391

54297-
Connection Groups | `viewer`, `editor`'
54392+
Connection Groups | `viewer`, `editor`
54393+
54394+
RUM Application | `viewer`, `editor`'
5429854395
operationId: UpdateRestrictionPolicy
5429954396
parameters:
5430054397
- $ref: '#/components/parameters/ResourceID'

docs/datadog_api_client.v2.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,6 +2839,20 @@ datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_action mod
28392839
:members:
28402840
:show-inheritance:
28412841

2842+
datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_action\_metadata module
2843+
---------------------------------------------------------------------------------------------
2844+
2845+
.. automodule:: datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata
2846+
:members:
2847+
:show-inheritance:
2848+
2849+
datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_action\_set module
2850+
----------------------------------------------------------------------------------------
2851+
2852+
.. automodule:: datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set
2853+
:members:
2854+
:show-inheritance:
2855+
28422856
datadog\_api\_client.v2.model.cloud\_workload\_security\_agent\_rule\_attributes module
28432857
---------------------------------------------------------------------------------------
28442858

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"""
2+
Create a Workload Protection agent rule with set action returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.csm_threats_api import CSMThreatsApi
8+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action import CloudWorkloadSecurityAgentRuleAction
9+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import (
10+
CloudWorkloadSecurityAgentRuleActionSet,
11+
)
12+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_attributes import (
13+
CloudWorkloadSecurityAgentRuleCreateAttributes,
14+
)
15+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_data import (
16+
CloudWorkloadSecurityAgentRuleCreateData,
17+
)
18+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_request import (
19+
CloudWorkloadSecurityAgentRuleCreateRequest,
20+
)
21+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_type import CloudWorkloadSecurityAgentRuleType
22+
23+
# there is a valid "policy_rc" in the system
24+
POLICY_DATA_ID = environ["POLICY_DATA_ID"]
25+
26+
body = CloudWorkloadSecurityAgentRuleCreateRequest(
27+
data=CloudWorkloadSecurityAgentRuleCreateData(
28+
attributes=CloudWorkloadSecurityAgentRuleCreateAttributes(
29+
description="My Agent rule with set action",
30+
enabled=True,
31+
expression='exec.file.name == "sh"',
32+
filters=[],
33+
name="examplecsmthreat",
34+
policy_id=POLICY_DATA_ID,
35+
product_tags=[],
36+
actions=[
37+
CloudWorkloadSecurityAgentRuleAction(
38+
set=CloudWorkloadSecurityAgentRuleActionSet(
39+
name="test_set",
40+
value="test_value",
41+
scope="process",
42+
),
43+
),
44+
],
45+
),
46+
type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE,
47+
),
48+
)
49+
50+
configuration = Configuration()
51+
with ApiClient(configuration) as api_client:
52+
api_instance = CSMThreatsApi(api_client)
53+
response = api_instance.create_csm_threats_agent_rule(body=body)
54+
55+
print(response)

src/datadog_api_client/v2/api/restriction_policies_api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def delete_restriction_policy(
112112
113113
Deletes the restriction policy associated with a specified resource.
114114
115-
:param resource_id: Identifier, formatted as ``type:id``. Supported types: ``connection`` , ``dashboard`` , ``integration-account`` , ``integration-service`` , ``integration-webhook`` , ``notebook`` , ``reference-table`` , ``security-rule`` , ``slo`` , ``workflow`` , ``app-builder-app`` , ``connection`` , ``connection-group``.
115+
:param resource_id: Identifier, formatted as ``type:id``. Supported types: ``connection`` , ``dashboard`` , ``integration-account`` , ``integration-service`` , ``integration-webhook`` , ``notebook`` , ``reference-table`` , ``security-rule`` , ``slo`` , ``workflow`` , ``app-builder-app`` , ``connection`` , ``connection-group`` , ``rum-application``.
116116
:type resource_id: str
117117
:rtype: None
118118
"""
@@ -129,7 +129,7 @@ def get_restriction_policy(
129129
130130
Retrieves the restriction policy associated with a specified resource.
131131
132-
:param resource_id: Identifier, formatted as ``type:id``. Supported types: ``connection`` , ``dashboard`` , ``integration-account`` , ``integration-service`` , ``integration-webhook`` , ``notebook`` , ``reference-table`` , ``security-rule`` , ``slo`` , ``workflow`` , ``app-builder-app`` , ``connection`` , ``connection-group``.
132+
:param resource_id: Identifier, formatted as ``type:id``. Supported types: ``connection`` , ``dashboard`` , ``integration-account`` , ``integration-service`` , ``integration-webhook`` , ``notebook`` , ``reference-table`` , ``security-rule`` , ``slo`` , ``workflow`` , ``app-builder-app`` , ``connection`` , ``connection-group`` , ``rum-application``.
133133
:type resource_id: str
134134
:rtype: RestrictionPolicyResponse
135135
"""
@@ -170,6 +170,7 @@ def update_restriction_policy(
170170
* App Builder Apps: ``app-builder-app``
171171
* Connections: ``connection``
172172
* Connection Groups: ``connection-group``
173+
* RUM Applications: ``rum-application``
173174
174175
**Supported relations for resources**
175176
@@ -212,9 +213,11 @@ def update_restriction_policy(
212213
- ``viewer`` , ``resolver`` , ``editor``
213214
* - Connection Groups
214215
- ``viewer`` , ``editor``
216+
* - RUM Application
217+
- ``viewer`` , ``editor``
215218
216219
217-
:param resource_id: Identifier, formatted as ``type:id``. Supported types: ``connection`` , ``dashboard`` , ``integration-account`` , ``integration-service`` , ``integration-webhook`` , ``notebook`` , ``reference-table`` , ``security-rule`` , ``slo`` , ``workflow`` , ``app-builder-app`` , ``connection`` , ``connection-group``.
220+
:param resource_id: Identifier, formatted as ``type:id``. Supported types: ``connection`` , ``dashboard`` , ``integration-account`` , ``integration-service`` , ``integration-webhook`` , ``notebook`` , ``reference-table`` , ``security-rule`` , ``slo`` , ``workflow`` , ``app-builder-app`` , ``connection`` , ``connection-group`` , ``rum-application``.
218221
:type resource_id: str
219222
:param body: Restriction policy payload
220223
:type body: RestrictionPolicyUpdateRequest

src/datadog_api_client/v2/model/cloud_workload_security_agent_rule_action.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515

1616
if TYPE_CHECKING:
1717
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_kill import CloudWorkloadSecurityAgentRuleKill
18+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata import (
19+
CloudWorkloadSecurityAgentRuleActionMetadata,
20+
)
21+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import (
22+
CloudWorkloadSecurityAgentRuleActionSet,
23+
)
1824

1925

2026
class CloudWorkloadSecurityAgentRuleAction(ModelNormal):
@@ -23,21 +29,33 @@ def openapi_types(_):
2329
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_kill import (
2430
CloudWorkloadSecurityAgentRuleKill,
2531
)
32+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata import (
33+
CloudWorkloadSecurityAgentRuleActionMetadata,
34+
)
35+
from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import (
36+
CloudWorkloadSecurityAgentRuleActionSet,
37+
)
2638

2739
return {
2840
"filter": (str,),
2941
"kill": (CloudWorkloadSecurityAgentRuleKill,),
42+
"metadata": (CloudWorkloadSecurityAgentRuleActionMetadata,),
43+
"set": (CloudWorkloadSecurityAgentRuleActionSet,),
3044
}
3145

3246
attribute_map = {
3347
"filter": "filter",
3448
"kill": "kill",
49+
"metadata": "metadata",
50+
"set": "set",
3551
}
3652

3753
def __init__(
3854
self_,
3955
filter: Union[str, UnsetType] = unset,
4056
kill: Union[CloudWorkloadSecurityAgentRuleKill, UnsetType] = unset,
57+
metadata: Union[CloudWorkloadSecurityAgentRuleActionMetadata, UnsetType] = unset,
58+
set: Union[CloudWorkloadSecurityAgentRuleActionSet, UnsetType] = unset,
4159
**kwargs,
4260
):
4361
"""
@@ -48,9 +66,19 @@ def __init__(
4866
4967
:param kill: Kill system call applied on the container matching the rule
5068
:type kill: CloudWorkloadSecurityAgentRuleKill, optional
69+
70+
:param metadata: The metadata action applied on the scope matching the rule
71+
:type metadata: CloudWorkloadSecurityAgentRuleActionMetadata, optional
72+
73+
:param set: The set action applied on the scope matching the rule
74+
:type set: CloudWorkloadSecurityAgentRuleActionSet, optional
5175
"""
5276
if filter is not unset:
5377
kwargs["filter"] = filter
5478
if kill is not unset:
5579
kwargs["kill"] = kill
80+
if metadata is not unset:
81+
kwargs["metadata"] = metadata
82+
if set is not unset:
83+
kwargs["set"] = set
5684
super().__init__(kwargs)

0 commit comments

Comments
 (0)