Skip to content

Commit 0f7d3f3

Browse files
feat: [google-cloud-securitycenter] Add Backup DR field to finding's list of attributes (googleapis#12355)
BEGIN_COMMIT_OVERRIDE feat: Add Backup DR field to finding's list of attributes END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 609040971 Source-Link: googleapis/googleapis@698ad3d Source-Link: https://github.com/googleapis/googleapis-gen/commit/d1aef2406369b70e555cc0a99e6e783ab5e898dc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiJkMWFlZjI0MDYzNjliNzBlNTU1Y2MwYTk5ZTZlNzgzYWI1ZTg5OGRjIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent b76625a commit 0f7d3f3

8 files changed

Lines changed: 182 additions & 0 deletions

File tree

packages/google-cloud-securitycenter/google/cloud/securitycenter/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
)
3232
from google.cloud.securitycenter_v1.types.application import Application
3333
from google.cloud.securitycenter_v1.types.asset import Asset
34+
from google.cloud.securitycenter_v1.types.backup_disaster_recovery import (
35+
BackupDisasterRecovery,
36+
)
3437
from google.cloud.securitycenter_v1.types.bigquery_export import BigQueryExport
3538
from google.cloud.securitycenter_v1.types.cloud_dlp_data_profile import (
3639
CloudDlpDataProfile,
@@ -152,6 +155,7 @@
152155
"ServiceAccountDelegationInfo",
153156
"Application",
154157
"Asset",
158+
"BackupDisasterRecovery",
155159
"BigQueryExport",
156160
"CloudDlpDataProfile",
157161
"CloudDlpInspection",

packages/google-cloud-securitycenter/google/cloud/securitycenter_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .types.access import Access, Geolocation, ServiceAccountDelegationInfo
2323
from .types.application import Application
2424
from .types.asset import Asset
25+
from .types.backup_disaster_recovery import BackupDisasterRecovery
2526
from .types.bigquery_export import BigQueryExport
2627
from .types.cloud_dlp_data_profile import CloudDlpDataProfile
2728
from .types.cloud_dlp_inspection import CloudDlpInspection
@@ -122,6 +123,7 @@
122123
"Access",
123124
"Application",
124125
"Asset",
126+
"BackupDisasterRecovery",
125127
"BigQueryExport",
126128
"BulkMuteFindingsRequest",
127129
"BulkMuteFindingsResponse",

packages/google-cloud-securitycenter/google/cloud/securitycenter_v1/services/security_center/async_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
from google.cloud.securitycenter_v1.types import (
5757
access,
5858
application,
59+
backup_disaster_recovery,
5960
bigquery_export,
6061
cloud_dlp_data_profile,
6162
cloud_dlp_inspection,

packages/google-cloud-securitycenter/google/cloud/securitycenter_v1/services/security_center/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from google.cloud.securitycenter_v1.types import (
6161
access,
6262
application,
63+
backup_disaster_recovery,
6364
bigquery_export,
6465
cloud_dlp_data_profile,
6566
cloud_dlp_inspection,

packages/google-cloud-securitycenter/google/cloud/securitycenter_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .access import Access, Geolocation, ServiceAccountDelegationInfo
1717
from .application import Application
1818
from .asset import Asset
19+
from .backup_disaster_recovery import BackupDisasterRecovery
1920
from .bigquery_export import BigQueryExport
2021
from .cloud_dlp_data_profile import CloudDlpDataProfile
2122
from .cloud_dlp_inspection import CloudDlpInspection
@@ -115,6 +116,7 @@
115116
"ServiceAccountDelegationInfo",
116117
"Application",
117118
"Asset",
119+
"BackupDisasterRecovery",
118120
"BigQueryExport",
119121
"CloudDlpDataProfile",
120122
"CloudDlpInspection",
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2023 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from __future__ import annotations
17+
18+
from typing import MutableMapping, MutableSequence
19+
20+
from google.protobuf import timestamp_pb2 # type: ignore
21+
import proto # type: ignore
22+
23+
__protobuf__ = proto.module(
24+
package="google.cloud.securitycenter.v1",
25+
manifest={
26+
"BackupDisasterRecovery",
27+
},
28+
)
29+
30+
31+
class BackupDisasterRecovery(proto.Message):
32+
r"""Information related to Google Cloud Backup and DR Service
33+
findings.
34+
35+
Attributes:
36+
backup_template (str):
37+
The name of a Backup and DR template which comprises one or
38+
more backup policies. See the `Backup and DR
39+
documentation <https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#temp>`__
40+
for more information. For example, ``snap-ov``.
41+
policies (MutableSequence[str]):
42+
The names of Backup and DR policies that are associated with
43+
a template and that define when to run a backup, how
44+
frequently to run a backup, and how long to retain the
45+
backup image. For example, ``onvaults``.
46+
host (str):
47+
The name of a Backup and DR host, which is managed by the
48+
backup and recovery appliance and known to the management
49+
console. The host can be of type Generic (for example,
50+
Compute Engine, SQL Server, Oracle DB, SMB file system,
51+
etc.), vCenter, or an ESX server. See the `Backup and DR
52+
documentation on
53+
hosts <https://cloud.google.com/backup-disaster-recovery/docs/configuration/manage-hosts-and-their-applications>`__
54+
for more information. For example, ``centos7-01``.
55+
applications (MutableSequence[str]):
56+
The names of Backup and DR applications. An application is a
57+
VM, database, or file system on a managed host monitored by
58+
a backup and recovery appliance. For example,
59+
``centos7-01-vol00``, ``centos7-01-vol01``,
60+
``centos7-01-vol02``.
61+
storage_pool (str):
62+
The name of the Backup and DR storage pool that the backup
63+
and recovery appliance is storing data in. The storage pool
64+
could be of type Cloud, Primary, Snapshot, or OnVault. See
65+
the `Backup and DR documentation on storage
66+
pools <https://cloud.google.com/backup-disaster-recovery/docs/concepts/storage-pools>`__.
67+
For example, ``DiskPoolOne``.
68+
policy_options (MutableSequence[str]):
69+
The names of Backup and DR advanced policy options of a
70+
policy applying to an application. See the `Backup and DR
71+
documentation on policy
72+
options <https://cloud.google.com/backup-disaster-recovery/docs/create-plan/policy-settings>`__.
73+
For example, ``skipofflineappsincongrp, nounmap``.
74+
profile (str):
75+
The name of the Backup and DR resource profile that
76+
specifies the storage media for backups of application and
77+
VM data. See the `Backup and DR documentation on
78+
profiles <https://cloud.google.com/backup-disaster-recovery/docs/concepts/backup-plan#profile>`__.
79+
For example, ``GCP``.
80+
appliance (str):
81+
The name of the Backup and DR appliance that captures,
82+
moves, and manages the lifecycle of backup data. For
83+
example, ``backup-server-57137``.
84+
backup_type (str):
85+
The backup type of the Backup and DR image. For example,
86+
``Snapshot``, ``Remote Snapshot``, ``OnVault``.
87+
backup_create_time (google.protobuf.timestamp_pb2.Timestamp):
88+
The timestamp at which the Backup and DR
89+
backup was created.
90+
"""
91+
92+
backup_template: str = proto.Field(
93+
proto.STRING,
94+
number=1,
95+
)
96+
policies: MutableSequence[str] = proto.RepeatedField(
97+
proto.STRING,
98+
number=2,
99+
)
100+
host: str = proto.Field(
101+
proto.STRING,
102+
number=3,
103+
)
104+
applications: MutableSequence[str] = proto.RepeatedField(
105+
proto.STRING,
106+
number=4,
107+
)
108+
storage_pool: str = proto.Field(
109+
proto.STRING,
110+
number=5,
111+
)
112+
policy_options: MutableSequence[str] = proto.RepeatedField(
113+
proto.STRING,
114+
number=6,
115+
)
116+
profile: str = proto.Field(
117+
proto.STRING,
118+
number=7,
119+
)
120+
appliance: str = proto.Field(
121+
proto.STRING,
122+
number=8,
123+
)
124+
backup_type: str = proto.Field(
125+
proto.STRING,
126+
number=9,
127+
)
128+
backup_create_time: timestamp_pb2.Timestamp = proto.Field(
129+
proto.MESSAGE,
130+
number=10,
131+
message=timestamp_pb2.Timestamp,
132+
)
133+
134+
135+
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-securitycenter/google/cloud/securitycenter_v1/types/finding.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
container,
2929
)
3030
from google.cloud.securitycenter_v1.types import external_system, file, iam_binding
31+
from google.cloud.securitycenter_v1.types import (
32+
backup_disaster_recovery as gcs_backup_disaster_recovery,
33+
)
3134
from google.cloud.securitycenter_v1.types import (
3235
cloud_dlp_data_profile as gcs_cloud_dlp_data_profile,
3336
)
@@ -242,6 +245,8 @@ class Finding(proto.Message):
242245
application (google.cloud.securitycenter_v1.types.Application):
243246
Represents an application associated with the
244247
finding.
248+
backup_disaster_recovery (google.cloud.securitycenter_v1.types.BackupDisasterRecovery):
249+
Fields related to Backup and DR findings.
245250
"""
246251

247252
class State(proto.Enum):
@@ -589,6 +594,13 @@ class FindingClass(proto.Enum):
589594
number=53,
590595
message=gcs_application.Application,
591596
)
597+
backup_disaster_recovery: gcs_backup_disaster_recovery.BackupDisasterRecovery = (
598+
proto.Field(
599+
proto.MESSAGE,
600+
number=55,
601+
message=gcs_backup_disaster_recovery.BackupDisasterRecovery,
602+
)
603+
)
592604

593605

594606
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-cloud-securitycenter/tests/unit/gapic/securitycenter_v1/test_security_center.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
from google.cloud.securitycenter_v1.types import (
7171
access,
7272
application,
73+
backup_disaster_recovery,
7374
bigquery_export,
7475
cloud_dlp_data_profile,
7576
cloud_dlp_inspection,
@@ -16395,6 +16396,18 @@ def test_create_finding_rest(request_type):
1639516396
"unexpected_processes_in_runqueue": True,
1639616397
},
1639716398
"application": {"base_uri": "base_uri_value", "full_uri": "full_uri_value"},
16399+
"backup_disaster_recovery": {
16400+
"backup_template": "backup_template_value",
16401+
"policies": ["policies_value1", "policies_value2"],
16402+
"host": "host_value",
16403+
"applications": ["applications_value1", "applications_value2"],
16404+
"storage_pool": "storage_pool_value",
16405+
"policy_options": ["policy_options_value1", "policy_options_value2"],
16406+
"profile": "profile_value",
16407+
"appliance": "appliance_value",
16408+
"backup_type": "backup_type_value",
16409+
"backup_create_time": {},
16410+
},
1639816411
}
1639916412
# The version of a generated dependency at test runtime may differ from the version used during generation.
1640016413
# Delete any fields which are not present in the current runtime dependency
@@ -26298,6 +26311,18 @@ def test_update_finding_rest(request_type):
2629826311
"unexpected_processes_in_runqueue": True,
2629926312
},
2630026313
"application": {"base_uri": "base_uri_value", "full_uri": "full_uri_value"},
26314+
"backup_disaster_recovery": {
26315+
"backup_template": "backup_template_value",
26316+
"policies": ["policies_value1", "policies_value2"],
26317+
"host": "host_value",
26318+
"applications": ["applications_value1", "applications_value2"],
26319+
"storage_pool": "storage_pool_value",
26320+
"policy_options": ["policy_options_value1", "policy_options_value2"],
26321+
"profile": "profile_value",
26322+
"appliance": "appliance_value",
26323+
"backup_type": "backup_type_value",
26324+
"backup_create_time": {},
26325+
},
2630126326
}
2630226327
# The version of a generated dependency at test runtime may differ from the version used during generation.
2630326328
# Delete any fields which are not present in the current runtime dependency

0 commit comments

Comments
 (0)