diff --git a/.apigentools-info b/.apigentools-info index c807d99005..d0218bc445 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev8", - "regenerated": "2021-06-14 19:16:27.013245", - "spec_repo_commit": "0664044" + "regenerated": "2021-06-15 11:56:42.149205", + "spec_repo_commit": "92478ee" }, "v2": { "apigentools_version": "1.4.1.dev8", - "regenerated": "2021-06-14 19:16:47.726417", - "spec_repo_commit": "0664044" + "regenerated": "2021-06-15 11:57:08.179104", + "spec_repo_commit": "92478ee" } } } \ No newline at end of file diff --git a/docs/v2/SecurityMonitoringApi.md b/docs/v2/SecurityMonitoringApi.md index 392d508942..fc14798205 100644 --- a/docs/v2/SecurityMonitoringApi.md +++ b/docs/v2/SecurityMonitoringApi.md @@ -144,9 +144,10 @@ with ApiClient(configuration) as api_client: query="query_example", ), ], + has_extended_title=True, is_enabled=True, message="", - name="", + name="My security monitoring rule.", options=SecurityMonitoringRuleOptions( detection_method=SecurityMonitoringRuleDetectionMethod("threshold"), evaluation_window=SecurityMonitoringRuleEvaluationWindow(0), @@ -172,7 +173,7 @@ with ApiClient(configuration) as api_client: ], metric="metric_example", name="name_example", - query="a < 3", + query="a > 3", ), ], tags=["env:prod","team:security"], @@ -900,6 +901,7 @@ with ApiClient(configuration) as api_client: query="query_example", ), ], + has_extended_title=True, is_enabled=True, message="message_example", name="name_example", @@ -934,6 +936,7 @@ with ApiClient(configuration) as api_client: tags=[ "tags_example", ], + version=1, ) # SecurityMonitoringRuleUpdatePayload | # example passing only required values which don't have defaults set diff --git a/docs/v2/SecurityMonitoringListRulesResponse.md b/docs/v2/SecurityMonitoringListRulesResponse.md index aa15d6e8bf..567565281f 100644 --- a/docs/v2/SecurityMonitoringListRulesResponse.md +++ b/docs/v2/SecurityMonitoringListRulesResponse.md @@ -5,7 +5,7 @@ List of rules. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**[SecurityMonitoringRuleResponse]**](SecurityMonitoringRuleResponse.md) | TODO. | [optional] +**data** | [**[SecurityMonitoringRuleResponse]**](SecurityMonitoringRuleResponse.md) | Array containing the list of rules. | [optional] **meta** | [**ResponseMetaAttributes**](ResponseMetaAttributes.md) | | [optional] [[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) diff --git a/docs/v2/SecurityMonitoringRuleCreatePayload.md b/docs/v2/SecurityMonitoringRuleCreatePayload.md index 352ae6904c..a4c5989a2e 100644 --- a/docs/v2/SecurityMonitoringRuleCreatePayload.md +++ b/docs/v2/SecurityMonitoringRuleCreatePayload.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **options** | [**SecurityMonitoringRuleOptions**](SecurityMonitoringRuleOptions.md) | | **queries** | [**[SecurityMonitoringRuleQueryCreate]**](SecurityMonitoringRuleQueryCreate.md) | Queries for selecting logs which are part of the rule. | **filters** | [**[SecurityMonitoringFilter]**](SecurityMonitoringFilter.md) | Additional queries to filter matched events before they are processed. | [optional] +**has_extended_title** | **bool** | Whether the notifications include the triggering group-by values in their title. | [optional] **tags** | **[str]** | Tags for generated signals. | [optional] [[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) diff --git a/docs/v2/SecurityMonitoringRuleResponse.md b/docs/v2/SecurityMonitoringRuleResponse.md index 4efa111c5c..0aaa6f9c72 100644 --- a/docs/v2/SecurityMonitoringRuleResponse.md +++ b/docs/v2/SecurityMonitoringRuleResponse.md @@ -1,6 +1,6 @@ # SecurityMonitoringRuleResponse -Detection rule. +Rule. ## Properties Name | Type | Description | Notes @@ -9,6 +9,7 @@ Name | Type | Description | Notes **created_at** | **int** | When the rule was created, timestamp in milliseconds. | [optional] **creation_author_id** | **int** | User ID of the user who created the rule. | [optional] **filters** | [**[SecurityMonitoringFilter]**](SecurityMonitoringFilter.md) | Additional queries to filter matched events before they are processed. | [optional] +**has_extended_title** | **bool** | Whether the notifications include the triggering group-by values in their title. | [optional] **id** | **str** | The ID of the rule. | [optional] **is_default** | **bool** | Whether the rule is included by default. | [optional] **is_deleted** | **bool** | Whether the rule has been deleted. | [optional] @@ -18,6 +19,7 @@ Name | Type | Description | Notes **options** | [**SecurityMonitoringRuleOptions**](SecurityMonitoringRuleOptions.md) | | [optional] **queries** | [**[SecurityMonitoringRuleQuery]**](SecurityMonitoringRuleQuery.md) | Queries for selecting logs which are part of the rule. | [optional] **tags** | **[str]** | Tags for generated signals. | [optional] +**update_author_id** | **int** | User ID of the user who updated the rule. | [optional] **version** | **int** | The version of the rule. | [optional] [[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) diff --git a/docs/v2/SecurityMonitoringRuleUpdatePayload.md b/docs/v2/SecurityMonitoringRuleUpdatePayload.md index 7ae3d640c4..7797e5b619 100644 --- a/docs/v2/SecurityMonitoringRuleUpdatePayload.md +++ b/docs/v2/SecurityMonitoringRuleUpdatePayload.md @@ -7,12 +7,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cases** | [**[SecurityMonitoringRuleCase]**](SecurityMonitoringRuleCase.md) | Cases for generating signals. | [optional] **filters** | [**[SecurityMonitoringFilter]**](SecurityMonitoringFilter.md) | Additional queries to filter matched events before they are processed. | [optional] +**has_extended_title** | **bool** | Whether the notifications include the triggering group-by values in their title. | [optional] **is_enabled** | **bool** | Whether the rule is enabled. | [optional] **message** | **str** | Message for generated signals. | [optional] **name** | **str** | Name of the rule. | [optional] **options** | [**SecurityMonitoringRuleOptions**](SecurityMonitoringRuleOptions.md) | | [optional] **queries** | [**[SecurityMonitoringRuleQuery]**](SecurityMonitoringRuleQuery.md) | Queries for selecting logs which are part of the rule. | [optional] **tags** | **[str]** | Tags for generated signals. | [optional] +**version** | **int** | The version of the rule being updated. | [optional] [[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) diff --git a/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py b/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py index 4ae4d3cbf7..d1c54946f7 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py +++ b/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py @@ -135,7 +135,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - data ([SecurityMonitoringRuleResponse]): TODO.. [optional] # noqa: E501 + data ([SecurityMonitoringRuleResponse]): Array containing the list of rules.. [optional] # noqa: E501 meta (ResponseMetaAttributes): [optional] # noqa: E501 """ diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py b/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py index 5e230ace72..2c1af3df5b 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py @@ -85,6 +85,7 @@ def openapi_types(): "options": (SecurityMonitoringRuleOptions,), # noqa: E501 "queries": ([SecurityMonitoringRuleQueryCreate],), # noqa: E501 "filters": ([SecurityMonitoringFilter],), # noqa: E501 + "has_extended_title": (bool,), # noqa: E501 "tags": ([str],), # noqa: E501 } @@ -100,6 +101,7 @@ def discriminator(): "options": "options", # noqa: E501 "queries": "queries", # noqa: E501 "filters": "filters", # noqa: E501 + "has_extended_title": "hasExtendedTitle", # noqa: E501 "tags": "tags", # noqa: E501 } @@ -160,6 +162,7 @@ def __init__(self, cases, is_enabled, message, name, options, queries, *args, ** through its discriminator because we passed in _visited_composed_classes = (Animal,) filters ([SecurityMonitoringFilter]): Additional queries to filter matched events before they are processed.. [optional] # noqa: E501 + has_extended_title (bool): Whether the notifications include the triggering group-by values in their title.. [optional] # noqa: E501 tags ([str]): Tags for generated signals.. [optional] # noqa: E501 """ diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_response.py b/src/datadog_api_client/v2/model/security_monitoring_rule_response.py index c83482e5b3..0d182757d2 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_response.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_response.py @@ -82,6 +82,7 @@ def openapi_types(): "created_at": (int,), # noqa: E501 "creation_author_id": (int,), # noqa: E501 "filters": ([SecurityMonitoringFilter],), # noqa: E501 + "has_extended_title": (bool,), # noqa: E501 "id": (str,), # noqa: E501 "is_default": (bool,), # noqa: E501 "is_deleted": (bool,), # noqa: E501 @@ -91,6 +92,7 @@ def openapi_types(): "options": (SecurityMonitoringRuleOptions,), # noqa: E501 "queries": ([SecurityMonitoringRuleQuery],), # noqa: E501 "tags": ([str],), # noqa: E501 + "update_author_id": (int,), # noqa: E501 "version": (int,), # noqa: E501 } @@ -103,6 +105,7 @@ def discriminator(): "created_at": "createdAt", # noqa: E501 "creation_author_id": "creationAuthorId", # noqa: E501 "filters": "filters", # noqa: E501 + "has_extended_title": "hasExtendedTitle", # noqa: E501 "id": "id", # noqa: E501 "is_default": "isDefault", # noqa: E501 "is_deleted": "isDeleted", # noqa: E501 @@ -112,6 +115,7 @@ def discriminator(): "options": "options", # noqa: E501 "queries": "queries", # noqa: E501 "tags": "tags", # noqa: E501 + "update_author_id": "updateAuthorId", # noqa: E501 "version": "version", # noqa: E501 } @@ -167,6 +171,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 created_at (int): When the rule was created, timestamp in milliseconds.. [optional] # noqa: E501 creation_author_id (int): User ID of the user who created the rule.. [optional] # noqa: E501 filters ([SecurityMonitoringFilter]): Additional queries to filter matched events before they are processed.. [optional] # noqa: E501 + has_extended_title (bool): Whether the notifications include the triggering group-by values in their title.. [optional] # noqa: E501 id (str): The ID of the rule.. [optional] # noqa: E501 is_default (bool): Whether the rule is included by default.. [optional] # noqa: E501 is_deleted (bool): Whether the rule has been deleted.. [optional] # noqa: E501 @@ -176,6 +181,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 options (SecurityMonitoringRuleOptions): [optional] # noqa: E501 queries ([SecurityMonitoringRuleQuery]): Queries for selecting logs which are part of the rule.. [optional] # noqa: E501 tags ([str]): Tags for generated signals.. [optional] # noqa: E501 + update_author_id (int): User ID of the user who updated the rule.. [optional] # noqa: E501 version (int): The version of the rule.. [optional] # noqa: E501 """ diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py b/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py index 3e0be5f679..5a824310a5 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py @@ -60,7 +60,11 @@ class SecurityMonitoringRuleUpdatePayload(ModelNormal): allowed_values = {} - validations = {} + validations = { + ("version",): { + "inclusive_maximum": 2147483647, + }, + } additional_properties_type = None @@ -80,12 +84,14 @@ def openapi_types(): return { "cases": ([SecurityMonitoringRuleCase],), # noqa: E501 "filters": ([SecurityMonitoringFilter],), # noqa: E501 + "has_extended_title": (bool,), # noqa: E501 "is_enabled": (bool,), # noqa: E501 "message": (str,), # noqa: E501 "name": (str,), # noqa: E501 "options": (SecurityMonitoringRuleOptions,), # noqa: E501 "queries": ([SecurityMonitoringRuleQuery],), # noqa: E501 "tags": ([str],), # noqa: E501 + "version": (int,), # noqa: E501 } @cached_property @@ -95,12 +101,14 @@ def discriminator(): attribute_map = { "cases": "cases", # noqa: E501 "filters": "filters", # noqa: E501 + "has_extended_title": "hasExtendedTitle", # noqa: E501 "is_enabled": "isEnabled", # noqa: E501 "message": "message", # noqa: E501 "name": "name", # noqa: E501 "options": "options", # noqa: E501 "queries": "queries", # noqa: E501 "tags": "tags", # noqa: E501 + "version": "version", # noqa: E501 } _composed_schemas = {} @@ -153,12 +161,14 @@ def __init__(self, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) cases ([SecurityMonitoringRuleCase]): Cases for generating signals.. [optional] # noqa: E501 filters ([SecurityMonitoringFilter]): Additional queries to filter matched events before they are processed.. [optional] # noqa: E501 + has_extended_title (bool): Whether the notifications include the triggering group-by values in their title.. [optional] # noqa: E501 is_enabled (bool): Whether the rule is enabled.. [optional] # noqa: E501 message (str): Message for generated signals.. [optional] # noqa: E501 name (str): Name of the rule.. [optional] # noqa: E501 options (SecurityMonitoringRuleOptions): [optional] # noqa: E501 queries ([SecurityMonitoringRuleQuery]): Queries for selecting logs which are part of the rule.. [optional] # noqa: E501 tags ([str]): Tags for generated signals.. [optional] # noqa: E501 + version (int): The version of the rule being updated.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/src/datadog_api_client/v2/openapi.yaml b/src/datadog_api_client/v2/openapi.yaml index 175cfdb412..c18470b6f3 100644 --- a/src/datadog_api_client/v2/openapi.yaml +++ b/src/datadog_api_client/v2/openapi.yaml @@ -4145,7 +4145,7 @@ components: description: List of rules. properties: data: - description: TODO. + description: Array containing the list of rules. items: $ref: '#/components/schemas/SecurityMonitoringRuleResponse' type: array @@ -4211,6 +4211,11 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringFilter' type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true + type: boolean isEnabled: description: Whether the rule is enabled. example: true @@ -4221,7 +4226,7 @@ components: type: string name: description: The name of the rule. - example: '' + example: My security monitoring rule. type: string options: $ref: '#/components/schemas/SecurityMonitoringRuleOptions' @@ -4474,13 +4479,13 @@ components: type: string query: description: Query to run on logs. - example: a < 3 + example: a > 3 type: string required: - query type: object SecurityMonitoringRuleResponse: - description: Detection rule. + description: Rule. properties: cases: description: Cases for generating signals. @@ -4501,6 +4506,10 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringFilter' type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + type: boolean id: description: The ID of the rule. type: string @@ -4532,6 +4541,10 @@ components: description: Tag. type: string type: array + updateAuthorId: + description: User ID of the user who updated the rule. + format: int64 + type: integer version: description: The version of the rule. format: int64 @@ -4565,6 +4578,11 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringFilter' type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true + type: boolean isEnabled: description: Whether the rule is enabled. type: boolean @@ -4587,6 +4605,12 @@ components: description: Tag. type: string type: array + version: + description: The version of the rule being updated. + example: 1 + format: int32 + maximum: 2147483647 + type: integer type: object SecurityMonitoringRuntimeAgentRule: description: The Agent rule. diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index 7d84c65c12..b4e941f696 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/security_monitoring.feature @@ -227,7 +227,7 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "Bad Request" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "" - And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "info"}], "filters": [{"action": "require", "query": null}], "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null]} + And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "info"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} When the request is sent Then the response status is 400 Bad Request @@ -235,7 +235,7 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "Not Found" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "" - And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "info"}], "filters": [{"action": "require", "query": null}], "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null]} + And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "info"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} When the request is sent Then the response status is 404 Not Found @@ -243,6 +243,6 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "OK" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "" - And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "info"}], "filters": [{"action": "require", "query": null}], "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null]} + And body with value {"cases": [{"condition": null, "name": null, "notifications": [null], "status": "info"}], "filters": [{"action": "require", "query": null}], "hasExtendedTitle": true, "isEnabled": null, "message": null, "name": null, "options": {"detectionMethod": "threshold", "evaluationWindow": 0, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0}}, "queries": [{"agentRule": {"agentRuleId": "etc_shadow", "expression": null}, "aggregation": "count", "distinctFields": [null], "groupByFields": [null], "metric": null, "name": null, "query": null}], "tags": [null], "version": 1} When the request is sent Then the response status is 200 OK