From 9720fa44dc6e785c60ee9af555b5fea0564f34e0 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 10 Mar 2020 09:41:54 -0700 Subject: [PATCH] feat: add support for notification configs to v1 (#15) --- .../gapic/security_center_client.py | 481 ++++++++++- .../gapic/security_center_client_config.py | 25 + .../security_center_grpc_transport.py | 65 ++ .../cloud/securitycenter_v1/proto/asset.proto | 5 +- .../securitycenter_v1/proto/asset_pb2.py | 12 +- .../securitycenter_v1/proto/finding.proto | 5 +- .../securitycenter_v1/proto/finding_pb2.py | 6 +- .../proto/notification_config.proto | 96 +++ .../proto/notification_config_pb2.py | 288 +++++++ .../proto/notification_config_pb2_grpc.py | 2 + .../proto/notification_message.proto | 41 + .../proto/notification_message_pb2.py | 145 ++++ .../proto/notification_message_pb2_grpc.py | 2 + .../proto/organization_settings.proto | 5 +- .../proto/organization_settings_pb2.py | 10 +- .../proto/run_asset_discovery_response.proto | 5 +- .../proto/run_asset_discovery_response_pb2.py | 6 +- .../proto/security_marks.proto | 5 +- .../proto/security_marks_pb2.py | 6 +- .../proto/securitycenter_service.proto | 261 ++++-- .../proto/securitycenter_service_pb2.py | 783 +++++++++++++++--- .../proto/securitycenter_service_pb2_grpc.py | 90 ++ .../securitycenter_v1/proto/source.proto | 5 +- .../securitycenter_v1/proto/source_pb2.py | 6 +- google/cloud/securitycenter_v1/types.py | 6 + .../proto/security_marks_pb2.py | 8 +- .../proto/source_pb2.py | 8 +- .../proto/source_pb2.py | 8 +- synth.metadata | 12 +- .../v1/test_security_center_client_v1.py | 249 ++++++ 30 files changed, 2429 insertions(+), 217 deletions(-) create mode 100644 google/cloud/securitycenter_v1/proto/notification_config.proto create mode 100644 google/cloud/securitycenter_v1/proto/notification_config_pb2.py create mode 100644 google/cloud/securitycenter_v1/proto/notification_config_pb2_grpc.py create mode 100644 google/cloud/securitycenter_v1/proto/notification_message.proto create mode 100644 google/cloud/securitycenter_v1/proto/notification_message_pb2.py create mode 100644 google/cloud/securitycenter_v1/proto/notification_message_pb2_grpc.py diff --git a/google/cloud/securitycenter_v1/gapic/security_center_client.py b/google/cloud/securitycenter_v1/gapic/security_center_client.py index c5a29e25..a0b8bef5 100644 --- a/google/cloud/securitycenter_v1/gapic/security_center_client.py +++ b/google/cloud/securitycenter_v1/gapic/security_center_client.py @@ -39,6 +39,7 @@ security_center_grpc_transport, ) from google.cloud.securitycenter_v1.proto import finding_pb2 +from google.cloud.securitycenter_v1.proto import notification_config_pb2 from google.cloud.securitycenter_v1.proto import organization_settings_pb2 from google.cloud.securitycenter_v1.proto import run_asset_discovery_response_pb2 from google.cloud.securitycenter_v1.proto import security_marks_pb2 @@ -119,6 +120,15 @@ def finding_security_marks_path(cls, organization, source, finding): finding=finding, ) + @classmethod + def notification_config_path(cls, organization, notification_config): + """Return a fully-qualified notification_config string.""" + return google.api_core.path_template.expand( + "organizations/{organization}/notificationConfigs/{notification_config}", + organization=organization, + notification_config=notification_config, + ) + @classmethod def organization_path(cls, organization): """Return a fully-qualified organization string.""" @@ -143,6 +153,13 @@ def source_path(cls, organization, source): source=source, ) + @classmethod + def topic_path(cls, project, topic): + """Return a fully-qualified topic string.""" + return google.api_core.path_template.expand( + "projects/{project}/topics/{topic}", project=project, topic=topic, + ) + def __init__( self, transport=None, @@ -707,12 +724,18 @@ def group_findings( Possible "state\_change" values when compare\_duration is specified: - - "CHANGED": indicates that the finding was present at the start of - compare\_duration, but changed its state at read\_time. - - "UNCHANGED": indicates that the finding was present at the start of - compare\_duration and did not change state at read\_time. - - "ADDED": indicates that the finding was not present at the start of - compare\_duration, but was present at read\_time. + - "CHANGED": indicates that the finding was present and matched the + given filter at the start of compare\_duration, but changed its state + at read\_time. + - "UNCHANGED": indicates that the finding was present and matched the + given filter at the start of compare\_duration and did not change + state at read\_time. + - "ADDED": indicates that the finding did not match the given filter or + was not present at the start of compare\_duration, but was present at + read\_time. + - "REMOVED": indicates that the finding was present and matched the + filter at the start of compare\_duration, but did not match the + filter at read\_time. If compare\_duration is not specified, then the only possible state\_change is "UNUSED", which will be the state\_change set for all @@ -1048,6 +1071,237 @@ def create_finding( request, retry=retry, timeout=timeout, metadata=metadata ) + def create_notification_config( + self, + parent, + config_id, + notification_config, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Creates a notification config. + + Example: + >>> from google.cloud import securitycenter_v1 + >>> + >>> client = securitycenter_v1.SecurityCenterClient() + >>> + >>> parent = client.organization_path('[ORGANIZATION]') + >>> + >>> # TODO: Initialize `config_id`: + >>> config_id = '' + >>> + >>> # TODO: Initialize `notification_config`: + >>> notification_config = {} + >>> + >>> response = client.create_notification_config(parent, config_id, notification_config) + + Args: + parent (str): Required. Resource name of the new notification config's parent. Its + format is "organizations/[organization\_id]". + config_id (str): Required. + Unique identifier provided by the client within the parent scope. + It must be between 1 and 128 characters, and contains alphanumeric + characters, underscores or hyphens only. + notification_config (Union[dict, ~google.cloud.securitycenter_v1.types.NotificationConfig]): Required. The notification config being created. The name and the service + account will be ignored as they are both output only fields on this + resource. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.securitycenter_v1.types.NotificationConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.securitycenter_v1.types.NotificationConfig` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "create_notification_config" not in self._inner_api_calls: + self._inner_api_calls[ + "create_notification_config" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_notification_config, + default_retry=self._method_configs["CreateNotificationConfig"].retry, + default_timeout=self._method_configs[ + "CreateNotificationConfig" + ].timeout, + client_info=self._client_info, + ) + + request = securitycenter_service_pb2.CreateNotificationConfigRequest( + parent=parent, config_id=config_id, notification_config=notification_config, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_notification_config"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_notification_config( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes a notification config. + + Example: + >>> from google.cloud import securitycenter_v1 + >>> + >>> client = securitycenter_v1.SecurityCenterClient() + >>> + >>> name = client.notification_config_path('[ORGANIZATION]', '[NOTIFICATION_CONFIG]') + >>> + >>> client.delete_notification_config(name) + + Args: + name (str): Required. Name of the notification config to delete. Its format is + "organizations/[organization\_id]/notificationConfigs/[config\_id]". + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_notification_config" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_notification_config" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_notification_config, + default_retry=self._method_configs["DeleteNotificationConfig"].retry, + default_timeout=self._method_configs[ + "DeleteNotificationConfig" + ].timeout, + client_info=self._client_info, + ) + + request = securitycenter_service_pb2.DeleteNotificationConfigRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_notification_config"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_notification_config( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets a notification config. + + Example: + >>> from google.cloud import securitycenter_v1 + >>> + >>> client = securitycenter_v1.SecurityCenterClient() + >>> + >>> name = client.notification_config_path('[ORGANIZATION]', '[NOTIFICATION_CONFIG]') + >>> + >>> response = client.get_notification_config(name) + + Args: + name (str): Required. Name of the notification config to get. Its format is + "organizations/[organization\_id]/notificationConfigs/[config\_id]". + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.securitycenter_v1.types.NotificationConfig` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_notification_config" not in self._inner_api_calls: + self._inner_api_calls[ + "get_notification_config" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_notification_config, + default_retry=self._method_configs["GetNotificationConfig"].retry, + default_timeout=self._method_configs["GetNotificationConfig"].timeout, + client_info=self._client_info, + ) + + request = securitycenter_service_pb2.GetNotificationConfigRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_notification_config"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + def get_organization_settings( self, name, @@ -1349,9 +1603,8 @@ def list_assets( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.securitycenter_v1.types.Duration` - field_mask (Union[dict, ~google.cloud.securitycenter_v1.types.FieldMask]): Optional. A field mask to specify the ListAssetsResult fields to be listed in the - response. - An empty field mask will list all fields. + field_mask (Union[dict, ~google.cloud.securitycenter_v1.types.FieldMask]): Optional. A field mask to specify the ListAssetsResult fields to be listed + in the response. An empty field mask will list all fields. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.securitycenter_v1.types.FieldMask` @@ -1545,12 +1798,18 @@ def list_findings( Possible "state\_change" values when compare\_duration is specified: - - "CHANGED": indicates that the finding was present at the start of - compare\_duration, but changed its state at read\_time. - - "UNCHANGED": indicates that the finding was present at the start of - compare\_duration and did not change state at read\_time. - - "ADDED": indicates that the finding was not present at the start of - compare\_duration, but was present at read\_time. + - "CHANGED": indicates that the finding was present and matched the + given filter at the start of compare\_duration, but changed its state + at read\_time. + - "UNCHANGED": indicates that the finding was present and matched the + given filter at the start of compare\_duration and did not change + state at read\_time. + - "ADDED": indicates that the finding did not match the given filter or + was not present at the start of compare\_duration, but was present at + read\_time. + - "REMOVED": indicates that the finding was present and matched the + filter at the start of compare\_duration, but did not match the + filter at read\_time. If compare\_duration is not specified, then the only possible state\_change is "UNUSED", which will be the state\_change set for all @@ -1558,8 +1817,8 @@ def list_findings( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.securitycenter_v1.types.Duration` - field_mask (Union[dict, ~google.cloud.securitycenter_v1.types.FieldMask]): Optional. A field mask to specify the Finding fields to be listed in the response. - An empty field mask will list all fields. + field_mask (Union[dict, ~google.cloud.securitycenter_v1.types.FieldMask]): Optional. A field mask to specify the Finding fields to be listed in the + response. An empty field mask will list all fields. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.securitycenter_v1.types.FieldMask` @@ -1638,6 +1897,110 @@ def list_findings( ) return iterator + def list_notification_configs( + self, + parent, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists notification configs. + + Example: + >>> from google.cloud import securitycenter_v1 + >>> + >>> client = securitycenter_v1.SecurityCenterClient() + >>> + >>> parent = client.organization_path('[ORGANIZATION]') + >>> + >>> # Iterate over all results + >>> for element in client.list_notification_configs(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_notification_configs(parent).pages: + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. Name of the organization to list notification configs. Its + format is "organizations/[organization\_id]". + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.securitycenter_v1.types.NotificationConfig` instances. + You can also iterate over the pages of the response + using its `pages` property. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_notification_configs" not in self._inner_api_calls: + self._inner_api_calls[ + "list_notification_configs" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_notification_configs, + default_retry=self._method_configs["ListNotificationConfigs"].retry, + default_timeout=self._method_configs["ListNotificationConfigs"].timeout, + client_info=self._client_info, + ) + + request = securitycenter_service_pb2.ListNotificationConfigsRequest( + parent=parent, page_size=page_size, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_notification_configs"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="notification_configs", + request_token_field="page_token", + response_token_field="next_page_token", + ) + return iterator + def list_sources( self, parent, @@ -2095,6 +2458,90 @@ def update_finding( request, retry=retry, timeout=timeout, metadata=metadata ) + def update_notification_config( + self, + notification_config, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Updates a notification config. + + Example: + >>> from google.cloud import securitycenter_v1 + >>> + >>> client = securitycenter_v1.SecurityCenterClient() + >>> + >>> # TODO: Initialize `notification_config`: + >>> notification_config = {} + >>> + >>> response = client.update_notification_config(notification_config) + + Args: + notification_config (Union[dict, ~google.cloud.securitycenter_v1.types.NotificationConfig]): Required. The notification config to update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.securitycenter_v1.types.NotificationConfig` + update_mask (Union[dict, ~google.cloud.securitycenter_v1.types.FieldMask]): The FieldMask to use when updating the notification config. + + If empty all mutable fields will be updated. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.securitycenter_v1.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.securitycenter_v1.types.NotificationConfig` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "update_notification_config" not in self._inner_api_calls: + self._inner_api_calls[ + "update_notification_config" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.update_notification_config, + default_retry=self._method_configs["UpdateNotificationConfig"].retry, + default_timeout=self._method_configs[ + "UpdateNotificationConfig" + ].timeout, + client_info=self._client_info, + ) + + request = securitycenter_service_pb2.UpdateNotificationConfigRequest( + notification_config=notification_config, update_mask=update_mask, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("notification_config.name", notification_config.name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["update_notification_config"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + def update_organization_settings( self, organization_settings, diff --git a/google/cloud/securitycenter_v1/gapic/security_center_client_config.py b/google/cloud/securitycenter_v1/gapic/security_center_client_config.py index f65ea265..7bf5a897 100644 --- a/google/cloud/securitycenter_v1/gapic/security_center_client_config.py +++ b/google/cloud/securitycenter_v1/gapic/security_center_client_config.py @@ -47,6 +47,21 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, + "CreateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "DeleteNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "GetNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, "GetOrganizationSettings": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -67,6 +82,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "default", }, + "ListNotificationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, "ListSources": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -92,6 +112,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, + "UpdateNotificationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, "UpdateOrganizationSettings": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/google/cloud/securitycenter_v1/gapic/transports/security_center_grpc_transport.py b/google/cloud/securitycenter_v1/gapic/transports/security_center_grpc_transport.py index 3b665b69..8f9c9e15 100644 --- a/google/cloud/securitycenter_v1/gapic/transports/security_center_grpc_transport.py +++ b/google/cloud/securitycenter_v1/gapic/transports/security_center_grpc_transport.py @@ -204,6 +204,45 @@ def create_finding(self): """ return self._stubs["security_center_stub"].CreateFinding + @property + def create_notification_config(self): + """Return the gRPC stub for :meth:`SecurityCenterClient.create_notification_config`. + + Creates a notification config. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["security_center_stub"].CreateNotificationConfig + + @property + def delete_notification_config(self): + """Return the gRPC stub for :meth:`SecurityCenterClient.delete_notification_config`. + + Deletes a notification config. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["security_center_stub"].DeleteNotificationConfig + + @property + def get_notification_config(self): + """Return the gRPC stub for :meth:`SecurityCenterClient.get_notification_config`. + + Gets a notification config. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["security_center_stub"].GetNotificationConfig + @property def get_organization_settings(self): """Return the gRPC stub for :meth:`SecurityCenterClient.get_organization_settings`. @@ -259,6 +298,19 @@ def list_findings(self): """ return self._stubs["security_center_stub"].ListFindings + @property + def list_notification_configs(self): + """Return the gRPC stub for :meth:`SecurityCenterClient.list_notification_configs`. + + Lists notification configs. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["security_center_stub"].ListNotificationConfigs + @property def list_sources(self): """Return the gRPC stub for :meth:`SecurityCenterClient.list_sources`. @@ -330,6 +382,19 @@ def update_finding(self): """ return self._stubs["security_center_stub"].UpdateFinding + @property + def update_notification_config(self): + """Return the gRPC stub for :meth:`SecurityCenterClient.update_notification_config`. + + Updates a notification config. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["security_center_stub"].UpdateNotificationConfig + @property def update_organization_settings(self): """Return the gRPC stub for :meth:`SecurityCenterClient.update_organization_settings`. diff --git a/google/cloud/securitycenter_v1/proto/asset.proto b/google/cloud/securitycenter_v1/proto/asset.proto index bd4751a1..b079e5c5 100644 --- a/google/cloud/securitycenter_v1/proto/asset.proto +++ b/google/cloud/securitycenter_v1/proto/asset.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,17 +11,16 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; +import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/google/cloud/securitycenter_v1/proto/asset_pb2.py b/google/cloud/securitycenter_v1/proto/asset_pb2.py index 9808217f..dd1175a2 100644 --- a/google/cloud/securitycenter_v1/proto/asset_pb2.py +++ b/google/cloud/securitycenter_v1/proto/asset_pb2.py @@ -15,13 +15,13 @@ _sym_db = _symbol_database.Default() +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.securitycenter_v1.proto import ( security_marks_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_security__marks__pb2, ) from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -32,14 +32,14 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\n0google/cloud/securitycenter_v1/proto/asset.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a\x39google/cloud/securitycenter_v1/proto/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x92\x07\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x62\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32>.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties\x12Z\n\x13resource_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Asset.ResourcePropertiesEntry\x12\x45\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\niam_policy\x18\x0b \x01(\x0b\x32/.google.cloud.securitycenter.v1.Asset.IamPolicy\x1a\x80\x02\n\x18SecurityCenterProperties\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x12\x1d\n\x15resource_display_name\x18\x06 \x01(\t\x12$\n\x1cresource_parent_display_name\x18\x07 \x01(\t\x12%\n\x1dresource_project_display_name\x18\x08 \x01(\t\x1a \n\tIamPolicy\x12\x13\n\x0bpolicy_blob\x18\x01 \x01(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:U\xea\x41R\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}B\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\n0google/cloud/securitycenter_v1/proto/asset.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/securitycenter_v1/proto/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x92\x07\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x62\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32>.google.cloud.securitycenter.v1.Asset.SecurityCenterProperties\x12Z\n\x13resource_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Asset.ResourcePropertiesEntry\x12\x45\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\niam_policy\x18\x0b \x01(\x0b\x32/.google.cloud.securitycenter.v1.Asset.IamPolicy\x1a\x80\x02\n\x18SecurityCenterProperties\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x12\x1d\n\x15resource_display_name\x18\x06 \x01(\t\x12$\n\x1cresource_parent_display_name\x18\x07 \x01(\t\x12%\n\x1dresource_project_display_name\x18\x08 \x01(\t\x1a \n\tIamPolicy\x12\x13\n\x0bpolicy_blob\x18\x01 \x01(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:U\xea\x41R\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}B\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_security__marks__pb2.DESCRIPTOR, google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, ], ) @@ -533,9 +533,9 @@ dict( DESCRIPTOR=_ASSET_IAMPOLICY, __module__="google.cloud.securitycenter_v1.proto.asset_pb2", - __doc__="""IAM Policy information associated with the GCP resource - described by the Cloud SCC asset. This information is managed and - defined by the GCP resource and cannot be modified by the user. + __doc__="""IAM Policy information associated with the GCP resource described by the + Cloud SCC asset. This information is managed and defined by the GCP + resource and cannot be modified by the user. Attributes: diff --git a/google/cloud/securitycenter_v1/proto/finding.proto b/google/cloud/securitycenter_v1/proto/finding.proto index 5d8e5a78..9a3261c4 100644 --- a/google/cloud/securitycenter_v1/proto/finding.proto +++ b/google/cloud/securitycenter_v1/proto/finding.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,18 +11,17 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/google/cloud/securitycenter_v1/proto/finding_pb2.py b/google/cloud/securitycenter_v1/proto/finding_pb2.py index 0b44db03..78ebc2c0 100644 --- a/google/cloud/securitycenter_v1/proto/finding_pb2.py +++ b/google/cloud/securitycenter_v1/proto/finding_pb2.py @@ -15,6 +15,7 @@ _sym_db = _symbol_database.Default() +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.securitycenter_v1.proto import ( @@ -22,7 +23,6 @@ ) from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -33,15 +33,15 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\n2google/cloud/securitycenter_v1/proto/finding.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/securitycenter_v1/proto/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xa4\x05\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12<\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.State\x12\x10\n\x08\x63\x61tegory\x18\x05 \x01(\t\x12\x14\n\x0c\x65xternal_uri\x18\x06 \x01(\t\x12X\n\x11source_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Finding.SourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02:l\xea\x41i\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}B\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\n2google/cloud/securitycenter_v1/proto/finding.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/securitycenter_v1/proto/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa4\x05\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06parent\x18\x02 \x01(\t\x12\x15\n\rresource_name\x18\x03 \x01(\t\x12<\n\x05state\x18\x04 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.State\x12\x10\n\x08\x63\x61tegory\x18\x05 \x01(\t\x12\x14\n\x0c\x65xternal_uri\x18\x06 \x01(\t\x12X\n\x11source_properties\x18\x07 \x03(\x0b\x32=.google.cloud.securitycenter.v1.Finding.SourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x03\x12.\n\nevent_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x63reate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aO\n\x15SourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02:l\xea\x41i\n%securitycenter.googleapis.com/Finding\x12@organizations/{organization}/sources/{source}/findings/{finding}B\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_security__marks__pb2.DESCRIPTOR, google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, ], ) diff --git a/google/cloud/securitycenter_v1/proto/notification_config.proto b/google/cloud/securitycenter_v1/proto/notification_config.proto new file mode 100644 index 00000000..90bd83c3 --- /dev/null +++ b/google/cloud/securitycenter_v1/proto/notification_config.proto @@ -0,0 +1,96 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "NotificationConfigProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Cloud Security Command Center (Cloud SCC) notification configs. +// +// A notification config is a Cloud SCC resource that contains the configuration +// to send notifications for create/update events of findings, assets and etc. +message NotificationConfig { + option (google.api.resource) = { + type: "securitycenter.googleapis.com/NotificationConfig" + pattern: "organizations/{organization}/notificationConfigs/{notification_config}" + }; + + // The config for streaming-based notifications, which send each event as soon + // as it is detected. + message StreamingConfig { + // Expression that defines the filter to apply across create/update events + // of assets or findings as specified by the event type. The expression is a + // list of zero or more restrictions combined via logical operators `AND` + // and `OR`. Parentheses are supported, and `OR` has higher precedence than + // `AND`. + // + // Restrictions have the form ` ` and may have a + // `-` character in front of them to indicate negation. The fields map to + // those defined in the corresponding resource. + // + // The supported operators are: + // + // * `=` for all value types. + // * `>`, `<`, `>=`, `<=` for integer values. + // * `:`, meaning substring matching, for strings. + // + // The supported value types are: + // + // * string literals in quotes. + // * integer literals without quotes. + // * boolean literals `true` and `false` without quotes. + string filter = 1; + } + + // The relative resource name of this notification config. See: + // https://cloud.google.com/apis/design/resource_names#relative_resource_name + // Example: + // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + string name = 1; + + // The description of the notification config (max of 1024 characters). + string description = 2; + + // The PubSub topic to send notifications to. Its format is + // "projects/[project_id]/topics/[topic]". + string pubsub_topic = 3 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Output only. The service account that needs "pubsub.topics.publish" + // permission to publish to the PubSub topic. + string service_account = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The config for triggering notifications. + oneof notify_config { + // The config for triggering streaming-based notifications. + StreamingConfig streaming_config = 5; + } +} diff --git a/google/cloud/securitycenter_v1/proto/notification_config_pb2.py b/google/cloud/securitycenter_v1/proto/notification_config_pb2.py new file mode 100644 index 00000000..e998ccef --- /dev/null +++ b/google/cloud/securitycenter_v1/proto/notification_config_pb2.py @@ -0,0 +1,288 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter_v1/proto/notification_config.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/securitycenter_v1/proto/notification_config.proto", + package="google.cloud.securitycenter.v1", + syntax="proto3", + serialized_options=_b( + '\n"com.google.cloud.securitycenter.v1B\027NotificationConfigProtoP\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1\352A@\n\033pubsub.googleapis.com/Topic\022!projects/{project}/topics/{topic}' + ), + serialized_pb=_b( + '\n>google/cloud/securitycenter_v1/proto/notification_config.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto"\xa0\x03\n\x12NotificationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x36\n\x0cpubsub_topic\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1bpubsub.googleapis.com/Topic\x12\x1c\n\x0fservice_account\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12^\n\x10streaming_config\x18\x05 \x01(\x0b\x32\x42.google.cloud.securitycenter.v1.NotificationConfig.StreamingConfigH\x00\x1a!\n\x0fStreamingConfig\x12\x0e\n\x06\x66ilter\x18\x01 \x01(\t:}\xea\x41z\n0securitycenter.googleapis.com/NotificationConfig\x12\x46organizations/{organization}/notificationConfigs/{notification_config}B\x0f\n\rnotify_configB\xb6\x02\n"com.google.cloud.securitycenter.v1B\x17NotificationConfigProtoP\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}b\x06proto3' + ), + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, + ], +) + + +_NOTIFICATIONCONFIG_STREAMINGCONFIG = _descriptor.Descriptor( + name="StreamingConfig", + full_name="google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="filter", + full_name="google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig.filter", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=428, + serialized_end=461, +) + +_NOTIFICATIONCONFIG = _descriptor.Descriptor( + name="NotificationConfig", + full_name="google.cloud.securitycenter.v1.NotificationConfig", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.securitycenter.v1.NotificationConfig.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.securitycenter.v1.NotificationConfig.description", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="pubsub_topic", + full_name="google.cloud.securitycenter.v1.NotificationConfig.pubsub_topic", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\372A\035\n\033pubsub.googleapis.com/Topic"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="service_account", + full_name="google.cloud.securitycenter.v1.NotificationConfig.service_account", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\003"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="streaming_config", + full_name="google.cloud.securitycenter.v1.NotificationConfig.streaming_config", + index=4, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[_NOTIFICATIONCONFIG_STREAMINGCONFIG,], + enum_types=[], + serialized_options=_b( + "\352Az\n0securitycenter.googleapis.com/NotificationConfig\022Forganizations/{organization}/notificationConfigs/{notification_config}" + ), + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="notify_config", + full_name="google.cloud.securitycenter.v1.NotificationConfig.notify_config", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=189, + serialized_end=605, +) + +_NOTIFICATIONCONFIG_STREAMINGCONFIG.containing_type = _NOTIFICATIONCONFIG +_NOTIFICATIONCONFIG.fields_by_name[ + "streaming_config" +].message_type = _NOTIFICATIONCONFIG_STREAMINGCONFIG +_NOTIFICATIONCONFIG.oneofs_by_name["notify_config"].fields.append( + _NOTIFICATIONCONFIG.fields_by_name["streaming_config"] +) +_NOTIFICATIONCONFIG.fields_by_name[ + "streaming_config" +].containing_oneof = _NOTIFICATIONCONFIG.oneofs_by_name["notify_config"] +DESCRIPTOR.message_types_by_name["NotificationConfig"] = _NOTIFICATIONCONFIG +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +NotificationConfig = _reflection.GeneratedProtocolMessageType( + "NotificationConfig", + (_message.Message,), + dict( + StreamingConfig=_reflection.GeneratedProtocolMessageType( + "StreamingConfig", + (_message.Message,), + dict( + DESCRIPTOR=_NOTIFICATIONCONFIG_STREAMINGCONFIG, + __module__="google.cloud.securitycenter_v1.proto.notification_config_pb2", + __doc__="""The config for streaming-based notifications, which send + each event as soon as it is detected. + + + Attributes: + filter: + Expression that defines the filter to apply across + create/update events of assets or findings as specified by the + event type. The expression is a list of zero or more + restrictions combined via logical operators ``AND`` and + ``OR``. Parentheses are supported, and ``OR`` has higher + precedence than ``AND``. Restrictions have the form `` + `` and may have a ``-`` character in front + of them to indicate negation. The fields map to those defined + in the corresponding resource. The supported operators are: + - ``=`` for all value types. - ``>``, ``<``, ``>=``, ``<=`` + for integer values. - ``:``, meaning substring matching, for + strings. The supported value types are: - string literals + in quotes. - integer literals without quotes. - boolean + literals ``true`` and ``false`` without quotes. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.NotificationConfig.StreamingConfig) + ), + ), + DESCRIPTOR=_NOTIFICATIONCONFIG, + __module__="google.cloud.securitycenter_v1.proto.notification_config_pb2", + __doc__="""Cloud Security Command Center (Cloud SCC) notification + configs. + + A notification config is a Cloud SCC resource that contains the + configuration to send notifications for create/update events of + findings, assets and etc. + + + Attributes: + name: + The relative resource name of this notification config. See: h + ttps://cloud.google.com/apis/design/resource\_names#relative\_ + resource\_name Example: "organizations/{organization\_id}/noti + ficationConfigs/notify\_public\_bucket". + description: + The description of the notification config (max of 1024 + characters). + pubsub_topic: + The PubSub topic to send notifications to. Its format is + "projects/[project\_id]/topics/[topic]". + service_account: + Output only. The service account that needs + "pubsub.topics.publish" permission to publish to the PubSub + topic. + notify_config: + The config for triggering notifications. + streaming_config: + The config for triggering streaming-based notifications. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.NotificationConfig) + ), +) +_sym_db.RegisterMessage(NotificationConfig) +_sym_db.RegisterMessage(NotificationConfig.StreamingConfig) + + +DESCRIPTOR._options = None +_NOTIFICATIONCONFIG.fields_by_name["pubsub_topic"]._options = None +_NOTIFICATIONCONFIG.fields_by_name["service_account"]._options = None +_NOTIFICATIONCONFIG._options = None +# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/securitycenter_v1/proto/notification_config_pb2_grpc.py b/google/cloud/securitycenter_v1/proto/notification_config_pb2_grpc.py new file mode 100644 index 00000000..07cb78fe --- /dev/null +++ b/google/cloud/securitycenter_v1/proto/notification_config_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/google/cloud/securitycenter_v1/proto/notification_message.proto b/google/cloud/securitycenter_v1/proto/notification_message.proto new file mode 100644 index 00000000..b9dfb171 --- /dev/null +++ b/google/cloud/securitycenter_v1/proto/notification_message.proto @@ -0,0 +1,41 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.securitycenter.v1; + +import "google/api/annotations.proto"; +import "google/cloud/securitycenter/v1/finding.proto"; + +option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; +option java_multiple_files = true; +option java_outer_classname = "NotificationMessageProto"; +option java_package = "com.google.cloud.securitycenter.v1"; +option php_namespace = "Google\\Cloud\\SecurityCenter\\V1"; +option ruby_package = "Google::Cloud::SecurityCenter::V1"; + +// Cloud SCC's Notification +message NotificationMessage { + // Name of the notification config that generated current notification. + string notification_config_name = 1; + + // Notification Event. + oneof event { + // If it's a Finding based notification config, this field will be + // populated. + Finding finding = 2; + } +} diff --git a/google/cloud/securitycenter_v1/proto/notification_message_pb2.py b/google/cloud/securitycenter_v1/proto/notification_message_pb2.py new file mode 100644 index 00000000..78c36b25 --- /dev/null +++ b/google/cloud/securitycenter_v1/proto/notification_message_pb2.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/securitycenter_v1/proto/notification_message.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.cloud.securitycenter_v1.proto import ( + finding_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2, +) + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/securitycenter_v1/proto/notification_message.proto", + package="google.cloud.securitycenter.v1", + syntax="proto3", + serialized_options=_b( + '\n"com.google.cloud.securitycenter.v1B\030NotificationMessageProtoP\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' + ), + serialized_pb=_b( + '\n?google/cloud/securitycenter_v1/proto/notification_message.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/securitycenter_v1/proto/finding.proto"|\n\x13NotificationMessage\x12 \n\x18notification_config_name\x18\x01 \x01(\t\x12:\n\x07\x66inding\x18\x02 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingH\x00\x42\x07\n\x05\x65ventB\xf4\x01\n"com.google.cloud.securitycenter.v1B\x18NotificationMessageProtoP\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + ), + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2.DESCRIPTOR, + ], +) + + +_NOTIFICATIONMESSAGE = _descriptor.Descriptor( + name="NotificationMessage", + full_name="google.cloud.securitycenter.v1.NotificationMessage", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="notification_config_name", + full_name="google.cloud.securitycenter.v1.NotificationMessage.notification_config_name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="finding", + full_name="google.cloud.securitycenter.v1.NotificationMessage.finding", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="event", + full_name="google.cloud.securitycenter.v1.NotificationMessage.event", + index=0, + containing_type=None, + fields=[], + ), + ], + serialized_start=181, + serialized_end=305, +) + +_NOTIFICATIONMESSAGE.fields_by_name[ + "finding" +].message_type = ( + google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2._FINDING +) +_NOTIFICATIONMESSAGE.oneofs_by_name["event"].fields.append( + _NOTIFICATIONMESSAGE.fields_by_name["finding"] +) +_NOTIFICATIONMESSAGE.fields_by_name[ + "finding" +].containing_oneof = _NOTIFICATIONMESSAGE.oneofs_by_name["event"] +DESCRIPTOR.message_types_by_name["NotificationMessage"] = _NOTIFICATIONMESSAGE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +NotificationMessage = _reflection.GeneratedProtocolMessageType( + "NotificationMessage", + (_message.Message,), + dict( + DESCRIPTOR=_NOTIFICATIONMESSAGE, + __module__="google.cloud.securitycenter_v1.proto.notification_message_pb2", + __doc__="""Cloud SCC's Notification + + + Attributes: + notification_config_name: + Name of the notification config that generated current + notification. + event: + Notification Event. + finding: + If it's a Finding based notification config, this field will + be populated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.NotificationMessage) + ), +) +_sym_db.RegisterMessage(NotificationMessage) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/securitycenter_v1/proto/notification_message_pb2_grpc.py b/google/cloud/securitycenter_v1/proto/notification_message_pb2_grpc.py new file mode 100644 index 00000000..07cb78fe --- /dev/null +++ b/google/cloud/securitycenter_v1/proto/notification_message_pb2_grpc.py @@ -0,0 +1,2 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc diff --git a/google/cloud/securitycenter_v1/proto/organization_settings.proto b/google/cloud/securitycenter_v1/proto/organization_settings.proto index aa4e80bd..d9d9aed7 100644 --- a/google/cloud/securitycenter_v1/proto/organization_settings.proto +++ b/google/cloud/securitycenter_v1/proto/organization_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,14 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/resource.proto"; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/google/cloud/securitycenter_v1/proto/organization_settings_pb2.py b/google/cloud/securitycenter_v1/proto/organization_settings_pb2.py index ec6f0775..303488ee 100644 --- a/google/cloud/securitycenter_v1/proto/organization_settings_pb2.py +++ b/google/cloud/securitycenter_v1/proto/organization_settings_pb2.py @@ -15,8 +15,8 @@ _sym_db = _symbol_database.Default() -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -27,11 +27,11 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\n@google/cloud/securitycenter_v1/proto/organization_settings.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto"\x8a\x04\n\x14OrganizationSettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65nable_asset_discovery\x18\x02 \x01(\x08\x12i\n\x16\x61sset_discovery_config\x18\x03 \x01(\x0b\x32I.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig\x1a\xec\x01\n\x14\x41ssetDiscoveryConfig\x12\x13\n\x0bproject_ids\x18\x01 \x03(\t\x12o\n\x0einclusion_mode\x18\x02 \x01(\x0e\x32W.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode"N\n\rInclusionMode\x12\x1e\n\x1aINCLUSION_MODE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINCLUDE_ONLY\x10\x01\x12\x0b\n\x07\x45XCLUDE\x10\x02:j\xea\x41g\n2securitycenter.googleapis.com/OrganizationSettings\x12\x31organizations/{organization}/organizationSettingsB\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\n@google/cloud/securitycenter_v1/proto/organization_settings.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto"\x8a\x04\n\x14OrganizationSettings\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x16\x65nable_asset_discovery\x18\x02 \x01(\x08\x12i\n\x16\x61sset_discovery_config\x18\x03 \x01(\x0b\x32I.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig\x1a\xec\x01\n\x14\x41ssetDiscoveryConfig\x12\x13\n\x0bproject_ids\x18\x01 \x03(\t\x12o\n\x0einclusion_mode\x18\x02 \x01(\x0e\x32W.google.cloud.securitycenter.v1.OrganizationSettings.AssetDiscoveryConfig.InclusionMode"N\n\rInclusionMode\x12\x1e\n\x1aINCLUSION_MODE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINCLUDE_ONLY\x10\x01\x12\x0b\n\x07\x45XCLUDE\x10\x02:j\xea\x41g\n2securitycenter.googleapis.com/OrganizationSettings\x12\x31organizations/{organization}/organizationSettingsB\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, ], ) @@ -233,8 +233,8 @@ ), DESCRIPTOR=_ORGANIZATIONSETTINGS, __module__="google.cloud.securitycenter_v1.proto.organization_settings_pb2", - __doc__="""User specified settings that are attached to the Cloud Security Command - Center (Cloud SCC) organization. + __doc__="""User specified settings that are attached to the Cloud + Security Command Center (Cloud SCC) organization. Attributes: diff --git a/google/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto b/google/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto index e7581078..4f09d9c0 100644 --- a/google/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto +++ b/google/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,14 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/protobuf/duration.proto"; import "google/api/annotations.proto"; +import "google/protobuf/duration.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/google/cloud/securitycenter_v1/proto/run_asset_discovery_response_pb2.py b/google/cloud/securitycenter_v1/proto/run_asset_discovery_response_pb2.py index cf641579..17a13265 100644 --- a/google/cloud/securitycenter_v1/proto/run_asset_discovery_response_pb2.py +++ b/google/cloud/securitycenter_v1/proto/run_asset_discovery_response_pb2.py @@ -15,8 +15,8 @@ _sym_db = _symbol_database.Default() -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -27,11 +27,11 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\nGgoogle/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/api/annotations.proto"\xe7\x01\n\x19RunAssetDiscoveryResponse\x12N\n\x05state\x18\x01 \x01(\x0e\x32?.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"M\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tCOMPLETED\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02\x12\x0e\n\nTERMINATED\x10\x03\x42\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\nGgoogle/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1egoogle/protobuf/duration.proto"\xe7\x01\n\x19RunAssetDiscoveryResponse\x12N\n\x05state\x18\x01 \x01(\x0e\x32?.google.cloud.securitycenter.v1.RunAssetDiscoveryResponse.State\x12+\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"M\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tCOMPLETED\x10\x01\x12\x0e\n\nSUPERSEDED\x10\x02\x12\x0e\n\nTERMINATED\x10\x03\x42\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, ], ) diff --git a/google/cloud/securitycenter_v1/proto/security_marks.proto b/google/cloud/securitycenter_v1/proto/security_marks.proto index d2b53487..229aff32 100644 --- a/google/cloud/securitycenter_v1/proto/security_marks.proto +++ b/google/cloud/securitycenter_v1/proto/security_marks.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,14 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/resource.proto"; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/google/cloud/securitycenter_v1/proto/security_marks_pb2.py b/google/cloud/securitycenter_v1/proto/security_marks_pb2.py index dbb16c7f..96f4b8e3 100644 --- a/google/cloud/securitycenter_v1/proto/security_marks_pb2.py +++ b/google/cloud/securitycenter_v1/proto/security_marks_pb2.py @@ -15,8 +15,8 @@ _sym_db = _symbol_database.Default() -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -27,11 +27,11 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\n9google/cloud/securitycenter_v1/proto/security_marks.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto"\xd3\x02\n\rSecurityMarks\x12\x0c\n\x04name\x18\x01 \x01(\t\x12G\n\x05marks\x18\x02 \x03(\x0b\x32\x38.google.cloud.securitycenter.v1.SecurityMarks.MarksEntry\x1a,\n\nMarksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xbc\x01\xea\x41\xb8\x01\n+securitycenter.googleapis.com/SecurityMarks\x12\x39organizations/{organization}/assets/{asset}/securityMarks\x12Norganizations/{organization}/sources/{source}/findings/{finding}/securityMarksB\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\n9google/cloud/securitycenter_v1/proto/security_marks.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto"\xd3\x02\n\rSecurityMarks\x12\x0c\n\x04name\x18\x01 \x01(\t\x12G\n\x05marks\x18\x02 \x03(\x0b\x32\x38.google.cloud.securitycenter.v1.SecurityMarks.MarksEntry\x1a,\n\nMarksEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xbc\x01\xea\x41\xb8\x01\n+securitycenter.googleapis.com/SecurityMarks\x12\x39organizations/{organization}/assets/{asset}/securityMarks\x12Norganizations/{organization}/sources/{source}/findings/{finding}/securityMarksB\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, ], ) diff --git a/google/cloud/securitycenter_v1/proto/securitycenter_service.proto b/google/cloud/securitycenter_v1/proto/securitycenter_service.proto index df3e53dc..bb9a8284 100644 --- a/google/cloud/securitycenter_v1/proto/securitycenter_service.proto +++ b/google/cloud/securitycenter_v1/proto/securitycenter_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,19 +11,20 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; import public "google/cloud/securitycenter/v1/run_asset_discovery_response.proto"; + import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/securitycenter/v1/asset.proto"; import "google/cloud/securitycenter/v1/finding.proto"; +import "google/cloud/securitycenter/v1/notification_config.proto"; import "google/cloud/securitycenter/v1/organization_settings.proto"; import "google/cloud/securitycenter/v1/security_marks.proto"; import "google/cloud/securitycenter/v1/source.proto"; @@ -46,7 +47,8 @@ option ruby_package = "Google::Cloud::SecurityCenter::V1"; // V1 APIs for Security Center service. service SecurityCenter { option (google.api.default_host) = "securitycenter.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Creates a source. rpc CreateSource(CreateSourceRequest) returns (Source) { @@ -67,8 +69,30 @@ service SecurityCenter { option (google.api.method_signature) = "parent,finding_id,finding"; } + // Creates a notification config. + rpc CreateNotificationConfig(CreateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/notificationConfigs" + body: "notification_config" + }; + option (google.api.method_signature) = + "parent,config_id,notification_config"; + option (google.api.method_signature) = "parent,notification_config"; + } + + // Deletes a notification config. + rpc DeleteNotificationConfig(DeleteNotificationConfigRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + // Gets the access control policy on the specified Source. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:getIamPolicy" body: "*" @@ -76,8 +100,18 @@ service SecurityCenter { option (google.api.method_signature) = "resource"; } + // Gets a notification config. + rpc GetNotificationConfig(GetNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/notificationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + // Gets the settings for an organization. - rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc GetOrganizationSettings(GetOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { get: "/v1/{name=organizations/*/organizationSettings}" }; @@ -131,6 +165,15 @@ service SecurityCenter { }; } + // Lists notification configs. + rpc ListNotificationConfigs(ListNotificationConfigsRequest) + returns (ListNotificationConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/notificationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + // Lists all sources belonging to an organization. rpc ListSources(ListSourcesRequest) returns (ListSourcesResponse) { option (google.api.http) = { @@ -145,7 +188,8 @@ service SecurityCenter { // This API can only be called with limited frequency for an organization. If // it is called too frequently the caller will receive a TOO_MANY_REQUESTS // error. - rpc RunAssetDiscovery(RunAssetDiscoveryRequest) returns (google.longrunning.Operation) { + rpc RunAssetDiscovery(RunAssetDiscoveryRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=organizations/*}/assets:runDiscovery" body: "*" @@ -167,7 +211,8 @@ service SecurityCenter { } // Sets the access control policy on the specified Source. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:setIamPolicy" body: "*" @@ -176,7 +221,8 @@ service SecurityCenter { } // Returns the permissions that a caller has on the specified source. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v1/{resource=organizations/*/sources/*}:testIamPermissions" body: "*" @@ -194,8 +240,21 @@ service SecurityCenter { option (google.api.method_signature) = "finding"; } + // + // Updates a notification config. + rpc UpdateNotificationConfig(UpdateNotificationConfigRequest) + returns (NotificationConfig) { + option (google.api.http) = { + patch: "/v1/{notification_config.name=organizations/*/notificationConfigs/*}" + body: "notification_config" + }; + option (google.api.method_signature) = "notification_config"; + option (google.api.method_signature) = "notification_config,update_mask"; + } + // Updates an organization's settings. - rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (OrganizationSettings) { + rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) + returns (OrganizationSettings) { option (google.api.http) = { patch: "/v1/{organization_settings.name=organizations/*/organizationSettings}" body: "organization_settings" @@ -242,11 +301,35 @@ message CreateFindingRequest { // greater than 0 characters in length. string finding_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The Finding being created. The name and security_marks will be ignored as - // they are both output only fields on this resource. + // Required. The Finding being created. The name and security_marks will be + // ignored as they are both output only fields on this resource. Finding finding = 3 [(google.api.field_behavior) = REQUIRED]; } +// Request message for creating a notification config. +message CreateNotificationConfigRequest { + // Required. Resource name of the new notification config's parent. Its format + // is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. + // Unique identifier provided by the client within the parent scope. + // It must be between 1 and 128 characters, and contains alphanumeric + // characters, underscores or hyphens only. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The notification config being created. The name and the service + // account will be ignored as they are both output only fields on this + // resource. + NotificationConfig notification_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + // Request message for creating a source. message CreateSourceRequest { // Required. Resource name of the new source's parent. Its format should be @@ -258,15 +341,39 @@ message CreateSourceRequest { } ]; - // Required. The Source being created, only the display_name and description will be - // used. All other fields will be ignored. + // Required. The Source being created, only the display_name and description + // will be used. All other fields will be ignored. Source source = 2 [(google.api.field_behavior) = REQUIRED]; } +// Request message for deleting a notification config. +message DeleteNotificationConfigRequest { + // Required. Name of the notification config to delete. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + +// Request message for getting a notification config. +message GetNotificationConfigRequest { + // Required. Name of the notification config to get. Its format is + // "organizations/[organization_id]/notificationConfigs/[config_id]". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "securitycenter.googleapis.com/NotificationConfig" + } + ]; +} + // Request message for getting organization settings. message GetOrganizationSettingsRequest { - // Required. Name of the organization to get organization settings for. Its format is - // "organizations/[organization_id]/organizationSettings". + // Required. Name of the organization to get organization settings for. Its + // format is "organizations/[organization_id]/organizationSettings". string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -356,9 +463,9 @@ message GroupAssetsRequest { // For example, `resource_properties.size = 100` is a valid filter string. string filter = 2; - // Required. Expression that defines what assets fields to use for grouping. The string - // value should follow SQL syntax: comma separated list of fields. For - // example: + // Required. Expression that defines what assets fields to use for grouping. + // The string value should follow SQL syntax: comma separated list of fields. + // For example: // "security_center_properties.resource_project,security_center_properties.project". // // The following fields are supported when compare_duration is not set: @@ -497,9 +604,9 @@ message GroupFindingsRequest { // For example, `source_properties.size = 100` is a valid filter string. string filter = 2; - // Required. Expression that defines what assets fields to use for grouping (including - // `state_change`). The string value should follow SQL syntax: comma separated - // list of fields. For example: "parent,resource_name". + // Required. Expression that defines what assets fields to use for grouping + // (including `state_change`). The string value should follow SQL syntax: + // comma separated list of fields. For example: "parent,resource_name". // // The following fields are supported: // @@ -532,12 +639,18 @@ message GroupFindingsRequest { // // Possible "state_change" values when compare_duration is specified: // - // * "CHANGED": indicates that the finding was present at the start of - // compare_duration, but changed its state at read_time. - // * "UNCHANGED": indicates that the finding was present at the start of - // compare_duration and did not change state at read_time. - // * "ADDED": indicates that the finding was not present at the start - // of compare_duration, but was present at read_time. + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. // // If compare_duration is not specified, then the only possible state_change // is "UNUSED", which will be the state_change set for all findings present @@ -584,10 +697,41 @@ message GroupResult { int64 count = 2; } +// Request message for listing notification configs. +message ListNotificationConfigsRequest { + // Required. Name of the organization to list notification configs. + // Its format is "organizations/[organization_id]". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // The value returned by the last `ListNotificationConfigsResponse`; indicates + // that this is a continuation of a prior `ListNotificationConfigs` call, and + // that the system should return the next page of data. + string page_token = 2; + + // The maximum number of results to return in a single response. Default is + // 10, minimum is 1, maximum is 1000. + int32 page_size = 3; +} + +// Response message for listing notification configs. +message ListNotificationConfigsResponse { + // Notification configs belonging to the requested parent. + repeated NotificationConfig notification_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results. + string next_page_token = 2; +} + // Request message for listing sources. message ListSourcesRequest { - // Required. Resource name of the parent of sources to list. Its format should be - // "organizations/[organization_id]". + // Required. Resource name of the parent of sources to list. Its format should + // be "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -739,10 +883,10 @@ message ListAssetsRequest { // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. A field mask to specify the ListAssetsResult fields to be listed in the - // response. - // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A field mask to specify the ListAssetsResult fields to be listed + // in the response. An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListAssetsResponse`; indicates // that this is a continuation of a prior `ListAssets` call, and @@ -897,21 +1041,28 @@ message ListFindingsRequest { // // Possible "state_change" values when compare_duration is specified: // - // * "CHANGED": indicates that the finding was present at the start of - // compare_duration, but changed its state at read_time. - // * "UNCHANGED": indicates that the finding was present at the start of - // compare_duration and did not change state at read_time. - // * "ADDED": indicates that the finding was not present at the start - // of compare_duration, but was present at read_time. + // * "CHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration, but changed its + // state at read_time. + // * "UNCHANGED": indicates that the finding was present and matched the given + // filter at the start of compare_duration and did not change + // state at read_time. + // * "ADDED": indicates that the finding did not match the given filter or + // was not present at the start of compare_duration, but was + // present at read_time. + // * "REMOVED": indicates that the finding was present and matched the + // filter at the start of compare_duration, but did not match + // the filter at read_time. // // If compare_duration is not specified, then the only possible state_change // is "UNUSED", which will be the state_change set for all findings present at // read_time. google.protobuf.Duration compare_duration = 5; - // Optional. A field mask to specify the Finding fields to be listed in the response. - // An empty field mask will list all fields. - google.protobuf.FieldMask field_mask = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. A field mask to specify the Finding fields to be listed in the + // response. An empty field mask will list all fields. + google.protobuf.FieldMask field_mask = 7 + [(google.api.field_behavior) = OPTIONAL]; // The value returned by the last `ListFindingsResponse`; indicates // that this is a continuation of a prior `ListFindings` call, and @@ -1016,13 +1167,14 @@ message SetFindingStateRequest { Finding.State state = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The time at which the updated state takes effect. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.Timestamp start_time = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for running asset discovery for an organization. message RunAssetDiscoveryRequest { - // Required. Name of the organization to run asset discovery for. Its format is - // "organizations/[organization_id]". + // Required. Name of the organization to run asset discovery for. Its format + // is "organizations/[organization_id]". string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1033,8 +1185,8 @@ message RunAssetDiscoveryRequest { // Request message for updating or creating a finding. message UpdateFindingRequest { - // Required. The finding resource to update or create if it does not already exist. - // parent, security_marks, and update_time will be ignored. + // Required. The finding resource to update or create if it does not already + // exist. parent, security_marks, and update_time will be ignored. // // In the case of creation, the finding id portion of the name must be // alphanumeric and less than or equal to 32 characters and greater than 0 @@ -1051,10 +1203,23 @@ message UpdateFindingRequest { google.protobuf.FieldMask update_mask = 2; } +// Request message for updating a notification config. +message UpdateNotificationConfigRequest { + // Required. The notification config to update. + NotificationConfig notification_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // The FieldMask to use when updating the notification config. + // + // If empty all mutable fields will be updated. + google.protobuf.FieldMask update_mask = 2; +} + // Request message for updating an organization's settings. message UpdateOrganizationSettingsRequest { // Required. The organization settings resource to update. - OrganizationSettings organization_settings = 1 [(google.api.field_behavior) = REQUIRED]; + OrganizationSettings organization_settings = 1 + [(google.api.field_behavior) = REQUIRED]; // The FieldMask to use when updating the settings resource. // diff --git a/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2.py b/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2.py index 334a32fa..6d060018 100644 --- a/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2.py +++ b/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2.py @@ -28,6 +28,9 @@ from google.cloud.securitycenter_v1.proto import ( finding_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2, ) +from google.cloud.securitycenter_v1.proto import ( + notification_config_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2, +) from google.cloud.securitycenter_v1.proto import ( organization_settings_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_organization__settings__pb2, ) @@ -57,7 +60,7 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\nAgoogle/cloud/securitycenter_v1/proto/securitycenter_service.proto\x12\x1egoogle.cloud.securitycenter.v1\x1aGgoogle/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/securitycenter_v1/proto/asset.proto\x1a\x32google/cloud/securitycenter_v1/proto/finding.proto\x1a@google/cloud/securitycenter_v1/proto/organization_settings.proto\x1a\x39google/cloud/securitycenter_v1/proto/security_marks.proto\x1a\x31google/cloud/securitycenter_v1/proto/source.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xac\x01\n\x14\x43reateFindingRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x17\n\nfinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x07\x66inding\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingB\x03\xe0\x41\x02"\x9c\x01\n\x13\x43reateSourceRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12;\n\x06source\x18\x02 \x01(\x0b\x32&.google.cloud.securitycenter.v1.SourceB\x03\xe0\x41\x02"j\n\x1eGetOrganizationSettingsRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2securitycenter.googleapis.com/OrganizationSettings"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source"\x90\x02\n\x12GroupAssetsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x10\x63ompare_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05"\xb8\x01\n\x13GroupAssetsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05"\x86\x02\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05"\xba\x01\n\x15GroupFindingsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05"\xb8\x01\n\x0bGroupResult\x12O\n\nproperties\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v1.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01"\x85\x01\n\x12ListSourcesRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05"g\n\x13ListSourcesResponse\x12\x37\n\x07sources\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v1.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xbf\x02\n\x11ListAssetsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05"\xc3\x03\n\x12ListAssetsResponse\x12`\n\x13list_assets_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xee\x01\n\x10ListAssetsResult\x12\x34\n\x05\x61sset\x18\x01 \x01(\x0b\x32%.google.cloud.securitycenter.v1.Asset\x12\x65\n\x0cstate_change\x18\x02 \x01(\x0e\x32O.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange"=\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0b\n\x07REMOVED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03"\xb5\x02\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05"\xc9\x05\n\x14ListFindingsResponse\x12\x66\n\x15list_findings_results\x18\x01 \x03(\x0b\x32G.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xec\x03\n\x12ListFindingsResult\x12\x38\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Finding\x12i\n\x0cstate_change\x18\x02 \x01(\x0e\x32S.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange\x12\x62\n\x08resource\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource\x1a~\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cproject_name\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x13\n\x0bparent_name\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t"M\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\x0b\n\x07\x43HANGED\x10\x01\x12\r\n\tUNCHANGED\x10\x02\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x03\x12\x0b\n\x07REMOVED\x10\x04"\xcd\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.StateB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02"d\n\x18RunAssetDiscoveryRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization"\x86\x01\n\x14UpdateFindingRequest\x12=\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xae\x01\n!UpdateOrganizationSettingsRequest\x12X\n\x15organization_settings\x18\x01 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1.OrganizationSettingsB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\x83\x01\n\x13UpdateSourceRequest\x12;\n\x06source\x18\x01 \x01(\x0b\x32&.google.cloud.securitycenter.v1.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xc9\x01\n\x1aUpdateSecurityMarksRequest\x12J\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\x9e\x1d\n\x0eSecurityCenter\x12\xb1\x01\n\x0c\x43reateSource\x12\x33.google.cloud.securitycenter.v1.CreateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source"D\x82\xd3\xe4\x93\x02."$/v1/{parent=organizations/*}/sources:\x06source\xda\x41\rparent,source\x12\xcc\x01\n\rCreateFinding\x12\x34.google.cloud.securitycenter.v1.CreateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding"\\\x82\xd3\xe4\x93\x02:"//v1/{parent=organizations/*/sources/*}/findings:\x07\x66inding\xda\x41\x19parent,finding_id,finding\x12\x96\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"K\x82\xd3\xe4\x93\x02:"5/v1/{resource=organizations/*/sources/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xcf\x01\n\x17GetOrganizationSettings\x12>.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings">\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=organizations/*/organizationSettings}\xda\x41\x04name\x12\x9a\x01\n\tGetSource\x12\x30.google.cloud.securitycenter.v1.GetSourceRequest\x1a&.google.cloud.securitycenter.v1.Source"3\x82\xd3\xe4\x93\x02&\x12$/v1/{name=organizations/*/sources/*}\xda\x41\x04name\x12\xac\x01\n\x0bGroupAssets\x12\x32.google.cloud.securitycenter.v1.GroupAssetsRequest\x1a\x33.google.cloud.securitycenter.v1.GroupAssetsResponse"4\x82\xd3\xe4\x93\x02.")/v1/{parent=organizations/*}/assets:group:\x01*\x12\xd0\x01\n\rGroupFindings\x12\x34.google.cloud.securitycenter.v1.GroupFindingsRequest\x1a\x35.google.cloud.securitycenter.v1.GroupFindingsResponse"R\x82\xd3\xe4\x93\x02:"5/v1/{parent=organizations/*/sources/*}/findings:group:\x01*\xda\x41\x0fparent,group_by\x12\xa0\x01\n\nListAssets\x12\x31.google.cloud.securitycenter.v1.ListAssetsRequest\x1a\x32.google.cloud.securitycenter.v1.ListAssetsResponse"+\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=organizations/*}/assets\x12\xb2\x01\n\x0cListFindings\x12\x33.google.cloud.securitycenter.v1.ListFindingsRequest\x1a\x34.google.cloud.securitycenter.v1.ListFindingsResponse"7\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=organizations/*/sources/*}/findings\x12\xad\x01\n\x0bListSources\x12\x32.google.cloud.securitycenter.v1.ListSourcesRequest\x1a\x33.google.cloud.securitycenter.v1.ListSourcesResponse"5\x82\xd3\xe4\x93\x02&\x12$/v1/{parent=organizations/*}/sources\xda\x41\x06parent\x12\x87\x02\n\x11RunAssetDiscovery\x12\x38.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest\x1a\x1d.google.longrunning.Operation"\x98\x01\x82\xd3\xe4\x93\x02\x35"0/v1/{parent=organizations/*}/assets:runDiscovery:\x01*\xda\x41\x06parent\xca\x41Q\n8google.cloud.securitycenter.v1.RunAssetDiscoveryResponse\x12\x15google.protobuf.Empty\x12\xcf\x01\n\x0fSetFindingState\x12\x36.google.cloud.securitycenter.v1.SetFindingStateRequest\x1a\'.google.cloud.securitycenter.v1.Finding"[\x82\xd3\xe4\x93\x02="8/v1/{name=organizations/*/sources/*/findings/*}:setState:\x01*\xda\x41\x15name,state,start_time\x12\x9d\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"R\x82\xd3\xe4\x93\x02:"5/v1/{resource=organizations/*/sources/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xc8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"]\x82\xd3\xe4\x93\x02@";/v1/{resource=organizations/*/sources/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xc2\x01\n\rUpdateFinding\x12\x34.google.cloud.securitycenter.v1.UpdateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding"R\x82\xd3\xe4\x93\x02\x42\x32\x37/v1/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66inding\xda\x41\x07\x66inding\x12\x93\x02\n\x1aUpdateOrganizationSettings\x12\x41.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings"|\x82\xd3\xe4\x93\x02^2E/v1/{organization_settings.name=organizations/*/organizationSettings}:\x15organization_settings\xda\x41\x15organization_settings\x12\xb1\x01\n\x0cUpdateSource\x12\x33.google.cloud.securitycenter.v1.UpdateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source"D\x82\xd3\xe4\x93\x02\x35\x32+/v1/{source.name=organizations/*/sources/*}:\x06source\xda\x41\x06source\x12\xcd\x02\n\x13UpdateSecurityMarks\x12:.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest\x1a-.google.cloud.securitycenter.v1.SecurityMarks"\xca\x01\x82\xd3\xe4\x93\x02\xb2\x01\x32@/v1/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZ^2L/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marks\xda\x41\x0esecurity_marks\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\nAgoogle/cloud/securitycenter_v1/proto/securitycenter_service.proto\x12\x1egoogle.cloud.securitycenter.v1\x1aGgoogle/cloud/securitycenter_v1/proto/run_asset_discovery_response.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x30google/cloud/securitycenter_v1/proto/asset.proto\x1a\x32google/cloud/securitycenter_v1/proto/finding.proto\x1a>google/cloud/securitycenter_v1/proto/notification_config.proto\x1a@google/cloud/securitycenter_v1/proto/organization_settings.proto\x1a\x39google/cloud/securitycenter_v1/proto/security_marks.proto\x1a\x31google/cloud/securitycenter_v1/proto/source.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xac\x01\n\x14\x43reateFindingRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x17\n\nfinding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x07\x66inding\x18\x03 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingB\x03\xe0\x41\x02"\xd9\x01\n\x1f\x43reateNotificationConfigRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x16\n\tconfig_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x13notification_config\x18\x03 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfigB\x03\xe0\x41\x02"\x9c\x01\n\x13\x43reateSourceRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12;\n\x06source\x18\x02 \x01(\x0b\x32&.google.cloud.securitycenter.v1.SourceB\x03\xe0\x41\x02"i\n\x1f\x44\x65leteNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig"f\n\x1cGetNotificationConfigRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0securitycenter.googleapis.com/NotificationConfig"j\n\x1eGetOrganizationSettingsRequest\x12H\n\x04name\x18\x01 \x01(\tB:\xe0\x41\x02\xfa\x41\x34\n2securitycenter.googleapis.com/OrganizationSettings"N\n\x10GetSourceRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source"\x90\x02\n\x12GroupAssetsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x10\x63ompare_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\tread_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05"\xb8\x01\n\x13GroupAssetsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05"\x86\x02\n\x14GroupFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x15\n\x08group_by\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\npage_token\x18\x07 \x01(\t\x12\x11\n\tpage_size\x18\x08 \x01(\x05"\xba\x01\n\x15GroupFindingsResponse\x12\x45\n\x10group_by_results\x18\x01 \x03(\x0b\x32+.google.cloud.securitycenter.v1.GroupResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05"\xb8\x01\n\x0bGroupResult\x12O\n\nproperties\x18\x01 \x03(\x0b\x32;.google.cloud.securitycenter.v1.GroupResult.PropertiesEntry\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x1aI\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01"\x91\x01\n\x1eListNotificationConfigsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05"\x8c\x01\n\x1fListNotificationConfigsResponse\x12P\n\x14notification_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x85\x01\n\x12ListSourcesRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x07 \x01(\x05"g\n\x13ListSourcesResponse\x12\x37\n\x07sources\x18\x01 \x03(\x0b\x32&.google.cloud.securitycenter.v1.Source\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\xbf\x02\n\x11ListAssetsRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05"\xc3\x03\n\x12ListAssetsResponse\x12`\n\x13list_assets_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xee\x01\n\x10ListAssetsResult\x12\x34\n\x05\x61sset\x18\x01 \x01(\x0b\x32%.google.cloud.securitycenter.v1.Asset\x12\x65\n\x0cstate_change\x18\x02 \x01(\x0e\x32O.google.cloud.securitycenter.v1.ListAssetsResponse.ListAssetsResult.StateChange"=\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x01\x12\x0b\n\x07REMOVED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03"\xb5\x02\n\x13ListFindingsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$securitycenter.googleapis.com/Source\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x10\n\x08order_by\x18\x03 \x01(\t\x12-\n\tread_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x10\x63ompare_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x33\n\nfield_mask\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x08 \x01(\t\x12\x11\n\tpage_size\x18\t \x01(\x05"\xc9\x05\n\x14ListFindingsResponse\x12\x66\n\x15list_findings_results\x18\x01 \x03(\x0b\x32G.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult\x12-\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12\x12\n\ntotal_size\x18\x04 \x01(\x05\x1a\xec\x03\n\x12ListFindingsResult\x12\x38\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.Finding\x12i\n\x0cstate_change\x18\x02 \x01(\x0e\x32S.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.StateChange\x12\x62\n\x08resource\x18\x03 \x01(\x0b\x32P.google.cloud.securitycenter.v1.ListFindingsResponse.ListFindingsResult.Resource\x1a~\n\x08Resource\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cproject_name\x18\x02 \x01(\t\x12\x1c\n\x14project_display_name\x18\x03 \x01(\t\x12\x13\n\x0bparent_name\x18\x04 \x01(\t\x12\x1b\n\x13parent_display_name\x18\x05 \x01(\t"M\n\x0bStateChange\x12\n\n\x06UNUSED\x10\x00\x12\x0b\n\x07\x43HANGED\x10\x01\x12\r\n\tUNCHANGED\x10\x02\x12\t\n\x05\x41\x44\x44\x45\x44\x10\x03\x12\x0b\n\x07REMOVED\x10\x04"\xcd\x01\n\x16SetFindingStateRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%securitycenter.googleapis.com/Finding\x12\x41\n\x05state\x18\x02 \x01(\x0e\x32-.google.cloud.securitycenter.v1.Finding.StateB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02"d\n\x18RunAssetDiscoveryRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0cloudresourcemanager.googleapis.com/Organization"\x86\x01\n\x14UpdateFindingRequest\x12=\n\x07\x66inding\x18\x01 \x01(\x0b\x32\'.google.cloud.securitycenter.v1.FindingB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xa8\x01\n\x1fUpdateNotificationConfigRequest\x12T\n\x13notification_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1.NotificationConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xae\x01\n!UpdateOrganizationSettingsRequest\x12X\n\x15organization_settings\x18\x01 \x01(\x0b\x32\x34.google.cloud.securitycenter.v1.OrganizationSettingsB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\x83\x01\n\x13UpdateSourceRequest\x12;\n\x06source\x18\x01 \x01(\x0b\x32&.google.cloud.securitycenter.v1.SourceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xc9\x01\n\x1aUpdateSecurityMarksRequest\x12J\n\x0esecurity_marks\x18\x01 \x01(\x0b\x32-.google.cloud.securitycenter.v1.SecurityMarksB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xd6&\n\x0eSecurityCenter\x12\xb1\x01\n\x0c\x43reateSource\x12\x33.google.cloud.securitycenter.v1.CreateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source"D\x82\xd3\xe4\x93\x02."$/v1/{parent=organizations/*}/sources:\x06source\xda\x41\rparent,source\x12\xcc\x01\n\rCreateFinding\x12\x34.google.cloud.securitycenter.v1.CreateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding"\\\x82\xd3\xe4\x93\x02:"//v1/{parent=organizations/*/sources/*}/findings:\x07\x66inding\xda\x41\x19parent,finding_id,finding\x12\xa3\x02\n\x18\x43reateNotificationConfig\x12?.google.cloud.securitycenter.v1.CreateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig"\x91\x01\x82\xd3\xe4\x93\x02G"0/v1/{parent=organizations/*}/notificationConfigs:\x13notification_config\xda\x41$parent,config_id,notification_config\xda\x41\x1aparent,notification_config\x12\xb4\x01\n\x18\x44\x65leteNotificationConfig\x12?.google.cloud.securitycenter.v1.DeleteNotificationConfigRequest\x1a\x16.google.protobuf.Empty"?\x82\xd3\xe4\x93\x02\x32*0/v1/{name=organizations/*/notificationConfigs/*}\xda\x41\x04name\x12\x96\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"K\x82\xd3\xe4\x93\x02:"5/v1/{resource=organizations/*/sources/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xca\x01\n\x15GetNotificationConfig\x12<.google.cloud.securitycenter.v1.GetNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig"?\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=organizations/*/notificationConfigs/*}\xda\x41\x04name\x12\xcf\x01\n\x17GetOrganizationSettings\x12>.google.cloud.securitycenter.v1.GetOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings">\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=organizations/*/organizationSettings}\xda\x41\x04name\x12\x9a\x01\n\tGetSource\x12\x30.google.cloud.securitycenter.v1.GetSourceRequest\x1a&.google.cloud.securitycenter.v1.Source"3\x82\xd3\xe4\x93\x02&\x12$/v1/{name=organizations/*/sources/*}\xda\x41\x04name\x12\xac\x01\n\x0bGroupAssets\x12\x32.google.cloud.securitycenter.v1.GroupAssetsRequest\x1a\x33.google.cloud.securitycenter.v1.GroupAssetsResponse"4\x82\xd3\xe4\x93\x02.")/v1/{parent=organizations/*}/assets:group:\x01*\x12\xd0\x01\n\rGroupFindings\x12\x34.google.cloud.securitycenter.v1.GroupFindingsRequest\x1a\x35.google.cloud.securitycenter.v1.GroupFindingsResponse"R\x82\xd3\xe4\x93\x02:"5/v1/{parent=organizations/*/sources/*}/findings:group:\x01*\xda\x41\x0fparent,group_by\x12\xa0\x01\n\nListAssets\x12\x31.google.cloud.securitycenter.v1.ListAssetsRequest\x1a\x32.google.cloud.securitycenter.v1.ListAssetsResponse"+\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=organizations/*}/assets\x12\xb2\x01\n\x0cListFindings\x12\x33.google.cloud.securitycenter.v1.ListFindingsRequest\x1a\x34.google.cloud.securitycenter.v1.ListFindingsResponse"7\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=organizations/*/sources/*}/findings\x12\xdd\x01\n\x17ListNotificationConfigs\x12>.google.cloud.securitycenter.v1.ListNotificationConfigsRequest\x1a?.google.cloud.securitycenter.v1.ListNotificationConfigsResponse"A\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=organizations/*}/notificationConfigs\xda\x41\x06parent\x12\xad\x01\n\x0bListSources\x12\x32.google.cloud.securitycenter.v1.ListSourcesRequest\x1a\x33.google.cloud.securitycenter.v1.ListSourcesResponse"5\x82\xd3\xe4\x93\x02&\x12$/v1/{parent=organizations/*}/sources\xda\x41\x06parent\x12\x87\x02\n\x11RunAssetDiscovery\x12\x38.google.cloud.securitycenter.v1.RunAssetDiscoveryRequest\x1a\x1d.google.longrunning.Operation"\x98\x01\x82\xd3\xe4\x93\x02\x35"0/v1/{parent=organizations/*}/assets:runDiscovery:\x01*\xda\x41\x06parent\xca\x41Q\n8google.cloud.securitycenter.v1.RunAssetDiscoveryResponse\x12\x15google.protobuf.Empty\x12\xcf\x01\n\x0fSetFindingState\x12\x36.google.cloud.securitycenter.v1.SetFindingStateRequest\x1a\'.google.cloud.securitycenter.v1.Finding"[\x82\xd3\xe4\x93\x02="8/v1/{name=organizations/*/sources/*/findings/*}:setState:\x01*\xda\x41\x15name,state,start_time\x12\x9d\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"R\x82\xd3\xe4\x93\x02:"5/v1/{resource=organizations/*/sources/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xc8\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"]\x82\xd3\xe4\x93\x02@";/v1/{resource=organizations/*/sources/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xc2\x01\n\rUpdateFinding\x12\x34.google.cloud.securitycenter.v1.UpdateFindingRequest\x1a\'.google.cloud.securitycenter.v1.Finding"R\x82\xd3\xe4\x93\x02\x42\x32\x37/v1/{finding.name=organizations/*/sources/*/findings/*}:\x07\x66inding\xda\x41\x07\x66inding\x12\xab\x02\n\x18UpdateNotificationConfig\x12?.google.cloud.securitycenter.v1.UpdateNotificationConfigRequest\x1a\x32.google.cloud.securitycenter.v1.NotificationConfig"\x99\x01\x82\xd3\xe4\x93\x02[2D/v1/{notification_config.name=organizations/*/notificationConfigs/*}:\x13notification_config\xda\x41\x13notification_config\xda\x41\x1fnotification_config,update_mask\x12\x93\x02\n\x1aUpdateOrganizationSettings\x12\x41.google.cloud.securitycenter.v1.UpdateOrganizationSettingsRequest\x1a\x34.google.cloud.securitycenter.v1.OrganizationSettings"|\x82\xd3\xe4\x93\x02^2E/v1/{organization_settings.name=organizations/*/organizationSettings}:\x15organization_settings\xda\x41\x15organization_settings\x12\xb1\x01\n\x0cUpdateSource\x12\x33.google.cloud.securitycenter.v1.UpdateSourceRequest\x1a&.google.cloud.securitycenter.v1.Source"D\x82\xd3\xe4\x93\x02\x35\x32+/v1/{source.name=organizations/*/sources/*}:\x06source\xda\x41\x06source\x12\xcd\x02\n\x13UpdateSecurityMarks\x12:.google.cloud.securitycenter.v1.UpdateSecurityMarksRequest\x1a-.google.cloud.securitycenter.v1.SecurityMarks"\xca\x01\x82\xd3\xe4\x93\x02\xb2\x01\x32@/v1/{security_marks.name=organizations/*/assets/*/securityMarks}:\x0esecurity_marksZ^2L/v1/{security_marks.name=organizations/*/sources/*/findings/*/securityMarks}:\x0esecurity_marks\xda\x41\x0esecurity_marks\x1aQ\xca\x41\x1dsecuritycenter.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_run__asset__discovery__response__pb2.DESCRIPTOR, @@ -67,6 +70,7 @@ google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_asset__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2.DESCRIPTOR, + google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_organization__settings__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_security__marks__pb2.DESCRIPTOR, google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_source__pb2.DESCRIPTOR, @@ -103,8 +107,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=3401, - serialized_end=3462, + serialized_start=4187, + serialized_end=4248, ) _sym_db.RegisterEnumDescriptor(_LISTASSETSRESPONSE_LISTASSETSRESULT_STATECHANGE) @@ -132,8 +136,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=4413, - serialized_end=4490, + serialized_start=5199, + serialized_end=5276, ) _sym_db.RegisterEnumDescriptor(_LISTFINDINGSRESPONSE_LISTFINDINGSRESULT_STATECHANGE) @@ -210,8 +214,85 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=823, - serialized_end=995, + serialized_start=887, + serialized_end=1059, +) + + +_CREATENOTIFICATIONCONFIGREQUEST = _descriptor.Descriptor( + name="CreateNotificationConfigRequest", + full_name="google.cloud.securitycenter.v1.CreateNotificationConfigRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.securitycenter.v1.CreateNotificationConfigRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A2\n0cloudresourcemanager.googleapis.com/Organization" + ), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="config_id", + full_name="google.cloud.securitycenter.v1.CreateNotificationConfigRequest.config_id", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\002"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="notification_config", + full_name="google.cloud.securitycenter.v1.CreateNotificationConfigRequest.notification_config", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\002"), + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1062, + serialized_end=1279, ) @@ -269,8 +350,90 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=998, - serialized_end=1154, + serialized_start=1282, + serialized_end=1438, +) + + +_DELETENOTIFICATIONCONFIGREQUEST = _descriptor.Descriptor( + name="DeleteNotificationConfigRequest", + full_name="google.cloud.securitycenter.v1.DeleteNotificationConfigRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.securitycenter.v1.DeleteNotificationConfigRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A2\n0securitycenter.googleapis.com/NotificationConfig" + ), + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1440, + serialized_end=1545, +) + + +_GETNOTIFICATIONCONFIGREQUEST = _descriptor.Descriptor( + name="GetNotificationConfigRequest", + full_name="google.cloud.securitycenter.v1.GetNotificationConfigRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.securitycenter.v1.GetNotificationConfigRequest.name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A2\n0securitycenter.googleapis.com/NotificationConfig" + ), + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1547, + serialized_end=1649, ) @@ -310,8 +473,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1156, - serialized_end=1262, + serialized_start=1651, + serialized_end=1757, ) @@ -351,8 +514,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1264, - serialized_end=1342, + serialized_start=1759, + serialized_end=1837, ) @@ -500,8 +663,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1345, - serialized_end=1617, + serialized_start=1840, + serialized_end=2112, ) @@ -593,8 +756,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1620, - serialized_end=1804, + serialized_start=2115, + serialized_end=2299, ) @@ -742,8 +905,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1807, - serialized_end=2069, + serialized_start=2302, + serialized_end=2564, ) @@ -835,8 +998,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2072, - serialized_end=2258, + serialized_start=2567, + serialized_end=2753, ) @@ -892,8 +1055,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2372, - serialized_end=2445, + serialized_start=2867, + serialized_end=2940, ) _GROUPRESULT = _descriptor.Descriptor( @@ -948,8 +1111,142 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2261, - serialized_end=2445, + serialized_start=2756, + serialized_end=2940, +) + + +_LISTNOTIFICATIONCONFIGSREQUEST = _descriptor.Descriptor( + name="ListNotificationConfigsRequest", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A2\n0cloudresourcemanager.googleapis.com/Organization" + ), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_token", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsRequest.page_token", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="page_size", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsRequest.page_size", + index=2, + number=3, + type=5, + cpp_type=1, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2943, + serialized_end=3088, +) + + +_LISTNOTIFICATIONCONFIGSRESPONSE = _descriptor.Descriptor( + name="ListNotificationConfigsResponse", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="notification_configs", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsResponse.notification_configs", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="next_page_token", + full_name="google.cloud.securitycenter.v1.ListNotificationConfigsResponse.next_page_token", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3091, + serialized_end=3231, ) @@ -1025,8 +1322,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2448, - serialized_end=2581, + serialized_start=3234, + serialized_end=3367, ) @@ -1082,8 +1379,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2583, - serialized_end=2686, + serialized_start=3369, + serialized_end=3472, ) @@ -1249,8 +1546,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=2689, - serialized_end=3008, + serialized_start=3475, + serialized_end=3794, ) @@ -1306,8 +1603,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3224, - serialized_end=3462, + serialized_start=4010, + serialized_end=4248, ) _LISTASSETSRESPONSE = _descriptor.Descriptor( @@ -1398,8 +1695,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3011, - serialized_end=3462, + serialized_start=3797, + serialized_end=4248, ) @@ -1565,8 +1862,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3465, - serialized_end=3774, + serialized_start=4251, + serialized_end=4560, ) @@ -1676,8 +1973,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4285, - serialized_end=4411, + serialized_start=5071, + serialized_end=5197, ) _LISTFINDINGSRESPONSE_LISTFINDINGSRESULT = _descriptor.Descriptor( @@ -1750,8 +2047,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3998, - serialized_end=4490, + serialized_start=4784, + serialized_end=5276, ) _LISTFINDINGSRESPONSE = _descriptor.Descriptor( @@ -1842,8 +2139,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=3777, - serialized_end=4490, + serialized_start=4563, + serialized_end=5276, ) @@ -1919,8 +2216,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4493, - serialized_end=4698, + serialized_start=5279, + serialized_end=5484, ) @@ -1960,8 +2257,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4700, - serialized_end=4800, + serialized_start=5486, + serialized_end=5586, ) @@ -2017,8 +2314,65 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4803, - serialized_end=4937, + serialized_start=5589, + serialized_end=5723, +) + + +_UPDATENOTIFICATIONCONFIGREQUEST = _descriptor.Descriptor( + name="UpdateNotificationConfigRequest", + full_name="google.cloud.securitycenter.v1.UpdateNotificationConfigRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="notification_config", + full_name="google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.notification_config", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\002"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="update_mask", + full_name="google.cloud.securitycenter.v1.UpdateNotificationConfigRequest.update_mask", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=5726, + serialized_end=5894, ) @@ -2074,8 +2428,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=4940, - serialized_end=5114, + serialized_start=5897, + serialized_end=6071, ) @@ -2131,8 +2485,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5117, - serialized_end=5248, + serialized_start=6074, + serialized_end=6205, ) @@ -2206,8 +2560,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=5251, - serialized_end=5452, + serialized_start=6208, + serialized_end=6409, ) _CREATEFINDINGREQUEST.fields_by_name[ @@ -2215,6 +2569,11 @@ ].message_type = ( google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2._FINDING ) +_CREATENOTIFICATIONCONFIGREQUEST.fields_by_name[ + "notification_config" +].message_type = ( + google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2._NOTIFICATIONCONFIG +) _CREATESOURCEREQUEST.fields_by_name[ "source" ].message_type = ( @@ -2245,6 +2604,11 @@ ].message_type = google_dot_protobuf_dot_struct__pb2._VALUE _GROUPRESULT_PROPERTIESENTRY.containing_type = _GROUPRESULT _GROUPRESULT.fields_by_name["properties"].message_type = _GROUPRESULT_PROPERTIESENTRY +_LISTNOTIFICATIONCONFIGSRESPONSE.fields_by_name[ + "notification_configs" +].message_type = ( + google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2._NOTIFICATIONCONFIG +) _LISTSOURCESRESPONSE.fields_by_name[ "sources" ].message_type = ( @@ -2324,6 +2688,14 @@ _UPDATEFINDINGREQUEST.fields_by_name[ "update_mask" ].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_UPDATENOTIFICATIONCONFIGREQUEST.fields_by_name[ + "notification_config" +].message_type = ( + google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2._NOTIFICATIONCONFIG +) +_UPDATENOTIFICATIONCONFIGREQUEST.fields_by_name[ + "update_mask" +].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK _UPDATEORGANIZATIONSETTINGSREQUEST.fields_by_name[ "organization_settings" ].message_type = ( @@ -2352,7 +2724,16 @@ "start_time" ].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP DESCRIPTOR.message_types_by_name["CreateFindingRequest"] = _CREATEFINDINGREQUEST +DESCRIPTOR.message_types_by_name[ + "CreateNotificationConfigRequest" +] = _CREATENOTIFICATIONCONFIGREQUEST DESCRIPTOR.message_types_by_name["CreateSourceRequest"] = _CREATESOURCEREQUEST +DESCRIPTOR.message_types_by_name[ + "DeleteNotificationConfigRequest" +] = _DELETENOTIFICATIONCONFIGREQUEST +DESCRIPTOR.message_types_by_name[ + "GetNotificationConfigRequest" +] = _GETNOTIFICATIONCONFIGREQUEST DESCRIPTOR.message_types_by_name[ "GetOrganizationSettingsRequest" ] = _GETORGANIZATIONSETTINGSREQUEST @@ -2362,6 +2743,12 @@ DESCRIPTOR.message_types_by_name["GroupFindingsRequest"] = _GROUPFINDINGSREQUEST DESCRIPTOR.message_types_by_name["GroupFindingsResponse"] = _GROUPFINDINGSRESPONSE DESCRIPTOR.message_types_by_name["GroupResult"] = _GROUPRESULT +DESCRIPTOR.message_types_by_name[ + "ListNotificationConfigsRequest" +] = _LISTNOTIFICATIONCONFIGSREQUEST +DESCRIPTOR.message_types_by_name[ + "ListNotificationConfigsResponse" +] = _LISTNOTIFICATIONCONFIGSRESPONSE DESCRIPTOR.message_types_by_name["ListSourcesRequest"] = _LISTSOURCESREQUEST DESCRIPTOR.message_types_by_name["ListSourcesResponse"] = _LISTSOURCESRESPONSE DESCRIPTOR.message_types_by_name["ListAssetsRequest"] = _LISTASSETSREQUEST @@ -2371,6 +2758,9 @@ DESCRIPTOR.message_types_by_name["SetFindingStateRequest"] = _SETFINDINGSTATEREQUEST DESCRIPTOR.message_types_by_name["RunAssetDiscoveryRequest"] = _RUNASSETDISCOVERYREQUEST DESCRIPTOR.message_types_by_name["UpdateFindingRequest"] = _UPDATEFINDINGREQUEST +DESCRIPTOR.message_types_by_name[ + "UpdateNotificationConfigRequest" +] = _UPDATENOTIFICATIONCONFIGREQUEST DESCRIPTOR.message_types_by_name[ "UpdateOrganizationSettingsRequest" ] = _UPDATEORGANIZATIONSETTINGSREQUEST @@ -2408,6 +2798,33 @@ ) _sym_db.RegisterMessage(CreateFindingRequest) +CreateNotificationConfigRequest = _reflection.GeneratedProtocolMessageType( + "CreateNotificationConfigRequest", + (_message.Message,), + dict( + DESCRIPTOR=_CREATENOTIFICATIONCONFIGREQUEST, + __module__="google.cloud.securitycenter_v1.proto.securitycenter_service_pb2", + __doc__="""Request message for creating a notification config. + + + Attributes: + parent: + Required. Resource name of the new notification config's + parent. Its format is "organizations/[organization\_id]". + config_id: + Required. Unique identifier provided by the client within the + parent scope. It must be between 1 and 128 characters, and + contains alphanumeric characters, underscores or hyphens only. + notification_config: + Required. The notification config being created. The name and + the service account will be ignored as they are both output + only fields on this resource. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.CreateNotificationConfigRequest) + ), +) +_sym_db.RegisterMessage(CreateNotificationConfigRequest) + CreateSourceRequest = _reflection.GeneratedProtocolMessageType( "CreateSourceRequest", (_message.Message,), @@ -2430,6 +2847,46 @@ ) _sym_db.RegisterMessage(CreateSourceRequest) +DeleteNotificationConfigRequest = _reflection.GeneratedProtocolMessageType( + "DeleteNotificationConfigRequest", + (_message.Message,), + dict( + DESCRIPTOR=_DELETENOTIFICATIONCONFIGREQUEST, + __module__="google.cloud.securitycenter_v1.proto.securitycenter_service_pb2", + __doc__="""Request message for deleting a notification config. + + + Attributes: + name: + Required. Name of the notification config to delete. Its + format is "organizations/[organization\_id]/notificationConfig + s/[config\_id]". + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.DeleteNotificationConfigRequest) + ), +) +_sym_db.RegisterMessage(DeleteNotificationConfigRequest) + +GetNotificationConfigRequest = _reflection.GeneratedProtocolMessageType( + "GetNotificationConfigRequest", + (_message.Message,), + dict( + DESCRIPTOR=_GETNOTIFICATIONCONFIGREQUEST, + __module__="google.cloud.securitycenter_v1.proto.securitycenter_service_pb2", + __doc__="""Request message for getting a notification config. + + + Attributes: + name: + Required. Name of the notification config to get. Its format + is "organizations/[organization\_id]/notificationConfigs/[conf + ig\_id]". + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.GetNotificationConfigRequest) + ), +) +_sym_db.RegisterMessage(GetNotificationConfigRequest) + GetOrganizationSettingsRequest = _reflection.GeneratedProtocolMessageType( "GetOrganizationSettingsRequest", (_message.Message,), @@ -2677,17 +3134,21 @@ the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible "state\_change" values when compare\_duration is specified: - - "CHANGED": indicates that the finding was present at the start - of compare\_duration, but changed its state at read\_time. - - "UNCHANGED": indicates that the finding was present at the - start of compare\_duration and did not change state at - read\_time. - "ADDED": indicates that the finding was not - present at the start of compare\_duration, but was present - at read\_time. If compare\_duration is not specified, then - the only possible state\_change is "UNUSED", which will be the - state\_change set for all findings present at read\_time. If - this field is set then ``state_change`` must be a specified - field in ``group_by``. + "CHANGED": indicates that the finding was present and matched + the given filter at the start of compare\_duration, but + changed its state at read\_time. - "UNCHANGED": indicates + that the finding was present and matched the given filter + at the start of compare\_duration and did not change state + at read\_time. - "ADDED": indicates that the finding did not + match the given filter or was not present at the start of + compare\_duration, but was present at read\_time. - + "REMOVED": indicates that the finding was present and matched + the filter at the start of compare\_duration, but did not + match the filter at read\_time. If compare\_duration is + not specified, then the only possible state\_change is + "UNUSED", which will be the state\_change set for all findings + present at read\_time. If this field is set then + ``state_change`` must be a specified field in ``group_by``. page_token: The value returned by the last ``GroupFindingsResponse``; indicates that this is a continuation of a prior @@ -2761,6 +3222,54 @@ _sym_db.RegisterMessage(GroupResult) _sym_db.RegisterMessage(GroupResult.PropertiesEntry) +ListNotificationConfigsRequest = _reflection.GeneratedProtocolMessageType( + "ListNotificationConfigsRequest", + (_message.Message,), + dict( + DESCRIPTOR=_LISTNOTIFICATIONCONFIGSREQUEST, + __module__="google.cloud.securitycenter_v1.proto.securitycenter_service_pb2", + __doc__="""Request message for listing notification configs. + + + Attributes: + parent: + Required. Name of the organization to list notification + configs. Its format is "organizations/[organization\_id]". + page_token: + The value returned by the last + ``ListNotificationConfigsResponse``; indicates that this is a + continuation of a prior ``ListNotificationConfigs`` call, and + that the system should return the next page of data. + page_size: + The maximum number of results to return in a single response. + Default is 10, minimum is 1, maximum is 1000. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListNotificationConfigsRequest) + ), +) +_sym_db.RegisterMessage(ListNotificationConfigsRequest) + +ListNotificationConfigsResponse = _reflection.GeneratedProtocolMessageType( + "ListNotificationConfigsResponse", + (_message.Message,), + dict( + DESCRIPTOR=_LISTNOTIFICATIONCONFIGSRESPONSE, + __module__="google.cloud.securitycenter_v1.proto.securitycenter_service_pb2", + __doc__="""Response message for listing notification configs. + + + Attributes: + notification_configs: + Notification configs belonging to the requested parent. + next_page_token: + Token to retrieve the next page of results, or empty if there + are no more results. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.ListNotificationConfigsResponse) + ), +) +_sym_db.RegisterMessage(ListNotificationConfigsResponse) + ListSourcesRequest = _reflection.GeneratedProtocolMessageType( "ListSourcesRequest", (_message.Message,), @@ -3044,15 +3553,20 @@ the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible "state\_change" values when compare\_duration is specified: - - "CHANGED": indicates that the finding was present at the start - of compare\_duration, but changed its state at read\_time. - - "UNCHANGED": indicates that the finding was present at the - start of compare\_duration and did not change state at - read\_time. - "ADDED": indicates that the finding was not - present at the start of compare\_duration, but was present - at read\_time. If compare\_duration is not specified, then - the only possible state\_change is "UNUSED", which will be the - state\_change set for all findings present at read\_time. + "CHANGED": indicates that the finding was present and matched + the given filter at the start of compare\_duration, but + changed its state at read\_time. - "UNCHANGED": indicates + that the finding was present and matched the given filter + at the start of compare\_duration and did not change state + at read\_time. - "ADDED": indicates that the finding did not + match the given filter or was not present at the start of + compare\_duration, but was present at read\_time. - + "REMOVED": indicates that the finding was present and matched + the filter at the start of compare\_duration, but did not + match the filter at read\_time. If compare\_duration is + not specified, then the only possible state\_change is + "UNUSED", which will be the state\_change set for all findings + present at read\_time. field_mask: Optional. A field mask to specify the Finding fields to be listed in the response. An empty field mask will list all @@ -3221,6 +3735,27 @@ ) _sym_db.RegisterMessage(UpdateFindingRequest) +UpdateNotificationConfigRequest = _reflection.GeneratedProtocolMessageType( + "UpdateNotificationConfigRequest", + (_message.Message,), + dict( + DESCRIPTOR=_UPDATENOTIFICATIONCONFIGREQUEST, + __module__="google.cloud.securitycenter_v1.proto.securitycenter_service_pb2", + __doc__="""Request message for updating a notification config. + + + Attributes: + notification_config: + Required. The notification config to update. + update_mask: + The FieldMask to use when updating the notification config. + If empty all mutable fields will be updated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1.UpdateNotificationConfigRequest) + ), +) +_sym_db.RegisterMessage(UpdateNotificationConfigRequest) + UpdateOrganizationSettingsRequest = _reflection.GeneratedProtocolMessageType( "UpdateOrganizationSettingsRequest", (_message.Message,), @@ -3296,8 +3831,13 @@ _CREATEFINDINGREQUEST.fields_by_name["parent"]._options = None _CREATEFINDINGREQUEST.fields_by_name["finding_id"]._options = None _CREATEFINDINGREQUEST.fields_by_name["finding"]._options = None +_CREATENOTIFICATIONCONFIGREQUEST.fields_by_name["parent"]._options = None +_CREATENOTIFICATIONCONFIGREQUEST.fields_by_name["config_id"]._options = None +_CREATENOTIFICATIONCONFIGREQUEST.fields_by_name["notification_config"]._options = None _CREATESOURCEREQUEST.fields_by_name["parent"]._options = None _CREATESOURCEREQUEST.fields_by_name["source"]._options = None +_DELETENOTIFICATIONCONFIGREQUEST.fields_by_name["name"]._options = None +_GETNOTIFICATIONCONFIGREQUEST.fields_by_name["name"]._options = None _GETORGANIZATIONSETTINGSREQUEST.fields_by_name["name"]._options = None _GETSOURCEREQUEST.fields_by_name["name"]._options = None _GROUPASSETSREQUEST.fields_by_name["parent"]._options = None @@ -3305,6 +3845,7 @@ _GROUPFINDINGSREQUEST.fields_by_name["parent"]._options = None _GROUPFINDINGSREQUEST.fields_by_name["group_by"]._options = None _GROUPRESULT_PROPERTIESENTRY._options = None +_LISTNOTIFICATIONCONFIGSREQUEST.fields_by_name["parent"]._options = None _LISTSOURCESREQUEST.fields_by_name["parent"]._options = None _LISTASSETSREQUEST.fields_by_name["parent"]._options = None _LISTASSETSREQUEST.fields_by_name["field_mask"]._options = None @@ -3315,6 +3856,7 @@ _SETFINDINGSTATEREQUEST.fields_by_name["start_time"]._options = None _RUNASSETDISCOVERYREQUEST.fields_by_name["parent"]._options = None _UPDATEFINDINGREQUEST.fields_by_name["finding"]._options = None +_UPDATENOTIFICATIONCONFIGREQUEST.fields_by_name["notification_config"]._options = None _UPDATEORGANIZATIONSETTINGSREQUEST.fields_by_name[ "organization_settings" ]._options = None @@ -3329,8 +3871,8 @@ serialized_options=_b( "\312A\035securitycenter.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" ), - serialized_start=5455, - serialized_end=9197, + serialized_start=6412, + serialized_end=11362, methods=[ _descriptor.MethodDescriptor( name="CreateSource", @@ -3354,10 +3896,32 @@ '\202\323\344\223\002:"//v1/{parent=organizations/*/sources/*}/findings:\007finding\332A\031parent,finding_id,finding' ), ), + _descriptor.MethodDescriptor( + name="CreateNotificationConfig", + full_name="google.cloud.securitycenter.v1.SecurityCenter.CreateNotificationConfig", + index=2, + containing_service=None, + input_type=_CREATENOTIFICATIONCONFIGREQUEST, + output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2._NOTIFICATIONCONFIG, + serialized_options=_b( + '\202\323\344\223\002G"0/v1/{parent=organizations/*}/notificationConfigs:\023notification_config\332A$parent,config_id,notification_config\332A\032parent,notification_config' + ), + ), + _descriptor.MethodDescriptor( + name="DeleteNotificationConfig", + full_name="google.cloud.securitycenter.v1.SecurityCenter.DeleteNotificationConfig", + index=3, + containing_service=None, + input_type=_DELETENOTIFICATIONCONFIGREQUEST, + output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, + serialized_options=_b( + "\202\323\344\223\0022*0/v1/{name=organizations/*/notificationConfigs/*}\332A\004name" + ), + ), _descriptor.MethodDescriptor( name="GetIamPolicy", full_name="google.cloud.securitycenter.v1.SecurityCenter.GetIamPolicy", - index=2, + index=4, containing_service=None, input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._GETIAMPOLICYREQUEST, output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, @@ -3365,10 +3929,21 @@ '\202\323\344\223\002:"5/v1/{resource=organizations/*/sources/*}:getIamPolicy:\001*\332A\010resource' ), ), + _descriptor.MethodDescriptor( + name="GetNotificationConfig", + full_name="google.cloud.securitycenter.v1.SecurityCenter.GetNotificationConfig", + index=5, + containing_service=None, + input_type=_GETNOTIFICATIONCONFIGREQUEST, + output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2._NOTIFICATIONCONFIG, + serialized_options=_b( + "\202\323\344\223\0022\0220/v1/{name=organizations/*/notificationConfigs/*}\332A\004name" + ), + ), _descriptor.MethodDescriptor( name="GetOrganizationSettings", full_name="google.cloud.securitycenter.v1.SecurityCenter.GetOrganizationSettings", - index=3, + index=6, containing_service=None, input_type=_GETORGANIZATIONSETTINGSREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_organization__settings__pb2._ORGANIZATIONSETTINGS, @@ -3379,7 +3954,7 @@ _descriptor.MethodDescriptor( name="GetSource", full_name="google.cloud.securitycenter.v1.SecurityCenter.GetSource", - index=4, + index=7, containing_service=None, input_type=_GETSOURCEREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_source__pb2._SOURCE, @@ -3390,7 +3965,7 @@ _descriptor.MethodDescriptor( name="GroupAssets", full_name="google.cloud.securitycenter.v1.SecurityCenter.GroupAssets", - index=5, + index=8, containing_service=None, input_type=_GROUPASSETSREQUEST, output_type=_GROUPASSETSRESPONSE, @@ -3401,7 +3976,7 @@ _descriptor.MethodDescriptor( name="GroupFindings", full_name="google.cloud.securitycenter.v1.SecurityCenter.GroupFindings", - index=6, + index=9, containing_service=None, input_type=_GROUPFINDINGSREQUEST, output_type=_GROUPFINDINGSRESPONSE, @@ -3412,7 +3987,7 @@ _descriptor.MethodDescriptor( name="ListAssets", full_name="google.cloud.securitycenter.v1.SecurityCenter.ListAssets", - index=7, + index=10, containing_service=None, input_type=_LISTASSETSREQUEST, output_type=_LISTASSETSRESPONSE, @@ -3423,7 +3998,7 @@ _descriptor.MethodDescriptor( name="ListFindings", full_name="google.cloud.securitycenter.v1.SecurityCenter.ListFindings", - index=8, + index=11, containing_service=None, input_type=_LISTFINDINGSREQUEST, output_type=_LISTFINDINGSRESPONSE, @@ -3431,10 +4006,21 @@ "\202\323\344\223\0021\022//v1/{parent=organizations/*/sources/*}/findings" ), ), + _descriptor.MethodDescriptor( + name="ListNotificationConfigs", + full_name="google.cloud.securitycenter.v1.SecurityCenter.ListNotificationConfigs", + index=12, + containing_service=None, + input_type=_LISTNOTIFICATIONCONFIGSREQUEST, + output_type=_LISTNOTIFICATIONCONFIGSRESPONSE, + serialized_options=_b( + "\202\323\344\223\0022\0220/v1/{parent=organizations/*}/notificationConfigs\332A\006parent" + ), + ), _descriptor.MethodDescriptor( name="ListSources", full_name="google.cloud.securitycenter.v1.SecurityCenter.ListSources", - index=9, + index=13, containing_service=None, input_type=_LISTSOURCESREQUEST, output_type=_LISTSOURCESRESPONSE, @@ -3445,7 +4031,7 @@ _descriptor.MethodDescriptor( name="RunAssetDiscovery", full_name="google.cloud.securitycenter.v1.SecurityCenter.RunAssetDiscovery", - index=10, + index=14, containing_service=None, input_type=_RUNASSETDISCOVERYREQUEST, output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, @@ -3456,7 +4042,7 @@ _descriptor.MethodDescriptor( name="SetFindingState", full_name="google.cloud.securitycenter.v1.SecurityCenter.SetFindingState", - index=11, + index=15, containing_service=None, input_type=_SETFINDINGSTATEREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2._FINDING, @@ -3467,7 +4053,7 @@ _descriptor.MethodDescriptor( name="SetIamPolicy", full_name="google.cloud.securitycenter.v1.SecurityCenter.SetIamPolicy", - index=12, + index=16, containing_service=None, input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._SETIAMPOLICYREQUEST, output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, @@ -3478,7 +4064,7 @@ _descriptor.MethodDescriptor( name="TestIamPermissions", full_name="google.cloud.securitycenter.v1.SecurityCenter.TestIamPermissions", - index=13, + index=17, containing_service=None, input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSREQUEST, output_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSRESPONSE, @@ -3489,7 +4075,7 @@ _descriptor.MethodDescriptor( name="UpdateFinding", full_name="google.cloud.securitycenter.v1.SecurityCenter.UpdateFinding", - index=14, + index=18, containing_service=None, input_type=_UPDATEFINDINGREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2._FINDING, @@ -3497,10 +4083,21 @@ "\202\323\344\223\002B27/v1/{finding.name=organizations/*/sources/*/findings/*}:\007finding\332A\007finding" ), ), + _descriptor.MethodDescriptor( + name="UpdateNotificationConfig", + full_name="google.cloud.securitycenter.v1.SecurityCenter.UpdateNotificationConfig", + index=19, + containing_service=None, + input_type=_UPDATENOTIFICATIONCONFIGREQUEST, + output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2._NOTIFICATIONCONFIG, + serialized_options=_b( + "\202\323\344\223\002[2D/v1/{notification_config.name=organizations/*/notificationConfigs/*}:\023notification_config\332A\023notification_config\332A\037notification_config,update_mask" + ), + ), _descriptor.MethodDescriptor( name="UpdateOrganizationSettings", full_name="google.cloud.securitycenter.v1.SecurityCenter.UpdateOrganizationSettings", - index=15, + index=20, containing_service=None, input_type=_UPDATEORGANIZATIONSETTINGSREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_organization__settings__pb2._ORGANIZATIONSETTINGS, @@ -3511,7 +4108,7 @@ _descriptor.MethodDescriptor( name="UpdateSource", full_name="google.cloud.securitycenter.v1.SecurityCenter.UpdateSource", - index=16, + index=21, containing_service=None, input_type=_UPDATESOURCEREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_source__pb2._SOURCE, @@ -3522,7 +4119,7 @@ _descriptor.MethodDescriptor( name="UpdateSecurityMarks", full_name="google.cloud.securitycenter.v1.SecurityCenter.UpdateSecurityMarks", - index=17, + index=22, containing_service=None, input_type=_UPDATESECURITYMARKSREQUEST, output_type=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_security__marks__pb2._SECURITYMARKS, diff --git a/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2_grpc.py b/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2_grpc.py index af875d94..96a0236b 100644 --- a/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2_grpc.py +++ b/google/cloud/securitycenter_v1/proto/securitycenter_service_pb2_grpc.py @@ -4,6 +4,9 @@ from google.cloud.securitycenter_v1.proto import ( finding_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2, ) +from google.cloud.securitycenter_v1.proto import ( + notification_config_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2, +) from google.cloud.securitycenter_v1.proto import ( organization_settings_pb2 as google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_organization__settings__pb2, ) @@ -21,6 +24,7 @@ from google.longrunning import ( operations_pb2 as google_dot_longrunning_dot_operations__pb2, ) +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class SecurityCenterStub(object): @@ -43,11 +47,26 @@ def __init__(self, channel): request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.CreateFindingRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2.Finding.FromString, ) + self.CreateNotificationConfig = channel.unary_unary( + "/google.cloud.securitycenter.v1.SecurityCenter/CreateNotificationConfig", + request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.CreateNotificationConfigRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.NotificationConfig.FromString, + ) + self.DeleteNotificationConfig = channel.unary_unary( + "/google.cloud.securitycenter.v1.SecurityCenter/DeleteNotificationConfig", + request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.DeleteNotificationConfigRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) self.GetIamPolicy = channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/GetIamPolicy", request_serializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.SerializeToString, response_deserializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.FromString, ) + self.GetNotificationConfig = channel.unary_unary( + "/google.cloud.securitycenter.v1.SecurityCenter/GetNotificationConfig", + request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.GetNotificationConfigRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.NotificationConfig.FromString, + ) self.GetOrganizationSettings = channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/GetOrganizationSettings", request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.GetOrganizationSettingsRequest.SerializeToString, @@ -78,6 +97,11 @@ def __init__(self, channel): request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListFindingsRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListFindingsResponse.FromString, ) + self.ListNotificationConfigs = channel.unary_unary( + "/google.cloud.securitycenter.v1.SecurityCenter/ListNotificationConfigs", + request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListNotificationConfigsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListNotificationConfigsResponse.FromString, + ) self.ListSources = channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/ListSources", request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListSourcesRequest.SerializeToString, @@ -108,6 +132,11 @@ def __init__(self, channel): request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.UpdateFindingRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2.Finding.FromString, ) + self.UpdateNotificationConfig = channel.unary_unary( + "/google.cloud.securitycenter.v1.SecurityCenter/UpdateNotificationConfig", + request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.UpdateNotificationConfigRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.NotificationConfig.FromString, + ) self.UpdateOrganizationSettings = channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/UpdateOrganizationSettings", request_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.UpdateOrganizationSettingsRequest.SerializeToString, @@ -144,6 +173,20 @@ def CreateFinding(self, request, context): context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") + def CreateNotificationConfig(self, request, context): + """Creates a notification config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def DeleteNotificationConfig(self, request, context): + """Deletes a notification config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + def GetIamPolicy(self, request, context): """Gets the access control policy on the specified Source. """ @@ -151,6 +194,13 @@ def GetIamPolicy(self, request, context): context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") + def GetNotificationConfig(self, request, context): + """Gets a notification config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + def GetOrganizationSettings(self, request, context): """Gets the settings for an organization. """ @@ -201,6 +251,13 @@ def ListFindings(self, request, context): context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") + def ListNotificationConfigs(self, request, context): + """Lists notification configs. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + def ListSources(self, request, context): """Lists all sources belonging to an organization. """ @@ -249,6 +306,14 @@ def UpdateFinding(self, request, context): context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") + def UpdateNotificationConfig(self, request, context): + """ + Updates a notification config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + def UpdateOrganizationSettings(self, request, context): """Updates an organization's settings. """ @@ -283,11 +348,26 @@ def add_SecurityCenterServicer_to_server(servicer, server): request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.CreateFindingRequest.FromString, response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2.Finding.SerializeToString, ), + "CreateNotificationConfig": grpc.unary_unary_rpc_method_handler( + servicer.CreateNotificationConfig, + request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.CreateNotificationConfigRequest.FromString, + response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.NotificationConfig.SerializeToString, + ), + "DeleteNotificationConfig": grpc.unary_unary_rpc_method_handler( + servicer.DeleteNotificationConfig, + request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.DeleteNotificationConfigRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), "GetIamPolicy": grpc.unary_unary_rpc_method_handler( servicer.GetIamPolicy, request_deserializer=google_dot_iam_dot_v1_dot_iam__policy__pb2.GetIamPolicyRequest.FromString, response_serializer=google_dot_iam_dot_v1_dot_policy__pb2.Policy.SerializeToString, ), + "GetNotificationConfig": grpc.unary_unary_rpc_method_handler( + servicer.GetNotificationConfig, + request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.GetNotificationConfigRequest.FromString, + response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.NotificationConfig.SerializeToString, + ), "GetOrganizationSettings": grpc.unary_unary_rpc_method_handler( servicer.GetOrganizationSettings, request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.GetOrganizationSettingsRequest.FromString, @@ -318,6 +398,11 @@ def add_SecurityCenterServicer_to_server(servicer, server): request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListFindingsRequest.FromString, response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListFindingsResponse.SerializeToString, ), + "ListNotificationConfigs": grpc.unary_unary_rpc_method_handler( + servicer.ListNotificationConfigs, + request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListNotificationConfigsRequest.FromString, + response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListNotificationConfigsResponse.SerializeToString, + ), "ListSources": grpc.unary_unary_rpc_method_handler( servicer.ListSources, request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.ListSourcesRequest.FromString, @@ -348,6 +433,11 @@ def add_SecurityCenterServicer_to_server(servicer, server): request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.UpdateFindingRequest.FromString, response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_finding__pb2.Finding.SerializeToString, ), + "UpdateNotificationConfig": grpc.unary_unary_rpc_method_handler( + servicer.UpdateNotificationConfig, + request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.UpdateNotificationConfigRequest.FromString, + response_serializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_notification__config__pb2.NotificationConfig.SerializeToString, + ), "UpdateOrganizationSettings": grpc.unary_unary_rpc_method_handler( servicer.UpdateOrganizationSettings, request_deserializer=google_dot_cloud_dot_securitycenter__v1_dot_proto_dot_securitycenter__service__pb2.UpdateOrganizationSettingsRequest.FromString, diff --git a/google/cloud/securitycenter_v1/proto/source.proto b/google/cloud/securitycenter_v1/proto/source.proto index d26e042f..6fca821b 100644 --- a/google/cloud/securitycenter_v1/proto/source.proto +++ b/google/cloud/securitycenter_v1/proto/source.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,14 +11,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// syntax = "proto3"; package google.cloud.securitycenter.v1; -import "google/api/resource.proto"; import "google/api/annotations.proto"; +import "google/api/resource.proto"; option csharp_namespace = "Google.Cloud.SecurityCenter.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter"; diff --git a/google/cloud/securitycenter_v1/proto/source_pb2.py b/google/cloud/securitycenter_v1/proto/source_pb2.py index c8d99874..2342f7ec 100644 --- a/google/cloud/securitycenter_v1/proto/source_pb2.py +++ b/google/cloud/securitycenter_v1/proto/source_pb2.py @@ -15,8 +15,8 @@ _sym_db = _symbol_database.Default() -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 DESCRIPTOR = _descriptor.FileDescriptor( @@ -27,11 +27,11 @@ '\n"com.google.cloud.securitycenter.v1P\001ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\252\002\036Google.Cloud.SecurityCenter.V1\312\002\036Google\\Cloud\\SecurityCenter\\V1\352\002!Google::Cloud::SecurityCenter::V1' ), serialized_pb=_b( - '\n1google/cloud/securitycenter_v1/proto/source.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x19google/api/resource.proto\x1a\x1cgoogle/api/annotations.proto"\x9b\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t:X\xea\x41U\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}B\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' + '\n1google/cloud/securitycenter_v1/proto/source.proto\x12\x1egoogle.cloud.securitycenter.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto"\x9b\x01\n\x06Source\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t:X\xea\x41U\n$securitycenter.googleapis.com/Source\x12-organizations/{organization}/sources/{source}B\xda\x01\n"com.google.cloud.securitycenter.v1P\x01ZLgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter\xaa\x02\x1eGoogle.Cloud.SecurityCenter.V1\xca\x02\x1eGoogle\\Cloud\\SecurityCenter\\V1\xea\x02!Google::Cloud::SecurityCenter::V1b\x06proto3' ), dependencies=[ - google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, ], ) diff --git a/google/cloud/securitycenter_v1/types.py b/google/cloud/securitycenter_v1/types.py index 6c434f27..a4f66d0e 100644 --- a/google/cloud/securitycenter_v1/types.py +++ b/google/cloud/securitycenter_v1/types.py @@ -22,6 +22,8 @@ from google.cloud.securitycenter_v1.proto import asset_pb2 from google.cloud.securitycenter_v1.proto import finding_pb2 +from google.cloud.securitycenter_v1.proto import notification_config_pb2 +from google.cloud.securitycenter_v1.proto import notification_message_pb2 from google.cloud.securitycenter_v1.proto import organization_settings_pb2 from google.cloud.securitycenter_v1.proto import run_asset_discovery_response_pb2 from google.cloud.securitycenter_v1.proto import security_marks_pb2 @@ -33,6 +35,7 @@ from google.longrunning import operations_pb2 from google.protobuf import any_pb2 from google.protobuf import duration_pb2 +from google.protobuf import empty_pb2 from google.protobuf import field_mask_pb2 from google.protobuf import struct_pb2 from google.protobuf import timestamp_pb2 @@ -47,6 +50,7 @@ operations_pb2, any_pb2, duration_pb2, + empty_pb2, field_mask_pb2, struct_pb2, timestamp_pb2, @@ -57,6 +61,8 @@ _local_modules = [ asset_pb2, finding_pb2, + notification_config_pb2, + notification_message_pb2, organization_settings_pb2, run_asset_discovery_response_pb2, security_marks_pb2, diff --git a/google/cloud/securitycenter_v1beta1/proto/security_marks_pb2.py b/google/cloud/securitycenter_v1beta1/proto/security_marks_pb2.py index 4cec1186..ae674ca2 100644 --- a/google/cloud/securitycenter_v1beta1/proto/security_marks_pb2.py +++ b/google/cloud/securitycenter_v1beta1/proto/security_marks_pb2.py @@ -170,10 +170,10 @@ ), DESCRIPTOR=_SECURITYMARKS, __module__="google.cloud.securitycenter_v1beta1.proto.security_marks_pb2", - __doc__="""User specified security marks that are attached to the parent Cloud - Security Command Center (Cloud SCC) resource. Security marks are scoped - within a Cloud SCC organization -- they can be modified and viewed by - all users who have proper permissions on the organization. + __doc__="""User specified security marks that are attached to the + parent Cloud Security Command Center (Cloud SCC) resource. Security + marks are scoped within a Cloud SCC organization -- they can be modified + and viewed by all users who have proper permissions on the organization. Attributes: diff --git a/google/cloud/securitycenter_v1beta1/proto/source_pb2.py b/google/cloud/securitycenter_v1beta1/proto/source_pb2.py index d6ae93c0..a80fbf8f 100644 --- a/google/cloud/securitycenter_v1beta1/proto/source_pb2.py +++ b/google/cloud/securitycenter_v1beta1/proto/source_pb2.py @@ -121,10 +121,10 @@ dict( DESCRIPTOR=_SOURCE, __module__="google.cloud.securitycenter_v1beta1.proto.source_pb2", - __doc__="""Cloud Security Command Center's (Cloud SCC) finding - source. A finding source is an entity or a mechanism that can produce a - finding. A source is like a container of findings that come from the - same scanner, logger, monitor, etc. + __doc__="""Cloud Security Command Center's (Cloud SCC) finding source. A finding + source is an entity or a mechanism that can produce a finding. A source + is like a container of findings that come from the same scanner, logger, + monitor, etc. Attributes: diff --git a/google/cloud/securitycenter_v1p1beta1/proto/source_pb2.py b/google/cloud/securitycenter_v1p1beta1/proto/source_pb2.py index 3c0d63d8..944aa67b 100644 --- a/google/cloud/securitycenter_v1p1beta1/proto/source_pb2.py +++ b/google/cloud/securitycenter_v1p1beta1/proto/source_pb2.py @@ -121,10 +121,10 @@ dict( DESCRIPTOR=_SOURCE, __module__="google.cloud.securitycenter_v1p1beta1.proto.source_pb2", - __doc__="""Cloud Security Command Center's (Cloud SCC) finding source. A finding - source is an entity or a mechanism that can produce a finding. A source - is like a container of findings that come from the same scanner, logger, - monitor, etc. + __doc__="""Cloud Security Command Center's (Cloud SCC) finding + source. A finding source is an entity or a mechanism that can produce a + finding. A source is like a container of findings that come from the + same scanner, logger, monitor, etc. Attributes: diff --git a/synth.metadata b/synth.metadata index 71562337..83c9ca47 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,20 +1,20 @@ { - "updateTime": "2020-02-26T13:22:21.777839Z", + "updateTime": "2020-03-10T12:22:17.922691Z", "sources": [ { "generator": { "name": "artman", - "version": "0.45.1", - "dockerImage": "googleapis/artman@sha256:36956ca6a4dc70a59de5d5d0fd35061b050bb56884516f0898f46d8220f25738" + "version": "1.1.0", + "dockerImage": "googleapis/artman@sha256:f54b7644a1d2e7a37b23f5c0dfe9bba473e41c675002a507a244389e27487ca9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0aba1900ffef672ec5f0da677cf590ee5686e13b", - "internalRef": "297204568", - "log": "0aba1900ffef672ec5f0da677cf590ee5686e13b\ncluster: use square brace for cross-reference\n\nPiperOrigin-RevId: 297204568\n\n5dac2da18f6325cbaed54603c43f0667ecd50247\nRestore retry params in gapic config because securitycenter has non-standard default retry params.\nRestore a few retry codes for some idempotent methods.\n\nPiperOrigin-RevId: 297196720\n\n1eb61455530252bba8b2c8d4bc9832960e5a56f6\npubsub: v1 replace IAM HTTP rules\n\nPiperOrigin-RevId: 297188590\n\n80b2d25f8d43d9d47024ff06ead7f7166548a7ba\nDialogflow weekly v2/v2beta1 library update:\n - updates to mega agent api\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297187629\n\n0b1876b35e98f560f9c9ca9797955f020238a092\nUse an older version of protoc-docs-plugin that is compatible with the specified gapic-generator and protobuf versions.\n\nprotoc-docs-plugin >=0.4.0 (see commit https://github.com/googleapis/protoc-docs-plugin/commit/979f03ede6678c487337f3d7e88bae58df5207af) is incompatible with protobuf 3.9.1.\n\nPiperOrigin-RevId: 296986742\n\n1e47e676cddbbd8d93f19ba0665af15b5532417e\nFix: Restore a method signature for UpdateCluster\n\nPiperOrigin-RevId: 296901854\n\n" + "sha": "365c029b8cdb63f7751b92ab490f1976e616105c", + "internalRef": "300038469", + "log": "365c029b8cdb63f7751b92ab490f1976e616105c\nAdd CC targets to the kms protos.\n\nThese are needed by go/tink.\n\nPiperOrigin-RevId: 300038469\n\n4ba9aa8a4a1413b88dca5a8fa931824ee9c284e6\nExpose logo recognition API proto for GA.\n\nPiperOrigin-RevId: 299971671\n\n1c9fc2c9e03dadf15f16b1c4f570955bdcebe00e\nAdding ruby_package option to accessapproval.proto for the Ruby client libraries generation.\n\nPiperOrigin-RevId: 299955924\n\n1cc6f0a7bfb147e6f2ede911d9b01e7a9923b719\nbuild(google/maps/routes): generate api clients\n\nPiperOrigin-RevId: 299955905\n\n29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\nf0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n244ab2b83a82076a1fa7be63b7e0671af73f5c02\nAdds service config definition for bigqueryreservation v1\n\nPiperOrigin-RevId: 298455048\n\n83c6f84035ee0f80eaa44d8b688a010461cc4080\nUpdate google/api/auth.proto to make AuthProvider to have JwtLocation\n\nPiperOrigin-RevId: 297918498\n\ne9e90a787703ec5d388902e2cb796aaed3a385b4\nDialogflow weekly v2/v2beta1 library update:\n - adding get validation result\n - adding field mask override control for output audio config\nImportant updates are also posted at:\nhttps://cloud.google.com/dialogflow/docs/release-notes\n\nPiperOrigin-RevId: 297671458\n\n1a2b05cc3541a5f7714529c665aecc3ea042c646\nAdding .yaml and .json config files.\n\nPiperOrigin-RevId: 297570622\n\ndfe1cf7be44dee31d78f78e485d8c95430981d6e\nPublish `QueryOptions` proto.\n\nIntroduced a `query_options` input in `ExecuteSqlRequest`.\n\nPiperOrigin-RevId: 297497710\n\ndafc905f71e5d46f500b41ed715aad585be062c3\npubsub: revert pull init_rpc_timeout & max_rpc_timeout back to 25 seconds and reset multiplier to 1.0\n\nPiperOrigin-RevId: 297486523\n\nf077632ba7fee588922d9e8717ee272039be126d\nfirestore: add update_transform\n\nPiperOrigin-RevId: 297405063\n\n" } }, { diff --git a/tests/unit/gapic/v1/test_security_center_client_v1.py b/tests/unit/gapic/v1/test_security_center_client_v1.py index 142d3508..dbecf0c9 100644 --- a/tests/unit/gapic/v1/test_security_center_client_v1.py +++ b/tests/unit/gapic/v1/test_security_center_client_v1.py @@ -24,6 +24,7 @@ from google.cloud import securitycenter_v1 from google.cloud.securitycenter_v1 import enums from google.cloud.securitycenter_v1.proto import finding_pb2 +from google.cloud.securitycenter_v1.proto import notification_config_pb2 from google.cloud.securitycenter_v1.proto import organization_settings_pb2 from google.cloud.securitycenter_v1.proto import run_asset_discovery_response_pb2 from google.cloud.securitycenter_v1.proto import security_marks_pb2 @@ -32,6 +33,7 @@ from google.iam.v1 import iam_policy_pb2 from google.iam.v1 import policy_pb2 from google.longrunning import operations_pb2 +from google.protobuf import empty_pb2 from google.protobuf import timestamp_pb2 @@ -364,6 +366,153 @@ def test_create_finding_exception(self): with pytest.raises(CustomException): client.create_finding(parent, finding_id, finding) + def test_create_notification_config(self): + # Setup Expected Response + name = "name3373707" + description = "description-1724546052" + pubsub_topic = "pubsubTopic-338126829" + service_account = "serviceAccount-1948028253" + expected_response = { + "name": name, + "description": description, + "pubsub_topic": pubsub_topic, + "service_account": service_account, + } + expected_response = notification_config_pb2.NotificationConfig( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup Request + parent = client.organization_path("[ORGANIZATION]") + config_id = "configId-804450504" + notification_config = {} + + response = client.create_notification_config( + parent, config_id, notification_config + ) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = securitycenter_service_pb2.CreateNotificationConfigRequest( + parent=parent, config_id=config_id, notification_config=notification_config + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_notification_config_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup request + parent = client.organization_path("[ORGANIZATION]") + config_id = "configId-804450504" + notification_config = {} + + with pytest.raises(CustomException): + client.create_notification_config(parent, config_id, notification_config) + + def test_delete_notification_config(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup Request + name = client.notification_config_path( + "[ORGANIZATION]", "[NOTIFICATION_CONFIG]" + ) + + client.delete_notification_config(name) + + assert len(channel.requests) == 1 + expected_request = securitycenter_service_pb2.DeleteNotificationConfigRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_notification_config_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup request + name = client.notification_config_path( + "[ORGANIZATION]", "[NOTIFICATION_CONFIG]" + ) + + with pytest.raises(CustomException): + client.delete_notification_config(name) + + def test_get_notification_config(self): + # Setup Expected Response + name_2 = "name2-1052831874" + description = "description-1724546052" + pubsub_topic = "pubsubTopic-338126829" + service_account = "serviceAccount-1948028253" + expected_response = { + "name": name_2, + "description": description, + "pubsub_topic": pubsub_topic, + "service_account": service_account, + } + expected_response = notification_config_pb2.NotificationConfig( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup Request + name = client.notification_config_path( + "[ORGANIZATION]", "[NOTIFICATION_CONFIG]" + ) + + response = client.get_notification_config(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = securitycenter_service_pb2.GetNotificationConfigRequest( + name=name + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_notification_config_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup request + name = client.notification_config_path( + "[ORGANIZATION]", "[NOTIFICATION_CONFIG]" + ) + + with pytest.raises(CustomException): + client.get_notification_config(name) + def test_get_organization_settings(self): # Setup Expected Response name_2 = "name2-1052831874" @@ -554,6 +703,56 @@ def test_list_findings_exception(self): with pytest.raises(CustomException): list(paged_list_response) + def test_list_notification_configs(self): + # Setup Expected Response + next_page_token = "" + notification_configs_element = {} + notification_configs = [notification_configs_element] + expected_response = { + "next_page_token": next_page_token, + "notification_configs": notification_configs, + } + expected_response = securitycenter_service_pb2.ListNotificationConfigsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup Request + parent = client.organization_path("[ORGANIZATION]") + + paged_list_response = client.list_notification_configs(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.notification_configs[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = securitycenter_service_pb2.ListNotificationConfigsRequest( + parent=parent + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_notification_configs_exception(self): + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup request + parent = client.organization_path("[ORGANIZATION]") + + paged_list_response = client.list_notification_configs(parent) + with pytest.raises(CustomException): + list(paged_list_response) + def test_list_sources(self): # Setup Expected Response next_page_token = "" @@ -800,6 +999,56 @@ def test_update_finding_exception(self): with pytest.raises(CustomException): client.update_finding(finding) + def test_update_notification_config(self): + # Setup Expected Response + name = "name3373707" + description = "description-1724546052" + pubsub_topic = "pubsubTopic-338126829" + service_account = "serviceAccount-1948028253" + expected_response = { + "name": name, + "description": description, + "pubsub_topic": pubsub_topic, + "service_account": service_account, + } + expected_response = notification_config_pb2.NotificationConfig( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup Request + notification_config = {} + + response = client.update_notification_config(notification_config) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = securitycenter_service_pb2.UpdateNotificationConfigRequest( + notification_config=notification_config + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_notification_config_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = securitycenter_v1.SecurityCenterClient() + + # Setup request + notification_config = {} + + with pytest.raises(CustomException): + client.update_notification_config(notification_config) + def test_update_organization_settings(self): # Setup Expected Response name = "name3373707"