Skip to content

Commit 0132b06

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add support for new CRUD agent rules endpoints (#1545)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 196d689 commit 0132b06

File tree

65 files changed

+2928
-318
lines changed

Some content is hidden

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

65 files changed

+2928
-318
lines changed

.apigentools-info

+4-4
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-03-07 17:19:33.694024",
8-
"spec_repo_commit": "52e6d7fb"
7+
"regenerated": "2024-03-08 14:49:41.084247",
8+
"spec_repo_commit": "f5ed7e52"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-03-07 17:19:33.710260",
13-
"spec_repo_commit": "52e6d7fb"
12+
"regenerated": "2024-03-08 14:49:41.101800",
13+
"spec_repo_commit": "f5ed7e52"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+184
Original file line numberDiff line numberDiff line change
@@ -3919,9 +3919,27 @@ components:
39193919
type: string
39203920
x-enum-varnames:
39213921
- CLOUD_COST_ACTIVITY
3922+
CloudWorkloadSecurityAgentRuleAction:
3923+
description: The action the rule can perform if triggered.
3924+
properties:
3925+
filter:
3926+
description: SECL expression used to target the container to apply the action
3927+
on
3928+
type: string
3929+
kill:
3930+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleKill'
3931+
type: object
3932+
CloudWorkloadSecurityAgentRuleActions:
3933+
description: The array of actions the rule can perform if triggered.
3934+
items:
3935+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleAction'
3936+
nullable: true
3937+
type: array
39223938
CloudWorkloadSecurityAgentRuleAttributes:
39233939
description: A Cloud Workload Security Agent rule returned by the API.
39243940
properties:
3941+
actions:
3942+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleActions'
39253943
agentConstraint:
39263944
description: The version of the agent.
39273945
type: string
@@ -4054,6 +4072,17 @@ components:
40544072
type:
40554073
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType'
40564074
type: object
4075+
CloudWorkloadSecurityAgentRuleID:
4076+
description: The ID of the agent rule.
4077+
example: 3dd-0uc-h1s
4078+
type: string
4079+
CloudWorkloadSecurityAgentRuleKill:
4080+
description: Kill system call applied on the container matching the rule
4081+
properties:
4082+
signal:
4083+
description: Supported signals for the kill system call.
4084+
type: string
4085+
type: object
40574086
CloudWorkloadSecurityAgentRuleResponse:
40584087
description: Response object that includes an Agent rule.
40594088
properties:
@@ -4090,6 +4119,8 @@ components:
40904119
properties:
40914120
attributes:
40924121
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateAttributes'
4122+
id:
4123+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleID'
40934124
type:
40944125
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleType'
40954126
required:
@@ -29582,6 +29613,154 @@ paths:
2958229613
We are gradually onboarding support for more sources. If you have any
2958329614

2958429615
feedback, contact [Datadog Support](https://docs.datadoghq.com/help/).'
29616+
/api/v2/remote_config/products/cws/agent_rules:
29617+
get:
29618+
description: Get the list of Cloud Security Management Threats Agent rules.
29619+
operationId: ListCSMThreatsAgentRules
29620+
responses:
29621+
'200':
29622+
content:
29623+
application/json:
29624+
schema:
29625+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRulesListResponse'
29626+
description: OK
29627+
'403':
29628+
$ref: '#/components/responses/NotAuthorizedResponse'
29629+
'429':
29630+
$ref: '#/components/responses/TooManyRequestsResponse'
29631+
summary: Get all CSM Threats Agent rules
29632+
tags:
29633+
- Cloud Workload Security
29634+
post:
29635+
description: Create a new Cloud Security Management Threats Agent rule with
29636+
the given parameters.
29637+
operationId: CreateCSMThreatsAgentRule
29638+
requestBody:
29639+
content:
29640+
application/json:
29641+
schema:
29642+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleCreateRequest'
29643+
description: The definition of the new Agent rule.
29644+
required: true
29645+
responses:
29646+
'200':
29647+
content:
29648+
application/json:
29649+
schema:
29650+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse'
29651+
description: OK
29652+
'400':
29653+
$ref: '#/components/responses/BadRequestResponse'
29654+
'403':
29655+
$ref: '#/components/responses/NotAuthorizedResponse'
29656+
'409':
29657+
$ref: '#/components/responses/ConflictResponse'
29658+
'429':
29659+
$ref: '#/components/responses/TooManyRequestsResponse'
29660+
summary: Create a CSM Threats Agent rule
29661+
tags:
29662+
- Cloud Workload Security
29663+
x-codegen-request-body-name: body
29664+
/api/v2/remote_config/products/cws/agent_rules/{agent_rule_id}:
29665+
delete:
29666+
description: Delete a specific Cloud Security Management Threats Agent rule.
29667+
operationId: DeleteCSMThreatsAgentRule
29668+
parameters:
29669+
- $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID'
29670+
responses:
29671+
'204':
29672+
description: OK
29673+
'403':
29674+
$ref: '#/components/responses/NotAuthorizedResponse'
29675+
'404':
29676+
$ref: '#/components/responses/NotFoundResponse'
29677+
'429':
29678+
$ref: '#/components/responses/TooManyRequestsResponse'
29679+
summary: Delete a CSM Threats Agent rule
29680+
tags:
29681+
- Cloud Workload Security
29682+
get:
29683+
description: Get the details of a specific Cloud Security Management Threats
29684+
Agent rule.
29685+
operationId: GetCSMThreatsAgentRule
29686+
parameters:
29687+
- $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID'
29688+
responses:
29689+
'200':
29690+
content:
29691+
application/json:
29692+
schema:
29693+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse'
29694+
description: OK
29695+
'403':
29696+
$ref: '#/components/responses/NotAuthorizedResponse'
29697+
'404':
29698+
$ref: '#/components/responses/NotFoundResponse'
29699+
'429':
29700+
$ref: '#/components/responses/TooManyRequestsResponse'
29701+
summary: Get a CSM Threats Agent rule
29702+
tags:
29703+
- Cloud Workload Security
29704+
patch:
29705+
description: 'Update a specific Cloud Security Management Threats Agent rule.
29706+
29707+
Returns the Agent rule object when the request is successful.'
29708+
operationId: UpdateCSMThreatsAgentRule
29709+
parameters:
29710+
- $ref: '#/components/parameters/CloudWorkloadSecurityAgentRuleID'
29711+
requestBody:
29712+
content:
29713+
application/json:
29714+
schema:
29715+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateRequest'
29716+
description: New definition of the Agent rule.
29717+
required: true
29718+
responses:
29719+
'200':
29720+
content:
29721+
application/json:
29722+
schema:
29723+
$ref: '#/components/schemas/CloudWorkloadSecurityAgentRuleResponse'
29724+
description: OK
29725+
'400':
29726+
$ref: '#/components/responses/BadRequestResponse'
29727+
'403':
29728+
$ref: '#/components/responses/NotAuthorizedResponse'
29729+
'404':
29730+
$ref: '#/components/responses/NotFoundResponse'
29731+
'409':
29732+
$ref: '#/components/responses/ConcurrentModificationResponse'
29733+
'429':
29734+
$ref: '#/components/responses/TooManyRequestsResponse'
29735+
summary: Update a CSM Threats Agent rule
29736+
tags:
29737+
- Cloud Workload Security
29738+
x-codegen-request-body-name: body
29739+
/api/v2/remote_config/products/cws/policy/download:
29740+
get:
29741+
description: 'The download endpoint generates a CSM Threats policy file from
29742+
your currently active
29743+
29744+
CSM Threats rules, and downloads them as a `.policy` file. This file can then
29745+
be deployed to
29746+
29747+
your Agents to update the policy running in your environment.'
29748+
operationId: DownloadCSMThreatsPolicy
29749+
responses:
29750+
'200':
29751+
content:
29752+
application/zip:
29753+
schema:
29754+
format: binary
29755+
type: string
29756+
description: OK
29757+
'403':
29758+
$ref: '#/components/responses/NotAuthorizedResponse'
29759+
'429':
29760+
$ref: '#/components/responses/TooManyRequestsResponse'
29761+
summary: Get the latest CSM Threats policy
29762+
tags:
29763+
- Cloud Workload Security
2958529764
/api/v2/restriction_policy/{resource_id}:
2958629765
delete:
2958729766
description: Deletes the restriction policy associated with a specified resource.
@@ -34821,6 +35000,11 @@ tags:
3482135000
[Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more
3482235001
information.
3482335002
name: CI Visibility Tests
35003+
- description: Cloud Security Management Threats (CSM Threats) monitors file, network,
35004+
and process activity across your environment to detect real-time threats to your
35005+
infrastructure. See [Cloud Security Management Threats](https://docs.datadoghq.com/security/threats/)
35006+
for more information on setting up CSM Threats.
35007+
name: CSM Threats
3482435008
- description: View and manage cases and projects within Case Management. See the
3482535009
[Case Management page](https://docs.datadoghq.com/service_management/case_management/)
3482635010
for more information.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-03-08T14:19:01.846Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"log": {
3+
"_recordingName": "Cloud Workload Security/Create a CSM Threats Agent rule returns \"Bad Request\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "6.0.5"
8+
},
9+
"entries": [
10+
{
11+
"_id": "0a69f86145855ad31f75cec2b61dc38b",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 149,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 598,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"description\":\"My Agent rule\",\"enabled\":true,\"expression\":\"exec.file.name == sh\",\"name\":\"my_agent_rule\"},\"type\":\"agent_rule\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules"
39+
},
40+
"response": {
41+
"bodySize": 142,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 142,
45+
"text": "{\"errors\":[\"input_validation_error(Field 'expression' is invalid: rule `my_agent_rule` error: rule compilation error: field `sh` not found)\"]}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 217,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 400,
58+
"statusText": "Bad Request"
59+
},
60+
"startedDateTime": "2024-03-08T14:19:01.854Z",
61+
"time": 480
62+
}
63+
],
64+
"pages": [],
65+
"version": "1.2"
66+
}
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2024-03-06T09:58:37.695Z"

0 commit comments

Comments
 (0)