diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3661bf3fc2..6fb8371839 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -87258,6 +87258,38 @@ components: x-enum-varnames: - DONE - TIMEOUT + SecurityMonitoringAzureAppRegistration: + description: An Azure App Registration discovered for the organization. + properties: + client_id: + description: The client ID of the App Registration. + example: 66666666-7777-8888-9999-000000000000 + type: string + error_count: + description: The number of errors encountered while crawling resources for this App Registration. + example: 0 + format: int64 + type: integer + resource_collection_enabled: + description: Whether resource collection is enabled for this App Registration. + example: true + type: boolean + subscription_count: + description: The number of Azure subscriptions associated with this App Registration. + example: 3 + format: int64 + type: integer + tenant_id: + description: The Azure tenant ID of the App Registration. + example: 11111111-2222-3333-4444-555555555555 + type: string + required: + - tenant_id + - client_id + - resource_collection_enabled + - subscription_count + - error_count + type: object SecurityMonitoringContentPackActivation: description: The activation status of a content pack. enum: @@ -88153,6 +88185,68 @@ components: (for example, `siem_entity_identity` for identities). Defaults to `entity` when the kind is unknown. example: siem_entity_identity type: string + SecurityMonitoringEntraIdAzureAppRegistrationsAttributes: + description: The attributes of the Entra ID Azure App Registration prerequisites. + properties: + azure_app_registrations: + description: The Azure App Registrations discovered for the organization. + items: + $ref: "#/components/schemas/SecurityMonitoringAzureAppRegistration" + type: array + has_valid_prerequisite: + description: Whether at least one Azure App Registration has resource collection enabled. + example: true + type: boolean + integration_id: + description: The ID of the Entra ID integration configuration, if one exists. + example: 11111111-2222-3333-4444-555555555555 + type: string + is_enabled: + description: Whether the Entra ID integration configuration is enabled, if one exists. + example: true + type: boolean + subscribed_at: + description: The time at which the Entra ID integration configuration was created, if one exists. + example: "2026-05-01T12:00:00Z" + format: date-time + type: string + required: + - azure_app_registrations + - has_valid_prerequisite + type: object + SecurityMonitoringEntraIdAzureAppRegistrationsData: + description: The Azure App Registration prerequisites for the Entra ID integration. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringEntraIdAzureAppRegistrationsAttributes" + id: + description: The ID of the organization the Azure App Registrations belong to. + example: "123456" + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringEntraIdAzureAppRegistrationsResourceType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringEntraIdAzureAppRegistrationsResourceType: + default: entra_id_azure_app_registrations + description: The type of the resource. The value should always be `entra_id_azure_app_registrations`. + enum: + - entra_id_azure_app_registrations + example: entra_id_azure_app_registrations + type: string + x-enum-varnames: + - ENTRA_ID_AZURE_APP_REGISTRATIONS + SecurityMonitoringEntraIdAzureAppRegistrationsResponse: + description: Response containing the Azure App Registration prerequisites for the Entra ID integration. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringEntraIdAzureAppRegistrationsData" + required: + - data + type: object SecurityMonitoringFilter: description: The rule's suppression filter. properties: @@ -88171,6 +88265,43 @@ components: x-enum-varnames: - REQUIRE - SUPPRESS + SecurityMonitoringIntegrationActivateAttributes: + description: Overrides applied when activating the integration. All fields are optional. + properties: + domain: + description: The domain associated with the external entity source. + example: default + type: string + name: + description: The display name for the entity context sync configuration. + example: My Entra ID Integration + type: string + settings: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigSettings" + type: object + SecurityMonitoringIntegrationActivateData: + description: The configuration overrides for the integration to activate. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringIntegrationActivateAttributes" + type: + $ref: "#/components/schemas/SecurityMonitoringIntegrationActivateResourceType" + type: object + SecurityMonitoringIntegrationActivateRequest: + description: Request body to activate an entity context sync integration for a source type that does not require secrets. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringIntegrationActivateData" + type: object + SecurityMonitoringIntegrationActivateResourceType: + default: activate_entra_id_request + description: The type of the resource. The value should always be `activate_entra_id_request`. + enum: + - activate_entra_id_request + example: activate_entra_id_request + type: string + x-enum-varnames: + - ACTIVATE_ENTRA_ID_REQUEST SecurityMonitoringIntegrationConfigAttributes: description: The attributes of an entity context sync configuration as returned by the API. properties: @@ -88228,7 +88359,6 @@ components: - integration_type - domain - name - - secrets type: object SecurityMonitoringIntegrationConfigCreateData: description: The entity context sync configuration to create. @@ -88284,7 +88414,9 @@ components: type: object SecurityMonitoringIntegrationConfigSecrets: additionalProperties: {} - description: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, `admin_email` for Google Workspace). + description: |- + The secrets used to authenticate against the external entity source. The accepted keys depend on the source type + (for example, `admin_email` for Google Workspace). Not required for source types that do not use secrets (for example, `ENTRA_ID`). example: admin_email: test@example.com type: object @@ -88372,7 +88504,6 @@ components: required: - integration_type - domain - - secrets type: object SecurityMonitoringIntegrationCredentialsValidateData: description: The credentials to validate. @@ -178092,6 +178223,54 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/configuration/integration_config/entra_id/azure_app_registrations: + get: + description: |- + Get the Azure App Registrations discovered for the organization and whether at least one of them has + resource collection enabled, which is a prerequisite for activating the Entra ID entity context sync integration. + operationId: GetEntraIdAzureAppRegistrations + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + azure_app_registrations: + - client_id: 66666666-7777-8888-9999-000000000000 + error_count: 0 + resource_collection_enabled: true + subscription_count: 3 + tenant_id: 11111111-2222-3333-4444-555555555555 + has_valid_prerequisite: true + integration_id: 11111111-2222-3333-4444-555555555555 + is_enabled: true + subscribed_at: "2026-05-01T12:00:00Z" + id: "123456" + type: entra_id_azure_app_registrations + schema: + $ref: "#/components/schemas/SecurityMonitoringEntraIdAzureAppRegistrationsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - integrations_read + summary: Get Entra ID Azure App Registration prerequisites + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/configuration/integration_config/validate: post: description: |- @@ -178317,6 +178496,132 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/configuration/integration_config/{integration_type}/activate: + post: + description: |- + Activate an entity context sync integration for a source type that does not require manually + supplied credentials (for example, Entra ID). If an integration of this type already exists, + it is returned (re-enabling it first if it was disabled) instead of creating a duplicate. + operationId: ActivateIntegration + parameters: + - description: The integration type to activate (for example, `entra_id`). + in: path + name: integration_type + required: true + schema: + example: entra_id + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: My Entra ID Integration + type: activate_entra_id_request + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationActivateRequest" + description: Optional configuration overrides for the integration to activate. + required: false + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: default + enabled: true + integration_type: ENTRA_ID + modified_at: "2026-05-01T12:00:00Z" + name: My Entra ID Integration + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Activate an entity context sync integration + tags: ["Security Monitoring"] + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security_monitoring/configuration/integration_config/{integration_type}/deactivate: + post: + description: Deactivate all active entity context sync integrations of the given source type (for example, Entra ID). + operationId: DeactivateIntegration + parameters: + - description: The integration type to deactivate (for example, `entra_id`). + in: path + name: integration_type + required: true + schema: + example: entra_id + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-01T12:00:00Z" + domain: default + enabled: false + integration_type: ENTRA_ID + modified_at: "2026-05-08T12:00:00Z" + name: My Entra ID Integration + state: valid + id: 11111111-2222-3333-4444-555555555555 + type: integration_config + schema: + $ref: "#/components/schemas/SecurityMonitoringIntegrationConfigResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - manage_integrations + summary: Deactivate an entity context sync integration + tags: ["Security Monitoring"] + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security_monitoring/configuration/notification_rules/send_notification_preview: post: description: Send a notification preview to test that a notification rule's targets are properly configured. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 9ddaebf4a3..2c283062c8 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -37139,6 +37139,13 @@ datadog\_api\_client.v2.model.security\_findings\_status module :members: :show-inheritance: +datadog\_api\_client.v2.model.security\_monitoring\_azure\_app\_registration module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_azure_app_registration + :members: + :show-inheritance: + datadog\_api\_client.v2.model.security\_monitoring\_content\_pack\_activation module ------------------------------------------------------------------------------------ @@ -37517,6 +37524,34 @@ datadog\_api\_client.v2.model.security\_monitoring\_datasets\_list\_response mod :members: :show-inheritance: +datadog\_api\_client.v2.model.security\_monitoring\_entra\_id\_azure\_app\_registrations\_attributes module +----------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_monitoring\_entra\_id\_azure\_app\_registrations\_data module +----------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_monitoring\_entra\_id\_azure\_app\_registrations\_resource\_type module +--------------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_resource_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_monitoring\_entra\_id\_azure\_app\_registrations\_response module +--------------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.security\_monitoring\_filter module ----------------------------------------------------------------- @@ -37531,6 +37566,34 @@ datadog\_api\_client.v2.model.security\_monitoring\_filter\_action module :members: :show-inheritance: +datadog\_api\_client.v2.model.security\_monitoring\_integration\_activate\_attributes module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_integration_activate_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_monitoring\_integration\_activate\_data module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_integration_activate_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_monitoring\_integration\_activate\_request module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.security_monitoring_integration_activate_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.security\_monitoring\_integration\_activate\_resource\_type module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.security_monitoring_integration_activate_resource_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.security\_monitoring\_integration\_config\_attributes module ------------------------------------------------------------------------------------------ diff --git a/examples/v2/security-monitoring/ActivateIntegration.py b/examples/v2/security-monitoring/ActivateIntegration.py new file mode 100644 index 0000000000..4146aae1a6 --- /dev/null +++ b/examples/v2/security-monitoring/ActivateIntegration.py @@ -0,0 +1,40 @@ +""" +Activate an entity context sync integration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi +from datadog_api_client.v2.model.security_monitoring_integration_activate_attributes import ( + SecurityMonitoringIntegrationActivateAttributes, +) +from datadog_api_client.v2.model.security_monitoring_integration_activate_data import ( + SecurityMonitoringIntegrationActivateData, +) +from datadog_api_client.v2.model.security_monitoring_integration_activate_request import ( + SecurityMonitoringIntegrationActivateRequest, +) +from datadog_api_client.v2.model.security_monitoring_integration_activate_resource_type import ( + SecurityMonitoringIntegrationActivateResourceType, +) +from datadog_api_client.v2.model.security_monitoring_integration_config_settings import ( + SecurityMonitoringIntegrationConfigSettings, +) + +body = SecurityMonitoringIntegrationActivateRequest( + data=SecurityMonitoringIntegrationActivateData( + attributes=SecurityMonitoringIntegrationActivateAttributes( + domain="default", + name="My Entra ID Integration", + settings=SecurityMonitoringIntegrationConfigSettings([("setting1", "value1")]), + ), + type=SecurityMonitoringIntegrationActivateResourceType.ACTIVATE_ENTRA_ID_REQUEST, + ), +) + +configuration = Configuration() +configuration.unstable_operations["activate_integration"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.activate_integration(integration_type="entra_id", body=body) + + print(response) diff --git a/examples/v2/security-monitoring/DeactivateIntegration.py b/examples/v2/security-monitoring/DeactivateIntegration.py new file mode 100644 index 0000000000..efe902eeff --- /dev/null +++ b/examples/v2/security-monitoring/DeactivateIntegration.py @@ -0,0 +1,16 @@ +""" +Deactivate an entity context sync integration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["deactivate_integration"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.deactivate_integration( + integration_type="entra_id", + ) + + print(response) diff --git a/examples/v2/security-monitoring/GetEntraIdAzureAppRegistrations.py b/examples/v2/security-monitoring/GetEntraIdAzureAppRegistrations.py new file mode 100644 index 0000000000..d2ef82eddb --- /dev/null +++ b/examples/v2/security-monitoring/GetEntraIdAzureAppRegistrations.py @@ -0,0 +1,14 @@ +""" +Get Entra ID Azure App Registration prerequisites returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi + +configuration = Configuration() +configuration.unstable_operations["get_entra_id_azure_app_registrations"] = True +with ApiClient(configuration) as api_client: + api_instance = SecurityMonitoringApi(api_client) + response = api_instance.get_entra_id_azure_app_registrations() + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 3601b753e7..b743b035d3 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -395,6 +395,7 @@ def __init__( "v2.get_aws_cloud_auth_persona_mapping": False, "v2.list_aws_cloud_auth_persona_mappings": False, "v2.activate_content_pack": False, + "v2.activate_integration": False, "v2.attach_linear_issue": False, "v2.batch_get_security_monitoring_dataset_dependencies": False, "v2.bulk_create_sample_log_generation_subscriptions": False, @@ -413,6 +414,7 @@ def __init__( "v2.create_static_analysis_ast": False, "v2.create_static_analysis_server_analysis": False, "v2.deactivate_content_pack": False, + "v2.deactivate_integration": False, "v2.delete_historical_job": False, "v2.delete_sample_log_generation_subscription": False, "v2.delete_security_findings_automation_due_date_rule": False, @@ -423,6 +425,7 @@ def __init__( "v2.export_security_monitoring_terraform_resource": False, "v2.get_content_packs_states": False, "v2.get_entity_context": False, + "v2.get_entra_id_azure_app_registrations": False, "v2.get_finding": False, "v2.get_historical_job": False, "v2.get_indicator_of_compromise": False, 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 d521a21b5b..1a98439a99 100644 --- a/src/datadog_api_client/v2/api/security_monitoring_api.py +++ b/src/datadog_api_client/v2/api/security_monitoring_api.py @@ -117,12 +117,18 @@ from datadog_api_client.v2.model.security_monitoring_integration_config_create_request import ( SecurityMonitoringIntegrationConfigCreateRequest, ) +from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_response import ( + SecurityMonitoringEntraIdAzureAppRegistrationsResponse, +) from datadog_api_client.v2.model.security_monitoring_integration_credentials_validate_request import ( SecurityMonitoringIntegrationCredentialsValidateRequest, ) from datadog_api_client.v2.model.security_monitoring_integration_config_update_request import ( SecurityMonitoringIntegrationConfigUpdateRequest, ) +from datadog_api_client.v2.model.security_monitoring_integration_activate_request import ( + SecurityMonitoringIntegrationActivateRequest, +) from datadog_api_client.v2.model.notification_rule_preview_response import NotificationRulePreviewResponse from datadog_api_client.v2.model.security_filters_response import SecurityFiltersResponse from datadog_api_client.v2.model.security_filter_response import SecurityFilterResponse @@ -317,6 +323,31 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._activate_integration_endpoint = _Endpoint( + settings={ + "response_type": (SecurityMonitoringIntegrationConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security_monitoring/configuration/integration_config/{integration_type}/activate", + "operation_id": "activate_integration", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "integration_type": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_type", + "location": "path", + }, + "body": { + "openapi_types": (SecurityMonitoringIntegrationActivateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._attach_case_endpoint = _Endpoint( settings={ "response_type": (FindingCaseResponse,), @@ -1124,6 +1155,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._deactivate_integration_endpoint = _Endpoint( + settings={ + "response_type": (SecurityMonitoringIntegrationConfigResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security_monitoring/configuration/integration_config/{integration_type}/deactivate", + "operation_id": "deactivate_integration", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "integration_type": { + "required": True, + "openapi_types": (str,), + "attribute": "integration_type", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._delete_custom_framework_endpoint = _Endpoint( settings={ "response_type": (DeleteCustomFrameworkResponse,), @@ -1720,6 +1774,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_entra_id_azure_app_registrations_endpoint = _Endpoint( + settings={ + "response_type": (SecurityMonitoringEntraIdAzureAppRegistrationsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/security_monitoring/configuration/integration_config/entra_id/azure_app_registrations", + "operation_id": "get_entra_id_azure_app_registrations", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_finding_endpoint = _Endpoint( settings={ "response_type": (GetFindingResponse,), @@ -4573,6 +4643,32 @@ def activate_content_pack( return self._activate_content_pack_endpoint.call_with_http_info(**kwargs) + def activate_integration( + self, + integration_type: str, + *, + body: Union[SecurityMonitoringIntegrationActivateRequest, UnsetType] = unset, + ) -> SecurityMonitoringIntegrationConfigResponse: + """Activate an entity context sync integration. + + Activate an entity context sync integration for a source type that does not require manually + supplied credentials (for example, Entra ID). If an integration of this type already exists, + it is returned (re-enabling it first if it was disabled) instead of creating a duplicate. + + :param integration_type: The integration type to activate (for example, ``entra_id`` ). + :type integration_type: str + :param body: Optional configuration overrides for the integration to activate. + :type body: SecurityMonitoringIntegrationActivateRequest, optional + :rtype: SecurityMonitoringIntegrationConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_type"] = integration_type + + if body is not unset: + kwargs["body"] = body + + return self._activate_integration_endpoint.call_with_http_info(**kwargs) + def attach_case( self, case_id: str, @@ -5300,6 +5396,23 @@ def deactivate_content_pack( return self._deactivate_content_pack_endpoint.call_with_http_info(**kwargs) + def deactivate_integration( + self, + integration_type: str, + ) -> SecurityMonitoringIntegrationConfigResponse: + """Deactivate an entity context sync integration. + + Deactivate all active entity context sync integrations of the given source type (for example, Entra ID). + + :param integration_type: The integration type to deactivate (for example, ``entra_id`` ). + :type integration_type: str + :rtype: SecurityMonitoringIntegrationConfigResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["integration_type"] = integration_type + + return self._deactivate_integration_endpoint.call_with_http_info(**kwargs) + def delete_custom_framework( self, handle: str, @@ -5788,6 +5901,19 @@ def get_entity_context( return self._get_entity_context_endpoint.call_with_http_info(**kwargs) + def get_entra_id_azure_app_registrations( + self, + ) -> SecurityMonitoringEntraIdAzureAppRegistrationsResponse: + """Get Entra ID Azure App Registration prerequisites. + + Get the Azure App Registrations discovered for the organization and whether at least one of them has + resource collection enabled, which is a prerequisite for activating the Entra ID entity context sync integration. + + :rtype: SecurityMonitoringEntraIdAzureAppRegistrationsResponse + """ + kwargs: Dict[str, Any] = {} + return self._get_entra_id_azure_app_registrations_endpoint.call_with_http_info(**kwargs) + def get_finding( self, finding_id: str, diff --git a/src/datadog_api_client/v2/model/security_monitoring_azure_app_registration.py b/src/datadog_api_client/v2/model/security_monitoring_azure_app_registration.py new file mode 100644 index 0000000000..9a588b70c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_azure_app_registration.py @@ -0,0 +1,65 @@ +# 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 ( + ModelNormal, + cached_property, +) + + +class SecurityMonitoringAzureAppRegistration(ModelNormal): + @cached_property + def openapi_types(_): + return { + "client_id": (str,), + "error_count": (int,), + "resource_collection_enabled": (bool,), + "subscription_count": (int,), + "tenant_id": (str,), + } + + attribute_map = { + "client_id": "client_id", + "error_count": "error_count", + "resource_collection_enabled": "resource_collection_enabled", + "subscription_count": "subscription_count", + "tenant_id": "tenant_id", + } + + def __init__( + self_, + client_id: str, + error_count: int, + resource_collection_enabled: bool, + subscription_count: int, + tenant_id: str, + **kwargs, + ): + """ + An Azure App Registration discovered for the organization. + + :param client_id: The client ID of the App Registration. + :type client_id: str + + :param error_count: The number of errors encountered while crawling resources for this App Registration. + :type error_count: int + + :param resource_collection_enabled: Whether resource collection is enabled for this App Registration. + :type resource_collection_enabled: bool + + :param subscription_count: The number of Azure subscriptions associated with this App Registration. + :type subscription_count: int + + :param tenant_id: The Azure tenant ID of the App Registration. + :type tenant_id: str + """ + super().__init__(kwargs) + + self_.client_id = client_id + self_.error_count = error_count + self_.resource_collection_enabled = resource_collection_enabled + self_.subscription_count = subscription_count + self_.tenant_id = tenant_id diff --git a/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_attributes.py new file mode 100644 index 0000000000..20d345c8d6 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_attributes.py @@ -0,0 +1,82 @@ +# 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 typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_azure_app_registration import ( + SecurityMonitoringAzureAppRegistration, + ) + + +class SecurityMonitoringEntraIdAzureAppRegistrationsAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_azure_app_registration import ( + SecurityMonitoringAzureAppRegistration, + ) + + return { + "azure_app_registrations": ([SecurityMonitoringAzureAppRegistration],), + "has_valid_prerequisite": (bool,), + "integration_id": (str,), + "is_enabled": (bool,), + "subscribed_at": (datetime,), + } + + attribute_map = { + "azure_app_registrations": "azure_app_registrations", + "has_valid_prerequisite": "has_valid_prerequisite", + "integration_id": "integration_id", + "is_enabled": "is_enabled", + "subscribed_at": "subscribed_at", + } + + def __init__( + self_, + azure_app_registrations: List[SecurityMonitoringAzureAppRegistration], + has_valid_prerequisite: bool, + integration_id: Union[str, UnsetType] = unset, + is_enabled: Union[bool, UnsetType] = unset, + subscribed_at: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of the Entra ID Azure App Registration prerequisites. + + :param azure_app_registrations: The Azure App Registrations discovered for the organization. + :type azure_app_registrations: [SecurityMonitoringAzureAppRegistration] + + :param has_valid_prerequisite: Whether at least one Azure App Registration has resource collection enabled. + :type has_valid_prerequisite: bool + + :param integration_id: The ID of the Entra ID integration configuration, if one exists. + :type integration_id: str, optional + + :param is_enabled: Whether the Entra ID integration configuration is enabled, if one exists. + :type is_enabled: bool, optional + + :param subscribed_at: The time at which the Entra ID integration configuration was created, if one exists. + :type subscribed_at: datetime, optional + """ + if integration_id is not unset: + kwargs["integration_id"] = integration_id + if is_enabled is not unset: + kwargs["is_enabled"] = is_enabled + if subscribed_at is not unset: + kwargs["subscribed_at"] = subscribed_at + super().__init__(kwargs) + + self_.azure_app_registrations = azure_app_registrations + self_.has_valid_prerequisite = has_valid_prerequisite diff --git a/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_data.py b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_data.py new file mode 100644 index 0000000000..29e8e4dd4e --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_data.py @@ -0,0 +1,68 @@ +# 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 typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_attributes import ( + SecurityMonitoringEntraIdAzureAppRegistrationsAttributes, + ) + from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_resource_type import ( + SecurityMonitoringEntraIdAzureAppRegistrationsResourceType, + ) + + +class SecurityMonitoringEntraIdAzureAppRegistrationsData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_attributes import ( + SecurityMonitoringEntraIdAzureAppRegistrationsAttributes, + ) + from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_resource_type import ( + SecurityMonitoringEntraIdAzureAppRegistrationsResourceType, + ) + + return { + "attributes": (SecurityMonitoringEntraIdAzureAppRegistrationsAttributes,), + "id": (str,), + "type": (SecurityMonitoringEntraIdAzureAppRegistrationsResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: SecurityMonitoringEntraIdAzureAppRegistrationsAttributes, + id: str, + type: SecurityMonitoringEntraIdAzureAppRegistrationsResourceType, + **kwargs, + ): + """ + The Azure App Registration prerequisites for the Entra ID integration. + + :param attributes: The attributes of the Entra ID Azure App Registration prerequisites. + :type attributes: SecurityMonitoringEntraIdAzureAppRegistrationsAttributes + + :param id: The ID of the organization the Azure App Registrations belong to. + :type id: str + + :param type: The type of the resource. The value should always be ``entra_id_azure_app_registrations``. + :type type: SecurityMonitoringEntraIdAzureAppRegistrationsResourceType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_resource_type.py b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_resource_type.py new file mode 100644 index 0000000000..5803a47b82 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_resource_type.py @@ -0,0 +1,37 @@ +# 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 SecurityMonitoringEntraIdAzureAppRegistrationsResourceType(ModelSimple): + """ + The type of the resource. The value should always be `entra_id_azure_app_registrations`. + + :param value: If omitted defaults to "entra_id_azure_app_registrations". Must be one of ["entra_id_azure_app_registrations"]. + :type value: str + """ + + allowed_values = { + "entra_id_azure_app_registrations", + } + ENTRA_ID_AZURE_APP_REGISTRATIONS: ClassVar["SecurityMonitoringEntraIdAzureAppRegistrationsResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SecurityMonitoringEntraIdAzureAppRegistrationsResourceType.ENTRA_ID_AZURE_APP_REGISTRATIONS = ( + SecurityMonitoringEntraIdAzureAppRegistrationsResourceType("entra_id_azure_app_registrations") +) diff --git a/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_response.py b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_response.py new file mode 100644 index 0000000000..21a7f4df25 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_entra_id_azure_app_registrations_response.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 typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_data import ( + SecurityMonitoringEntraIdAzureAppRegistrationsData, + ) + + +class SecurityMonitoringEntraIdAzureAppRegistrationsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_data import ( + SecurityMonitoringEntraIdAzureAppRegistrationsData, + ) + + return { + "data": (SecurityMonitoringEntraIdAzureAppRegistrationsData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: SecurityMonitoringEntraIdAzureAppRegistrationsData, **kwargs): + """ + Response containing the Azure App Registration prerequisites for the Entra ID integration. + + :param data: The Azure App Registration prerequisites for the Entra ID integration. + :type data: SecurityMonitoringEntraIdAzureAppRegistrationsData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_activate_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_attributes.py new file mode 100644 index 0000000000..a63101339b --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_attributes.py @@ -0,0 +1,66 @@ +# 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 typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_integration_config_settings import ( + SecurityMonitoringIntegrationConfigSettings, + ) + + +class SecurityMonitoringIntegrationActivateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_integration_config_settings import ( + SecurityMonitoringIntegrationConfigSettings, + ) + + return { + "domain": (str,), + "name": (str,), + "settings": (SecurityMonitoringIntegrationConfigSettings,), + } + + attribute_map = { + "domain": "domain", + "name": "name", + "settings": "settings", + } + + def __init__( + self_, + domain: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + settings: Union[SecurityMonitoringIntegrationConfigSettings, UnsetType] = unset, + **kwargs, + ): + """ + Overrides applied when activating the integration. All fields are optional. + + :param domain: The domain associated with the external entity source. + :type domain: str, optional + + :param name: The display name for the entity context sync configuration. + :type name: str, optional + + :param settings: Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. + :type settings: SecurityMonitoringIntegrationConfigSettings, optional + """ + if domain is not unset: + kwargs["domain"] = domain + if name is not unset: + kwargs["name"] = name + if settings is not unset: + kwargs["settings"] = settings + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_activate_data.py b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_data.py new file mode 100644 index 0000000000..ac507b9763 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_data.py @@ -0,0 +1,64 @@ +# 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 typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_integration_activate_attributes import ( + SecurityMonitoringIntegrationActivateAttributes, + ) + from datadog_api_client.v2.model.security_monitoring_integration_activate_resource_type import ( + SecurityMonitoringIntegrationActivateResourceType, + ) + + +class SecurityMonitoringIntegrationActivateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_integration_activate_attributes import ( + SecurityMonitoringIntegrationActivateAttributes, + ) + from datadog_api_client.v2.model.security_monitoring_integration_activate_resource_type import ( + SecurityMonitoringIntegrationActivateResourceType, + ) + + return { + "attributes": (SecurityMonitoringIntegrationActivateAttributes,), + "type": (SecurityMonitoringIntegrationActivateResourceType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: Union[SecurityMonitoringIntegrationActivateAttributes, UnsetType] = unset, + type: Union[SecurityMonitoringIntegrationActivateResourceType, UnsetType] = unset, + **kwargs, + ): + """ + The configuration overrides for the integration to activate. + + :param attributes: Overrides applied when activating the integration. All fields are optional. + :type attributes: SecurityMonitoringIntegrationActivateAttributes, optional + + :param type: The type of the resource. The value should always be ``activate_entra_id_request``. + :type type: SecurityMonitoringIntegrationActivateResourceType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_activate_request.py b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_request.py new file mode 100644 index 0000000000..8547885517 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_request.py @@ -0,0 +1,46 @@ +# 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 typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.security_monitoring_integration_activate_data import ( + SecurityMonitoringIntegrationActivateData, + ) + + +class SecurityMonitoringIntegrationActivateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.security_monitoring_integration_activate_data import ( + SecurityMonitoringIntegrationActivateData, + ) + + return { + "data": (SecurityMonitoringIntegrationActivateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[SecurityMonitoringIntegrationActivateData, UnsetType] = unset, **kwargs): + """ + Request body to activate an entity context sync integration for a source type that does not require secrets. + + :param data: The configuration overrides for the integration to activate. + :type data: SecurityMonitoringIntegrationActivateData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_activate_resource_type.py b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_resource_type.py new file mode 100644 index 0000000000..c575623e72 --- /dev/null +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_activate_resource_type.py @@ -0,0 +1,37 @@ +# 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 SecurityMonitoringIntegrationActivateResourceType(ModelSimple): + """ + The type of the resource. The value should always be `activate_entra_id_request`. + + :param value: If omitted defaults to "activate_entra_id_request". Must be one of ["activate_entra_id_request"]. + :type value: str + """ + + allowed_values = { + "activate_entra_id_request", + } + ACTIVATE_ENTRA_ID_REQUEST: ClassVar["SecurityMonitoringIntegrationActivateResourceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +SecurityMonitoringIntegrationActivateResourceType.ACTIVATE_ENTRA_ID_REQUEST = ( + SecurityMonitoringIntegrationActivateResourceType("activate_entra_id_request") +) diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_config_create_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_integration_config_create_attributes.py index 9d476fe512..998358579f 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_integration_config_create_attributes.py +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_config_create_attributes.py @@ -55,7 +55,7 @@ def __init__( domain: str, integration_type: SecurityMonitoringIntegrationType, name: str, - secrets: SecurityMonitoringIntegrationConfigSecrets, + secrets: Union[SecurityMonitoringIntegrationConfigSecrets, UnsetType] = unset, settings: Union[SecurityMonitoringIntegrationConfigSettings, UnsetType] = unset, **kwargs, ): @@ -71,12 +71,15 @@ def __init__( :param name: The display name for the entity context sync configuration. :type name: str - :param secrets: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, ``admin_email`` for Google Workspace). - :type secrets: SecurityMonitoringIntegrationConfigSecrets + :param secrets: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type + (for example, ``admin_email`` for Google Workspace). Not required for source types that do not use secrets (for example, ``ENTRA_ID`` ). + :type secrets: SecurityMonitoringIntegrationConfigSecrets, optional :param settings: Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. :type settings: SecurityMonitoringIntegrationConfigSettings, optional """ + if secrets is not unset: + kwargs["secrets"] = secrets if settings is not unset: kwargs["settings"] = settings super().__init__(kwargs) @@ -84,4 +87,3 @@ def __init__( self_.domain = domain self_.integration_type = integration_type self_.name = name - self_.secrets = secrets diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_config_secrets.py b/src/datadog_api_client/v2/model/security_monitoring_integration_config_secrets.py index 11fcc09cf2..3eccc7ffd6 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_integration_config_secrets.py +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_config_secrets.py @@ -12,6 +12,7 @@ class SecurityMonitoringIntegrationConfigSecrets(ModelNormal): def __init__(self_, **kwargs): """ - The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, ``admin_email`` for Google Workspace). + The secrets used to authenticate against the external entity source. The accepted keys depend on the source type + (for example, ``admin_email`` for Google Workspace). Not required for source types that do not use secrets (for example, ``ENTRA_ID`` ). """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_config_update_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_integration_config_update_attributes.py index f07e1a37ad..00385e1d73 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_integration_config_update_attributes.py +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_config_update_attributes.py @@ -77,7 +77,8 @@ def __init__( :param name: The new display name for the entity context sync configuration. :type name: str, optional - :param secrets: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, ``admin_email`` for Google Workspace). + :param secrets: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type + (for example, ``admin_email`` for Google Workspace). Not required for source types that do not use secrets (for example, ``ENTRA_ID`` ). :type secrets: SecurityMonitoringIntegrationConfigSecrets, optional :param settings: Free-form, non-sensitive settings for the entity context sync. The accepted keys depend on the source type. diff --git a/src/datadog_api_client/v2/model/security_monitoring_integration_credentials_validate_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_integration_credentials_validate_attributes.py index 10702347a5..b8a1aacc42 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_integration_credentials_validate_attributes.py +++ b/src/datadog_api_client/v2/model/security_monitoring_integration_credentials_validate_attributes.py @@ -3,11 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -42,7 +44,7 @@ def __init__( self_, domain: str, integration_type: SecurityMonitoringIntegrationType, - secrets: SecurityMonitoringIntegrationConfigSecrets, + secrets: Union[SecurityMonitoringIntegrationConfigSecrets, UnsetType] = unset, **kwargs, ): """ @@ -54,11 +56,13 @@ def __init__( :param integration_type: The type of external source that provides entities to Cloud SIEM. :type integration_type: SecurityMonitoringIntegrationType - :param secrets: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type (for example, ``admin_email`` for Google Workspace). - :type secrets: SecurityMonitoringIntegrationConfigSecrets + :param secrets: The secrets used to authenticate against the external entity source. The accepted keys depend on the source type + (for example, ``admin_email`` for Google Workspace). Not required for source types that do not use secrets (for example, ``ENTRA_ID`` ). + :type secrets: SecurityMonitoringIntegrationConfigSecrets, optional """ + if secrets is not unset: + kwargs["secrets"] = secrets super().__init__(kwargs) self_.domain = domain self_.integration_type = integration_type - self_.secrets = secrets diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e17704ed4f..07daae87cb 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -7353,6 +7353,9 @@ from datadog_api_client.v2.model.security_findings_search_request_page import SecurityFindingsSearchRequestPage from datadog_api_client.v2.model.security_findings_sort import SecurityFindingsSort from datadog_api_client.v2.model.security_findings_status import SecurityFindingsStatus +from datadog_api_client.v2.model.security_monitoring_azure_app_registration import ( + SecurityMonitoringAzureAppRegistration, +) from datadog_api_client.v2.model.security_monitoring_content_pack_activation import ( SecurityMonitoringContentPackActivation, ) @@ -7483,8 +7486,32 @@ from datadog_api_client.v2.model.security_monitoring_datasets_list_response import ( SecurityMonitoringDatasetsListResponse, ) +from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_attributes import ( + SecurityMonitoringEntraIdAzureAppRegistrationsAttributes, +) +from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_data import ( + SecurityMonitoringEntraIdAzureAppRegistrationsData, +) +from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_resource_type import ( + SecurityMonitoringEntraIdAzureAppRegistrationsResourceType, +) +from datadog_api_client.v2.model.security_monitoring_entra_id_azure_app_registrations_response import ( + SecurityMonitoringEntraIdAzureAppRegistrationsResponse, +) from datadog_api_client.v2.model.security_monitoring_filter import SecurityMonitoringFilter from datadog_api_client.v2.model.security_monitoring_filter_action import SecurityMonitoringFilterAction +from datadog_api_client.v2.model.security_monitoring_integration_activate_attributes import ( + SecurityMonitoringIntegrationActivateAttributes, +) +from datadog_api_client.v2.model.security_monitoring_integration_activate_data import ( + SecurityMonitoringIntegrationActivateData, +) +from datadog_api_client.v2.model.security_monitoring_integration_activate_request import ( + SecurityMonitoringIntegrationActivateRequest, +) +from datadog_api_client.v2.model.security_monitoring_integration_activate_resource_type import ( + SecurityMonitoringIntegrationActivateResourceType, +) from datadog_api_client.v2.model.security_monitoring_integration_config_attributes import ( SecurityMonitoringIntegrationConfigAttributes, ) @@ -14966,6 +14993,7 @@ "SecurityFindingsSearchRequestPage", "SecurityFindingsSort", "SecurityFindingsStatus", + "SecurityMonitoringAzureAppRegistration", "SecurityMonitoringContentPackActivation", "SecurityMonitoringContentPackIntegrationStatus", "SecurityMonitoringContentPackStateAttributes", @@ -15020,8 +15048,16 @@ "SecurityMonitoringDatasetVersionHistoryType", "SecurityMonitoringDatasetsListMeta", "SecurityMonitoringDatasetsListResponse", + "SecurityMonitoringEntraIdAzureAppRegistrationsAttributes", + "SecurityMonitoringEntraIdAzureAppRegistrationsData", + "SecurityMonitoringEntraIdAzureAppRegistrationsResourceType", + "SecurityMonitoringEntraIdAzureAppRegistrationsResponse", "SecurityMonitoringFilter", "SecurityMonitoringFilterAction", + "SecurityMonitoringIntegrationActivateAttributes", + "SecurityMonitoringIntegrationActivateData", + "SecurityMonitoringIntegrationActivateRequest", + "SecurityMonitoringIntegrationActivateResourceType", "SecurityMonitoringIntegrationConfigAttributes", "SecurityMonitoringIntegrationConfigCreateAttributes", "SecurityMonitoringIntegrationConfigCreateData", diff --git a/tests/v2/features/security_monitoring.feature b/tests/v2/features/security_monitoring.feature index c204c1d587..e2fb1a68b9 100644 --- a/tests/v2/features/security_monitoring.feature +++ b/tests/v2/features/security_monitoring.feature @@ -9,6 +9,33 @@ Feature: Security Monitoring And a valid "appKeyAuth" key in the system And an instance of "SecurityMonitoring" API + @generated @skip @team:DataDog/cloud-siem + Scenario: Activate an entity context sync integration returns "Bad Request" response + Given operation "ActivateIntegration" enabled + And new "ActivateIntegration" request + And request contains "integration_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "default", "name": "My Entra ID Integration", "settings": {"setting1": "value1"}}, "type": "activate_entra_id_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-siem + Scenario: Activate an entity context sync integration returns "Not Found" response + Given operation "ActivateIntegration" enabled + And new "ActivateIntegration" request + And request contains "integration_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "default", "name": "My Entra ID Integration", "settings": {"setting1": "value1"}}, "type": "activate_entra_id_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-siem + Scenario: Activate an entity context sync integration returns "OK" response + Given operation "ActivateIntegration" enabled + And new "ActivateIntegration" request + And request contains "integration_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"domain": "default", "name": "My Entra ID Integration", "settings": {"setting1": "value1"}}, "type": "activate_entra_id_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-siem Scenario: Activate content pack returns "Accepted" response Given operation "ActivateContentPack" enabled @@ -1093,6 +1120,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 201 Created + @generated @skip @team:DataDog/cloud-siem + Scenario: Deactivate an entity context sync integration returns "Not Found" response + Given operation "DeactivateIntegration" enabled + And new "DeactivateIntegration" request + And request contains "integration_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-siem + Scenario: Deactivate an entity context sync integration returns "OK" response + Given operation "DeactivateIntegration" enabled + And new "DeactivateIntegration" request + And request contains "integration_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-siem Scenario: Deactivate content pack returns "Accepted" response Given operation "DeactivateContentPack" enabled @@ -1439,6 +1482,13 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-siem + Scenario: Get Entra ID Azure App Registration prerequisites returns "OK" response + Given operation "GetEntraIdAzureAppRegistrations" enabled + And new "GetEntraIdAzureAppRegistrations" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given new "GetSBOM" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 9db948088a..1eaba52ee9 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -7526,6 +7526,12 @@ "type": "unsafe" } }, + "GetEntraIdAzureAppRegistrations": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ValidateSecurityMonitoringIntegrationCredentials": { "tag": "Security Monitoring", "undo": { @@ -7556,6 +7562,18 @@ "type": "safe" } }, + "ActivateIntegration": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeactivateIntegration": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "SendSecurityMonitoringNotificationPreview": { "tag": "Security Monitoring", "undo": {