diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5982352a2b..6ee290692d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -248797,86 +248797,7 @@ paths: operator: OR permissions: - security_monitoring_cws_agent_rules_read - post: - description: |- - Create a new agent rule with the given parameters. - - **Note**: This endpoint should only be used for the Government (US1-FED) site. - operationId: CreateCloudWorkloadSecurityAgentRule - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - description: My Agent rule - enabled: true - expression: exec.file.name == "sh" - name: my_agent_rule - type: agent_rule - schema: - $ref: "#/components/schemas/CloudWorkloadSecurityAgentRuleCreateRequest" - description: "The definition of the new agent rule" - required: true - responses: - "200": - content: - "application/json": - examples: - default: - value: - data: - attributes: - description: My Agent rule - enabled: true - expression: exec.file.name == "sh" - name: my_agent_rule - id: abc-123 - type: agent_rule - schema: - $ref: "#/components/schemas/CloudWorkloadSecurityAgentRuleResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "409": - $ref: "#/components/responses/ConflictResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Create a Workload Protection agent rule (US1-FED) - tags: ["CSM Threats"] - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - security_monitoring_cws_agent_rules_write /api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}: - delete: - description: |- - Delete a specific agent rule. - - **Note**: This endpoint should only be used for the Government (US1-FED) site. - operationId: DeleteCloudWorkloadSecurityAgentRule - parameters: - - $ref: "#/components/parameters/CloudWorkloadSecurityAgentRuleID" - responses: - "204": - description: OK - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Delete a Workload Protection agent rule (US1-FED) - tags: ["CSM Threats"] - "x-permission": - operator: OR - permissions: - - security_monitoring_cws_agent_rules_write get: description: |- Get the details of a specific agent rule. @@ -248915,67 +248836,6 @@ paths: operator: OR permissions: - security_monitoring_cws_agent_rules_read - patch: - description: |- - Update a specific agent rule. - Returns the agent rule object when the request is successful. - - **Note**: This endpoint should only be used for the Government (US1-FED) site. - operationId: UpdateCloudWorkloadSecurityAgentRule - parameters: - - $ref: "#/components/parameters/CloudWorkloadSecurityAgentRuleID" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - description: My Agent rule - enabled: true - expression: exec.file.name == "sh" - id: 3dd-0uc-h1s - type: agent_rule - schema: - $ref: "#/components/schemas/CloudWorkloadSecurityAgentRuleUpdateRequest" - description: "New definition of the agent rule" - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - description: My Agent rule - enabled: true - expression: exec.file.name == "sh" - name: my_agent_rule - id: abc-123 - type: agent_rule - schema: - $ref: "#/components/schemas/CloudWorkloadSecurityAgentRuleResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "409": - $ref: "#/components/responses/ConcurrentModificationResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Update a Workload Protection agent rule (US1-FED) - tags: ["CSM Threats"] - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - security_monitoring_cws_agent_rules_write /api/v2/security_monitoring/configuration/critical_assets: get: description: Get the list of all critical assets. diff --git a/examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.py b/examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.py deleted file mode 100644 index 850489fa9a..0000000000 --- a/examples/v2/csm-threats/CreateCloudWorkloadSecurityAgentRule.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -Create a Workload Protection agent rule (US1-FED) returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.csm_threats_api import CSMThreatsApi -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action import CloudWorkloadSecurityAgentRuleAction -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_core_dump import ( - CloudWorkloadSecurityAgentRuleActionCoreDump, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_hash import ( - CloudWorkloadSecurityAgentRuleActionHash, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_log import ( - CloudWorkloadSecurityAgentRuleActionLog, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata import ( - CloudWorkloadSecurityAgentRuleActionMetadata, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_network_filter import ( - CloudWorkloadSecurityAgentRuleActionNetworkFilter, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import ( - CloudWorkloadSecurityAgentRuleActionSet, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_attributes import ( - CloudWorkloadSecurityAgentRuleCreateAttributes, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_data import ( - CloudWorkloadSecurityAgentRuleCreateData, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_create_request import ( - CloudWorkloadSecurityAgentRuleCreateRequest, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_kill import CloudWorkloadSecurityAgentRuleKill -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_type import CloudWorkloadSecurityAgentRuleType - -body = CloudWorkloadSecurityAgentRuleCreateRequest( - data=CloudWorkloadSecurityAgentRuleCreateData( - attributes=CloudWorkloadSecurityAgentRuleCreateAttributes( - actions=[ - CloudWorkloadSecurityAgentRuleAction( - coredump=CloudWorkloadSecurityAgentRuleActionCoreDump(), - disabled=False, - hash=CloudWorkloadSecurityAgentRuleActionHash(), - kill=CloudWorkloadSecurityAgentRuleKill(), - log=CloudWorkloadSecurityAgentRuleActionLog(), - metadata=CloudWorkloadSecurityAgentRuleActionMetadata(), - network_filter=CloudWorkloadSecurityAgentRuleActionNetworkFilter(), - set=CloudWorkloadSecurityAgentRuleActionSet(), - ), - ], - blocking=[], - description="My Agent rule", - disabled=[], - enabled=True, - expression='exec.file.name == "sh"', - filters=[], - monitoring=[], - name="my_agent_rule", - policy_id="a8c8e364-6556-434d-b798-a4c23de29c0b", - product_tags=[], - silent=False, - ), - type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE, - ), -) - -configuration = Configuration() -configuration.access_token = environ["DD_BEARER_TOKEN"] -with ApiClient(configuration) as api_client: - api_instance = CSMThreatsApi(api_client) - response = api_instance.create_cloud_workload_security_agent_rule(body=body) - - print(response) diff --git a/examples/v2/csm-threats/DeleteCloudWorkloadSecurityAgentRule.py b/examples/v2/csm-threats/DeleteCloudWorkloadSecurityAgentRule.py deleted file mode 100644 index a4e2e129d4..0000000000 --- a/examples/v2/csm-threats/DeleteCloudWorkloadSecurityAgentRule.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -Delete a Workload Protection agent rule (US1-FED) returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.csm_threats_api import CSMThreatsApi - -configuration = Configuration() -configuration.access_token = environ["DD_BEARER_TOKEN"] -with ApiClient(configuration) as api_client: - api_instance = CSMThreatsApi(api_client) - api_instance.delete_cloud_workload_security_agent_rule( - agent_rule_id="agent_rule_id", - ) diff --git a/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.py b/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.py deleted file mode 100644 index 3ad068b9e0..0000000000 --- a/examples/v2/csm-threats/UpdateCloudWorkloadSecurityAgentRule.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -Update a Workload Protection agent rule (US1-FED) returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.csm_threats_api import CSMThreatsApi -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action import CloudWorkloadSecurityAgentRuleAction -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_core_dump import ( - CloudWorkloadSecurityAgentRuleActionCoreDump, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_hash import ( - CloudWorkloadSecurityAgentRuleActionHash, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_log import ( - CloudWorkloadSecurityAgentRuleActionLog, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_metadata import ( - CloudWorkloadSecurityAgentRuleActionMetadata, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_network_filter import ( - CloudWorkloadSecurityAgentRuleActionNetworkFilter, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_action_set import ( - CloudWorkloadSecurityAgentRuleActionSet, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_kill import CloudWorkloadSecurityAgentRuleKill -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_type import CloudWorkloadSecurityAgentRuleType -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_update_attributes import ( - CloudWorkloadSecurityAgentRuleUpdateAttributes, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_update_data import ( - CloudWorkloadSecurityAgentRuleUpdateData, -) -from datadog_api_client.v2.model.cloud_workload_security_agent_rule_update_request import ( - CloudWorkloadSecurityAgentRuleUpdateRequest, -) - -body = CloudWorkloadSecurityAgentRuleUpdateRequest( - data=CloudWorkloadSecurityAgentRuleUpdateData( - attributes=CloudWorkloadSecurityAgentRuleUpdateAttributes( - actions=[ - CloudWorkloadSecurityAgentRuleAction( - coredump=CloudWorkloadSecurityAgentRuleActionCoreDump(), - disabled=False, - hash=CloudWorkloadSecurityAgentRuleActionHash(), - kill=CloudWorkloadSecurityAgentRuleKill(), - log=CloudWorkloadSecurityAgentRuleActionLog(), - metadata=CloudWorkloadSecurityAgentRuleActionMetadata(), - network_filter=CloudWorkloadSecurityAgentRuleActionNetworkFilter(), - set=CloudWorkloadSecurityAgentRuleActionSet(), - ), - ], - blocking=[], - description="My Agent rule", - disabled=[], - enabled=True, - expression='exec.file.name == "sh"', - monitoring=[], - policy_id="a8c8e364-6556-434d-b798-a4c23de29c0b", - product_tags=[], - silent=False, - ), - id="3dd-0uc-h1s", - type=CloudWorkloadSecurityAgentRuleType.AGENT_RULE, - ), -) - -configuration = Configuration() -configuration.access_token = environ["DD_BEARER_TOKEN"] -with ApiClient(configuration) as api_client: - api_instance = CSMThreatsApi(api_client) - response = api_instance.update_cloud_workload_security_agent_rule(agent_rule_id="agent_rule_id", body=body) - - print(response) diff --git a/src/datadog_api_client/v2/api/csm_threats_api.py b/src/datadog_api_client/v2/api/csm_threats_api.py index 6f7ffe8c00..f82486ba4e 100644 --- a/src/datadog_api_client/v2/api/csm_threats_api.py +++ b/src/datadog_api_client/v2/api/csm_threats_api.py @@ -50,26 +50,6 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client - self._create_cloud_workload_security_agent_rule_endpoint = _Endpoint( - settings={ - "response_type": (CloudWorkloadSecurityAgentRuleResponse,), - "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], - "endpoint_path": "/api/v2/security_monitoring/cloud_workload_security/agent_rules", - "operation_id": "create_cloud_workload_security_agent_rule", - "http_method": "POST", - "version": "v2", - }, - params_map={ - "body": { - "required": True, - "openapi_types": (CloudWorkloadSecurityAgentRuleCreateRequest,), - "location": "body", - }, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self._create_csm_threats_agent_policy_endpoint = _Endpoint( settings={ "response_type": (CloudWorkloadSecurityAgentPolicyResponse,), @@ -110,29 +90,6 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._delete_cloud_workload_security_agent_rule_endpoint = _Endpoint( - settings={ - "response_type": None, - "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], - "endpoint_path": "/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", - "operation_id": "delete_cloud_workload_security_agent_rule", - "http_method": "DELETE", - "version": "v2", - }, - params_map={ - "agent_rule_id": { - "required": True, - "openapi_types": (str,), - "attribute": "agent_rule_id", - "location": "path", - }, - }, - headers_map={ - "accept": ["*/*"], - }, - api_client=api_client, - ) - self._delete_csm_threats_agent_policy_endpoint = _Endpoint( settings={ "response_type": None, @@ -328,32 +285,6 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._update_cloud_workload_security_agent_rule_endpoint = _Endpoint( - settings={ - "response_type": (CloudWorkloadSecurityAgentRuleResponse,), - "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], - "endpoint_path": "/api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}", - "operation_id": "update_cloud_workload_security_agent_rule", - "http_method": "PATCH", - "version": "v2", - }, - params_map={ - "agent_rule_id": { - "required": True, - "openapi_types": (str,), - "attribute": "agent_rule_id", - "location": "path", - }, - "body": { - "required": True, - "openapi_types": (CloudWorkloadSecurityAgentRuleUpdateRequest,), - "location": "body", - }, - }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, - api_client=api_client, - ) - self._update_csm_threats_agent_policy_endpoint = _Endpoint( settings={ "response_type": (CloudWorkloadSecurityAgentPolicyResponse,), @@ -411,25 +342,6 @@ def __init__(self, api_client=None): api_client=api_client, ) - def create_cloud_workload_security_agent_rule( - self, - body: CloudWorkloadSecurityAgentRuleCreateRequest, - ) -> CloudWorkloadSecurityAgentRuleResponse: - """Create a Workload Protection agent rule (US1-FED). - - Create a new agent rule with the given parameters. - - **Note** : This endpoint should only be used for the Government (US1-FED) site. - - :param body: The definition of the new agent rule - :type body: CloudWorkloadSecurityAgentRuleCreateRequest - :rtype: CloudWorkloadSecurityAgentRuleResponse - """ - kwargs: Dict[str, Any] = {} - kwargs["body"] = body - - return self._create_cloud_workload_security_agent_rule_endpoint.call_with_http_info(**kwargs) - def create_csm_threats_agent_policy( self, body: CloudWorkloadSecurityAgentPolicyCreateRequest, @@ -468,25 +380,6 @@ def create_csm_threats_agent_rule( return self._create_csm_threats_agent_rule_endpoint.call_with_http_info(**kwargs) - def delete_cloud_workload_security_agent_rule( - self, - agent_rule_id: str, - ) -> None: - """Delete a Workload Protection agent rule (US1-FED). - - Delete a specific agent rule. - - **Note** : This endpoint should only be used for the Government (US1-FED) site. - - :param agent_rule_id: The ID of the Agent rule - :type agent_rule_id: str - :rtype: None - """ - kwargs: Dict[str, Any] = {} - kwargs["agent_rule_id"] = agent_rule_id - - return self._delete_cloud_workload_security_agent_rule_endpoint.call_with_http_info(**kwargs) - def delete_csm_threats_agent_policy( self, policy_id: str, @@ -661,31 +554,6 @@ def list_csm_threats_agent_rules( return self._list_csm_threats_agent_rules_endpoint.call_with_http_info(**kwargs) - def update_cloud_workload_security_agent_rule( - self, - agent_rule_id: str, - body: CloudWorkloadSecurityAgentRuleUpdateRequest, - ) -> CloudWorkloadSecurityAgentRuleResponse: - """Update a Workload Protection agent rule (US1-FED). - - Update a specific agent rule. - Returns the agent rule object when the request is successful. - - **Note** : This endpoint should only be used for the Government (US1-FED) site. - - :param agent_rule_id: The ID of the Agent rule - :type agent_rule_id: str - :param body: New definition of the agent rule - :type body: CloudWorkloadSecurityAgentRuleUpdateRequest - :rtype: CloudWorkloadSecurityAgentRuleResponse - """ - kwargs: Dict[str, Any] = {} - kwargs["agent_rule_id"] = agent_rule_id - - kwargs["body"] = body - - return self._update_cloud_workload_security_agent_rule_endpoint.call_with_http_info(**kwargs) - def update_csm_threats_agent_policy( self, policy_id: str, diff --git a/tests/v2/features/csm_threats.feature b/tests/v2/features/csm_threats.feature index 579e16bdaa..1d58674b26 100644 --- a/tests/v2/features/csm_threats.feature +++ b/tests/v2/features/csm_threats.feature @@ -13,27 +13,6 @@ Feature: CSM Threats And a valid "appKeyAuth" key in the system And an instance of "CSMThreats" API - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Create a Workload Protection agent rule (US1-FED) returns "Bad Request" response - Given new "CreateCloudWorkloadSecurityAgentRule" request - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "filters": [], "monitoring": [], "name": "my_agent_rule", "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "type": "agent_rule"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Create a Workload Protection agent rule (US1-FED) returns "Conflict" response - Given new "CreateCloudWorkloadSecurityAgentRule" request - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "filters": [], "monitoring": [], "name": "my_agent_rule", "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "type": "agent_rule"}} - When the request is sent - Then the response status is 409 Conflict - - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Create a Workload Protection agent rule (US1-FED) returns "OK" response - Given new "CreateCloudWorkloadSecurityAgentRule" request - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "filters": [], "monitoring": [], "name": "my_agent_rule", "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "type": "agent_rule"}} - When the request is sent - Then the response status is 200 OK - @team:ddoghq/k9-cws-backend Scenario: Create a Workload Protection agent rule returns "Bad Request" response Given there is a valid "policy_rc" in the system @@ -95,20 +74,6 @@ Feature: CSM Threats When the request is sent Then the response status is 201 Created - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Delete a Workload Protection agent rule (US1-FED) returns "Not Found" response - Given new "DeleteCloudWorkloadSecurityAgentRule" request - And request contains "agent_rule_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Delete a Workload Protection agent rule (US1-FED) returns "OK" response - Given new "DeleteCloudWorkloadSecurityAgentRule" request - And request contains "agent_rule_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 204 OK - @team:ddoghq/k9-cws-backend Scenario: Delete a Workload Protection agent rule returns "Not Found" response Given new "DeleteCSMThreatsAgentRule" request @@ -211,38 +176,6 @@ Feature: CSM Threats When the request is sent Then the response status is 200 OK - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Update a Workload Protection agent rule (US1-FED) returns "Bad Request" response - Given new "UpdateCloudWorkloadSecurityAgentRule" request - And request contains "agent_rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "monitoring": [], "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "id": "3dd-0uc-h1s", "type": "agent_rule"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Update a Workload Protection agent rule (US1-FED) returns "Concurrent Modification" response - Given new "UpdateCloudWorkloadSecurityAgentRule" request - And request contains "agent_rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "monitoring": [], "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "id": "3dd-0uc-h1s", "type": "agent_rule"}} - When the request is sent - Then the response status is 409 Concurrent Modification - - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Update a Workload Protection agent rule (US1-FED) returns "Not Found" response - Given new "UpdateCloudWorkloadSecurityAgentRule" request - And request contains "agent_rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "monitoring": [], "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "id": "3dd-0uc-h1s", "type": "agent_rule"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:ddoghq/k9-cws-backend - Scenario: Update a Workload Protection agent rule (US1-FED) returns "OK" response - Given new "UpdateCloudWorkloadSecurityAgentRule" request - And request contains "agent_rule_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"actions": [{"coredump": {}, "disabled": false, "hash": {}, "kill": {}, "log": {}, "metadata": {}, "network_filter": {}, "set": {}}], "blocking": [], "description": "My Agent rule", "disabled": [], "enabled": true, "expression": "exec.file.name == \"sh\"", "monitoring": [], "policy_id": "a8c8e364-6556-434d-b798-a4c23de29c0b", "product_tags": [], "silent": false}, "id": "3dd-0uc-h1s", "type": "agent_rule"}} - When the request is sent - Then the response status is 200 OK - @team:ddoghq/k9-cws-backend Scenario: Update a Workload Protection agent rule returns "Bad Request" response Given there is a valid "policy_rc" in the system diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 573d99e0fd..e2931f2614 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1749,18 +1749,6 @@ "tag": "Security Monitoring", "operationId": "ListSecurityMonitoringBatchMigrationResources" }, - { - "parameters": [ - { - "name": "body", - "value": "{\n \"data\": {\n \"type\": \"agent_rule\",\n \"attributes\": {\n \"name\": \"{{ unique_lower_alnum }}\",\n \"description\": \"My Agent rule\",\n \"expression\": \"exec.file.name == \\\"sh\\\"\",\n \"enabled\": true\n }\n }\n}" - } - ], - "step": "there is a valid \"agent_rule\" in the system", - "key": "agent_rule", - "tag": "CSM Threats", - "operationId": "CreateCloudWorkloadSecurityAgentRule" - }, { "parameters": [ { diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 8f4adc2688..94d2e66680 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -9545,37 +9545,12 @@ "type": "safe" } }, - "CreateCloudWorkloadSecurityAgentRule": { - "tag": "CSM Threats", - "undo": { - "operationId": "DeleteCloudWorkloadSecurityAgentRule", - "parameters": [ - { - "name": "agent_rule_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, - "DeleteCloudWorkloadSecurityAgentRule": { - "tag": "CSM Threats", - "undo": { - "type": "idempotent" - } - }, "GetCloudWorkloadSecurityAgentRule": { "tag": "CSM Threats", "undo": { "type": "safe" } }, - "UpdateCloudWorkloadSecurityAgentRule": { - "tag": "CSM Threats", - "undo": { - "type": "idempotent" - } - }, "ListSecurityMonitoringCriticalAssets": { "tag": "Security Monitoring", "undo": {