Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/securitycenter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -119,6 +120,7 @@
"Contact",
"ContactDetails",
"Container",
"Database",
"ExfilResource",
"Exfiltration",
"ExternalSystem",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/securitycenter_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -107,6 +108,7 @@
"CreateSourceRequest",
"Cve",
"Cvssv3",
"Database",
"DeleteBigQueryExportRequest",
"DeleteMuteConfigRequest",
"DeleteNotificationConfigRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
compliance,
connection,
container,
database,
exfiltration,
)
from google.cloud.securitycenter_v1.types import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
compliance,
connection,
container,
database,
exfiltration,
)
from google.cloud.securitycenter_v1.types import (
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/securitycenter_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -96,6 +97,7 @@
"Contact",
"ContactDetails",
"Container",
"Database",
"ExfilResource",
"Exfiltration",
"ExternalSystem",
Expand Down
78 changes: 78 additions & 0 deletions google/cloud/securitycenter_v1/types/database.py
Original file line number Diff line number Diff line change
@@ -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))
8 changes: 8 additions & 0 deletions google/cloud/securitycenter_v1/types/finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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))
1 change: 1 addition & 0 deletions tests/unit/gapic/securitycenter_v1/test_security_center.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
connection,
contact_details,
container,
database,
exfiltration,
)
from google.cloud.securitycenter_v1.types import (
Expand Down