diff --git a/google/cloud/securitycenter/__init__.py b/google/cloud/securitycenter/__init__.py index 96c9c171..19e00b6f 100644 --- a/google/cloud/securitycenter/__init__.py +++ b/google/cloud/securitycenter/__init__.py @@ -27,6 +27,7 @@ from google.cloud.securitycenter_v1.types.connection import Connection from google.cloud.securitycenter_v1.types.contact_details import Contact, ContactDetails from google.cloud.securitycenter_v1.types.container import Container +from google.cloud.securitycenter_v1.types.database import Database from google.cloud.securitycenter_v1.types.exfiltration import ( ExfilResource, Exfiltration, @@ -119,6 +120,7 @@ "Contact", "ContactDetails", "Container", + "Database", "ExfilResource", "Exfiltration", "ExternalSystem", diff --git a/google/cloud/securitycenter_v1/__init__.py b/google/cloud/securitycenter_v1/__init__.py index 5ace4aff..0cd6d637 100644 --- a/google/cloud/securitycenter_v1/__init__.py +++ b/google/cloud/securitycenter_v1/__init__.py @@ -22,6 +22,7 @@ from .types.connection import Connection from .types.contact_details import Contact, ContactDetails from .types.container import Container +from .types.database import Database from .types.exfiltration import ExfilResource, Exfiltration from .types.external_system import ExternalSystem from .types.file import File @@ -107,6 +108,7 @@ "CreateSourceRequest", "Cve", "Cvssv3", + "Database", "DeleteBigQueryExportRequest", "DeleteMuteConfigRequest", "DeleteNotificationConfigRequest", diff --git a/google/cloud/securitycenter_v1/services/security_center/async_client.py b/google/cloud/securitycenter_v1/services/security_center/async_client.py index f435de24..f32dfc6a 100644 --- a/google/cloud/securitycenter_v1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1/services/security_center/async_client.py @@ -46,6 +46,7 @@ compliance, connection, container, + database, exfiltration, ) from google.cloud.securitycenter_v1.types import ( diff --git a/google/cloud/securitycenter_v1/services/security_center/client.py b/google/cloud/securitycenter_v1/services/security_center/client.py index 9e8575b7..3842aae0 100644 --- a/google/cloud/securitycenter_v1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1/services/security_center/client.py @@ -49,6 +49,7 @@ compliance, connection, container, + database, exfiltration, ) from google.cloud.securitycenter_v1.types import ( diff --git a/google/cloud/securitycenter_v1/types/__init__.py b/google/cloud/securitycenter_v1/types/__init__.py index 4cf851e8..3a599b9b 100644 --- a/google/cloud/securitycenter_v1/types/__init__.py +++ b/google/cloud/securitycenter_v1/types/__init__.py @@ -20,6 +20,7 @@ from .connection import Connection from .contact_details import Contact, ContactDetails from .container import Container +from .database import Database from .exfiltration import ExfilResource, Exfiltration from .external_system import ExternalSystem from .file import File @@ -96,6 +97,7 @@ "Contact", "ContactDetails", "Container", + "Database", "ExfilResource", "Exfiltration", "ExternalSystem", diff --git a/google/cloud/securitycenter_v1/types/database.py b/google/cloud/securitycenter_v1/types/database.py new file mode 100644 index 00000000..dd1b825a --- /dev/null +++ b/google/cloud/securitycenter_v1/types/database.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import proto # type: ignore + +__protobuf__ = proto.module( + package="google.cloud.securitycenter.v1", + manifest={ + "Database", + }, +) + + +class Database(proto.Message): + r"""Represents database access information, such as queries. + A database may be a sub-resource of an instance (as in the case + of CloudSQL instances or Cloud Spanner instances), or the + database instance itself. Some database resources may not have + the full resource name populated because these resource types + are not yet supported by Cloud Asset Inventory (e.g. CloudSQL + databases). In these cases only the display name will be + provided. + + Attributes: + name (str): + The full resource name of the database the + user connected to, if it is supported by CAI. + (https://google.aip.dev/122#full-resource-names) + display_name (str): + The human readable name of the database the + user connected to. + user_name (str): + The username used to connect to the DB. This + may not necessarily be an IAM principal, and has + no required format. + query (str): + The SQL statement associated with the + relevant access. + grantees (Sequence[str]): + The target usernames/roles/groups of a SQL + privilege grant (not an IAM policy change). + """ + + name = proto.Field( + proto.STRING, + number=1, + ) + display_name = proto.Field( + proto.STRING, + number=2, + ) + user_name = proto.Field( + proto.STRING, + number=3, + ) + query = proto.Field( + proto.STRING, + number=4, + ) + grantees = proto.RepeatedField( + proto.STRING, + number=5, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/securitycenter_v1/types/finding.py b/google/cloud/securitycenter_v1/types/finding.py index 47939de9..092d74d3 100644 --- a/google/cloud/securitycenter_v1/types/finding.py +++ b/google/cloud/securitycenter_v1/types/finding.py @@ -28,6 +28,7 @@ from google.cloud.securitycenter_v1.types import security_marks as gcs_security_marks from google.cloud.securitycenter_v1.types import vulnerability as gcs_vulnerability from google.cloud.securitycenter_v1.types import access as gcs_access +from google.cloud.securitycenter_v1.types import database as gcs_database from google.cloud.securitycenter_v1.types import external_system, iam_binding from google.cloud.securitycenter_v1.types import indicator as gcs_indicator from google.cloud.securitycenter_v1.types import kubernetes as gcs_kubernetes @@ -201,6 +202,8 @@ class Finding(proto.Message): kubernetes (google.cloud.securitycenter_v1.types.Kubernetes): Kubernetes resources associated with the finding. + database (google.cloud.securitycenter_v1.types.Database): + Database associated with the finding. """ class State(proto.Enum): @@ -382,6 +385,11 @@ class FindingClass(proto.Enum): number=43, message=gcs_kubernetes.Kubernetes, ) + database = proto.Field( + proto.MESSAGE, + number=44, + message=gcs_database.Database, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/tests/unit/gapic/securitycenter_v1/test_security_center.py b/tests/unit/gapic/securitycenter_v1/test_security_center.py index fe8e0da6..c3d1879e 100644 --- a/tests/unit/gapic/securitycenter_v1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1/test_security_center.py @@ -67,6 +67,7 @@ connection, contact_details, container, + database, exfiltration, ) from google.cloud.securitycenter_v1.types import (