Skip to content

Commit 6ecab09

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Use unique name for CWS rule (#1931)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent c4b4df2 commit 6ecab09

7 files changed

+18
-17
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-03-27 22:12:41.732378",
8-
"spec_repo_commit": "85625198"
7+
"regenerated": "2024-03-28 14:36:49.461010",
8+
"spec_repo_commit": "a462e143"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-03-27 22:12:41.749222",
13-
"spec_repo_commit": "85625198"
12+
"regenerated": "2024-03-28 14:36:49.477858",
13+
"spec_repo_commit": "a462e143"
1414
}
1515
}
1616
}

examples/v2/cloud-workload-security/CreateCSMThreatsAgentRule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
description="My Agent rule",
2222
enabled=True,
2323
expression='exec.file.name == "sh"',
24-
name="my_agent_rule",
24+
name="examplecloudworkloadsecurity",
2525
),
2626
type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE,
2727
),
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-03-08T14:19:01.846Z
1+
2024-03-28T13:57:47.808Z

tests/v2/cassettes/test_scenarios/test_create_a_csm_threats_agent_rule_returns_bad_request_response.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"data":{"attributes":{"description":"My Agent rule","enabled":true,"expression":"exec.file.name
4-
== sh","name":"my_agent_rule"},"type":"agent_rule"}}'
4+
== sh","name":"testcreateacsmthreatsagentrulereturnsbadrequestresponse1711634267"},"type":"agent_rule"}}'
55
headers:
66
accept:
77
- application/json
@@ -12,7 +12,8 @@ interactions:
1212
response:
1313
body:
1414
string: '{"errors":["input_validation_error(Field ''expression'' is invalid:
15-
rule `my_agent_rule` error: rule compilation error: field `sh` not found)"]}'
15+
rule `testcreateacsmthreatsagentrulereturnsbadrequestresponse1711634267` error:
16+
rule compilation error: field `sh` not found)"]}'
1617
headers:
1718
content-type:
1819
- application/json
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-03-08T14:19:02.357Z
1+
2024-03-28T13:57:48.169Z

tests/v2/cassettes/test_scenarios/test_create_a_csm_threats_agent_rule_returns_ok_response.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"data":{"attributes":{"description":"My Agent rule","enabled":true,"expression":"exec.file.name
4-
== \"sh\"","name":"my_agent_rule"},"type":"agent_rule"}}'
4+
== \"sh\"","name":"testcreateacsmthreatsagentrulereturnsokresponse1711634268"},"type":"agent_rule"}}'
55
headers:
66
accept:
77
- application/json
@@ -11,11 +11,11 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules
1212
response:
1313
body:
14-
string: '{"data":{"id":"zer-ow9-d4q","type":"agent_rule","attributes":{"category":"Process
15-
Activity","creationDate":1709907542607,"creator":{"name":"Malo Le Goff","handle":"[email protected]"},"defaultRule":false,"description":"My
14+
string: '{"data":{"id":"kll-o34-int","type":"agent_rule","attributes":{"category":"Process
15+
Activity","creationDate":1711634268228,"creator":{"name":"CI Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"},"defaultRule":false,"description":"My
1616
Agent rule","enabled":true,"expression":"exec.file.name == \"sh\"","filters":["os
17-
== \"linux\""],"name":"my_agent_rule","updateDate":1709907542607,"updater":{"name":"Malo
18-
Le Goff","handle":"[email protected]"}}}}'
17+
== \"linux\""],"name":"testcreateacsmthreatsagentrulereturnsokresponse1711634268","updateDate":1711634268228,"updater":{"name":"CI
18+
Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}}'
1919
headers:
2020
content-type:
2121
- application/json
@@ -28,7 +28,7 @@ interactions:
2828
accept:
2929
- '*/*'
3030
method: DELETE
31-
uri: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/zer-ow9-d4q
31+
uri: https://api.datadoghq.com/api/v2/remote_config/products/cws/agent_rules/kll-o34-int
3232
response:
3333
body:
3434
string: ''

tests/v2/features/cloud_workload_security.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feature: Cloud Workload Security
1313
@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
1414
Scenario: Create a CSM Threats Agent rule returns "Bad Request" response
1515
Given new "CreateCSMThreatsAgentRule" request
16-
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == sh", "name": "my_agent_rule"}, "type": "agent_rule"}}
16+
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == sh", "name": "{{ unique_lower_alnum }}"}, "type": "agent_rule"}}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

@@ -27,7 +27,7 @@ Feature: Cloud Workload Security
2727
@team:DataDog/k9-cloud-security-platform @team:DataDog/k9-cws-backend
2828
Scenario: Create a CSM Threats Agent rule returns "OK" response
2929
Given new "CreateCSMThreatsAgentRule" request
30-
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \"sh\"", "name": "my_agent_rule"}, "type": "agent_rule"}}
30+
And body with value {"data": {"attributes": {"description": "My Agent rule", "enabled": true, "expression": "exec.file.name == \"sh\"", "name": "{{ unique_lower_alnum }}"}, "type": "agent_rule"}}
3131
When the request is sent
3232
Then the response status is 200 OK
3333

0 commit comments

Comments
 (0)