diff --git a/.apigentools-info b/.apigentools-info index 95206f14ad..5c61cbe80b 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-25 18:52:40.246446", - "spec_repo_commit": "1fa8186c" + "regenerated": "2024-09-26 15:35:14.508965", + "spec_repo_commit": "279f186f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-25 18:52:40.260078", - "spec_repo_commit": "1fa8186c" + "regenerated": "2024-09-26 15:35:14.522700", + "spec_repo_commit": "279f186f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3548bf7c71..d053d729d7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -9183,6 +9183,20 @@ components: tags: $ref: '#/components/schemas/FindingTags' type: object + FindingDetectionType: + description: The detection type of the finding. + enum: + - misconfiguration + - attack_path + - identity_risk + - api_security + example: misconfiguration + type: string + x-enum-varnames: + - MISCONFIGURATION + - ATTACK_PATH + - IDENTITY_RISK + - API_SECURITY FindingEvaluation: description: The evaluation of the finding. enum: @@ -33705,6 +33719,16 @@ paths: required: false schema: type: string + - description: Return findings that match the selected detection types (repeatable). + example: + - misconfiguration + in: query + name: filter[detection_type] + required: false + schema: + items: + $ref: '#/components/schemas/FindingDetectionType' + type: array - description: Return findings that have these associated tags (repeatable). example: filter[tags]=cloud_provider:aws&filter[tags]=aws_account:999999999999 in: query diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 13458d0e54..0349b0e71e 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -3728,6 +3728,13 @@ datadog\_api\_client.v2.model.finding\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.finding\_detection\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.finding_detection_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.finding\_evaluation module -------------------------------------------------------- diff --git a/src/datadog_api_client/v2/api/security_monitoring_api.py b/src/datadog_api_client/v2/api/security_monitoring_api.py index 2b31e18684..70def245fc 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -4,7 +4,7 @@ from __future__ import annotations import collections -from typing import Any, Dict, Union +from typing import Any, Dict, List, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration @@ -16,6 +16,7 @@ unset, ) from datadog_api_client.v2.model.list_findings_response import ListFindingsResponse +from datadog_api_client.v2.model.finding_detection_type import FindingDetectionType from datadog_api_client.v2.model.finding_evaluation import FindingEvaluation from datadog_api_client.v2.model.finding_status import FindingStatus from datadog_api_client.v2.model.finding import Finding @@ -487,6 +488,12 @@ def __init__(self, api_client=None): "attribute": "page[cursor]", "location": "query", }, + "filter_detection_type": { + "openapi_types": ([FindingDetectionType],), + "attribute": "filter[detection_type]", + "location": "query", + "collection_format": "multi", + }, "filter_tags": { "openapi_types": (str,), "attribute": "filter[tags]", @@ -1146,6 +1153,7 @@ def list_findings( page_limit: Union[int, UnsetType] = unset, snapshot_timestamp: Union[int, UnsetType] = unset, page_cursor: Union[str, UnsetType] = unset, + filter_detection_type: Union[List[FindingDetectionType], UnsetType] = unset, filter_tags: Union[str, UnsetType] = unset, filter_evaluation_changed_at: Union[str, UnsetType] = unset, filter_muted: Union[bool, UnsetType] = unset, @@ -1195,6 +1203,8 @@ def list_findings( :type snapshot_timestamp: int, optional :param page_cursor: Return the next page of findings pointed to by the cursor. :type page_cursor: str, optional + :param filter_detection_type: Return findings that match the selected detection types (repeatable). + :type filter_detection_type: [FindingDetectionType], optional :param filter_tags: Return findings that have these associated tags (repeatable). :type filter_tags: str, optional :param filter_evaluation_changed_at: Return findings that have changed from pass to fail or vice versa on a specified date (Unix ms) or date range (using comparison operators). @@ -1225,6 +1235,9 @@ def list_findings( if page_cursor is not unset: kwargs["page_cursor"] = page_cursor + if filter_detection_type is not unset: + kwargs["filter_detection_type"] = filter_detection_type + if filter_tags is not unset: kwargs["filter_tags"] = filter_tags @@ -1260,6 +1273,7 @@ def list_findings_with_pagination( page_limit: Union[int, UnsetType] = unset, snapshot_timestamp: Union[int, UnsetType] = unset, page_cursor: Union[str, UnsetType] = unset, + filter_detection_type: Union[List[FindingDetectionType], UnsetType] = unset, filter_tags: Union[str, UnsetType] = unset, filter_evaluation_changed_at: Union[str, UnsetType] = unset, filter_muted: Union[bool, UnsetType] = unset, @@ -1280,6 +1294,8 @@ def list_findings_with_pagination( :type snapshot_timestamp: int, optional :param page_cursor: Return the next page of findings pointed to by the cursor. :type page_cursor: str, optional + :param filter_detection_type: Return findings that match the selected detection types (repeatable). + :type filter_detection_type: [FindingDetectionType], optional :param filter_tags: Return findings that have these associated tags (repeatable). :type filter_tags: str, optional :param filter_evaluation_changed_at: Return findings that have changed from pass to fail or vice versa on a specified date (Unix ms) or date range (using comparison operators). @@ -1312,6 +1328,9 @@ def list_findings_with_pagination( if page_cursor is not unset: kwargs["page_cursor"] = page_cursor + if filter_detection_type is not unset: + kwargs["filter_detection_type"] = filter_detection_type + if filter_tags is not unset: kwargs["filter_tags"] = filter_tags diff --git a/src/datadog_api_client/v2/model/finding_detection_type.py b/src/datadog_api_client/v2/model/finding_detection_type.py new file mode 100644 index 0000000000..76ffac998c --- /dev/null +++ b/src/datadog_api_client/v2/model/finding_detection_type.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class FindingDetectionType(ModelSimple): + """ + The detection type of the finding. + + :param value: Must be one of ["misconfiguration", "attack_path", "identity_risk", "api_security"]. + :type value: str + """ + + allowed_values = { + "misconfiguration", + "attack_path", + "identity_risk", + "api_security", + } + MISCONFIGURATION: ClassVar["FindingDetectionType"] + ATTACK_PATH: ClassVar["FindingDetectionType"] + IDENTITY_RISK: ClassVar["FindingDetectionType"] + API_SECURITY: ClassVar["FindingDetectionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +FindingDetectionType.MISCONFIGURATION = FindingDetectionType("misconfiguration") +FindingDetectionType.ATTACK_PATH = FindingDetectionType("attack_path") +FindingDetectionType.IDENTITY_RISK = FindingDetectionType("identity_risk") +FindingDetectionType.API_SECURITY = FindingDetectionType("api_security") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 3797de1443..e7228a04fe 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -663,6 +663,7 @@ from datadog_api_client.v2.model.fastly_services_response import FastlyServicesResponse from datadog_api_client.v2.model.finding import Finding from datadog_api_client.v2.model.finding_attributes import FindingAttributes +from datadog_api_client.v2.model.finding_detection_type import FindingDetectionType from datadog_api_client.v2.model.finding_evaluation import FindingEvaluation from datadog_api_client.v2.model.finding_mute import FindingMute from datadog_api_client.v2.model.finding_mute_reason import FindingMuteReason @@ -2489,6 +2490,7 @@ "FastlyServicesResponse", "Finding", "FindingAttributes", + "FindingDetectionType", "FindingEvaluation", "FindingMute", "FindingMuteReason",