Skip to content

Commit ec1301e

Browse files
feat: [google-cloud-securitycenter] Add Notebook field to finding's list of attributes (googleapis#12523)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 619663717 Source-Link: googleapis/googleapis@038629f Source-Link: https://github.com/googleapis/googleapis-gen/commit/90ac380358c55e6d6521d4779128316994263e0d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiI5MGFjMzgwMzU4YzU1ZTZkNjUyMWQ0Nzc5MTI4MzE2OTk0MjYzZTBkIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 324e356 commit ec1301e

8 files changed

Lines changed: 99 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
from google.cloud.securitycenter_v1.types.log_entry import CloudLoggingEntry, LogEntry
6565
from google.cloud.securitycenter_v1.types.mitre_attack import MitreAttack
6666
from google.cloud.securitycenter_v1.types.mute_config import MuteConfig
67+
from google.cloud.securitycenter_v1.types.notebook import Notebook
6768
from google.cloud.securitycenter_v1.types.notification_config import NotificationConfig
6869
from google.cloud.securitycenter_v1.types.notification_message import (
6970
NotificationMessage,
@@ -188,6 +189,7 @@
188189
"LogEntry",
189190
"MitreAttack",
190191
"MuteConfig",
192+
"Notebook",
191193
"NotificationConfig",
192194
"NotificationMessage",
193195
"OrgPolicy",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from .types.log_entry import CloudLoggingEntry, LogEntry
4949
from .types.mitre_attack import MitreAttack
5050
from .types.mute_config import MuteConfig
51+
from .types.notebook import Notebook
5152
from .types.notification_config import NotificationConfig
5253
from .types.notification_message import NotificationMessage
5354
from .types.org_policy import OrgPolicy
@@ -208,6 +209,7 @@
208209
"LogEntry",
209210
"MitreAttack",
210211
"MuteConfig",
212+
"Notebook",
211213
"NotificationConfig",
212214
"NotificationMessage",
213215
"OrgPolicy",

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
@@ -102,6 +102,7 @@
102102
from google.cloud.securitycenter_v1.types import finding as gcs_finding
103103
from google.cloud.securitycenter_v1.types import mute_config
104104
from google.cloud.securitycenter_v1.types import mute_config as gcs_mute_config
105+
from google.cloud.securitycenter_v1.types import notebook
105106
from google.cloud.securitycenter_v1.types import notification_config
106107
from google.cloud.securitycenter_v1.types import org_policy
107108
from google.cloud.securitycenter_v1.types import organization_settings

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
@@ -106,6 +106,7 @@
106106
from google.cloud.securitycenter_v1.types import finding as gcs_finding
107107
from google.cloud.securitycenter_v1.types import mute_config
108108
from google.cloud.securitycenter_v1.types import mute_config as gcs_mute_config
109+
from google.cloud.securitycenter_v1.types import notebook
109110
from google.cloud.securitycenter_v1.types import notification_config
110111
from google.cloud.securitycenter_v1.types import org_policy
111112
from google.cloud.securitycenter_v1.types import organization_settings

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
@@ -42,6 +42,7 @@
4242
from .log_entry import CloudLoggingEntry, LogEntry
4343
from .mitre_attack import MitreAttack
4444
from .mute_config import MuteConfig
45+
from .notebook import Notebook
4546
from .notification_config import NotificationConfig
4647
from .notification_message import NotificationMessage
4748
from .org_policy import OrgPolicy
@@ -154,6 +155,7 @@
154155
"LogEntry",
155156
"MitreAttack",
156157
"MuteConfig",
158+
"Notebook",
157159
"NotificationConfig",
158160
"NotificationMessage",
159161
"OrgPolicy",

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
from google.cloud.securitycenter_v1.types import indicator as gcs_indicator
5252
from google.cloud.securitycenter_v1.types import kubernetes as gcs_kubernetes
5353
from google.cloud.securitycenter_v1.types import load_balancer, log_entry
54+
from google.cloud.securitycenter_v1.types import notebook as gcs_notebook
5455
from google.cloud.securitycenter_v1.types import org_policy, process
5556

5657
__protobuf__ = proto.module(
@@ -262,6 +263,8 @@ class Finding(proto.Message):
262263
load_balancers (MutableSequence[google.cloud.securitycenter_v1.types.LoadBalancer]):
263264
The load balancers associated with the
264265
finding.
266+
notebook (google.cloud.securitycenter_v1.types.Notebook):
267+
Notebook associated with the finding.
265268
"""
266269

267270
class State(proto.Enum):
@@ -640,6 +643,11 @@ class FindingClass(proto.Enum):
640643
number=58,
641644
message=load_balancer.LoadBalancer,
642645
)
646+
notebook: gcs_notebook.Notebook = proto.Field(
647+
proto.MESSAGE,
648+
number=63,
649+
message=gcs_notebook.Notebook,
650+
)
643651

644652

645653
__all__ = tuple(sorted(__protobuf__.manifest))
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2024 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+
"Notebook",
27+
},
28+
)
29+
30+
31+
class Notebook(proto.Message):
32+
r"""Represents a Jupyter notebook IPYNB file, such as a `Colab
33+
Enterprise
34+
notebook <https://cloud.google.com/colab/docs/introduction>`__ file,
35+
that is associated with a finding.
36+
37+
Attributes:
38+
name (str):
39+
The name of the notebook.
40+
service (str):
41+
The source notebook service, for example,
42+
"Colab Enterprise".
43+
last_author (str):
44+
The user ID of the latest author to modify
45+
the notebook.
46+
notebook_update_time (google.protobuf.timestamp_pb2.Timestamp):
47+
The most recent time the notebook was
48+
updated.
49+
"""
50+
51+
name: str = proto.Field(
52+
proto.STRING,
53+
number=1,
54+
)
55+
service: str = proto.Field(
56+
proto.STRING,
57+
number=2,
58+
)
59+
last_author: str = proto.Field(
60+
proto.STRING,
61+
number=3,
62+
)
63+
notebook_update_time: timestamp_pb2.Timestamp = proto.Field(
64+
proto.MESSAGE,
65+
number=4,
66+
message=timestamp_pb2.Timestamp,
67+
)
68+
69+
70+
__all__ = tuple(sorted(__protobuf__.manifest))

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
from google.cloud.securitycenter_v1.types import finding as gcs_finding
120120
from google.cloud.securitycenter_v1.types import mute_config
121121
from google.cloud.securitycenter_v1.types import mute_config as gcs_mute_config
122+
from google.cloud.securitycenter_v1.types import notebook
122123
from google.cloud.securitycenter_v1.types import notification_config
123124
from google.cloud.securitycenter_v1.types import org_policy
124125
from google.cloud.securitycenter_v1.types import organization_settings
@@ -19024,6 +19025,12 @@ def test_create_finding_rest(request_type):
1902419025
}
1902519026
],
1902619027
"load_balancers": [{"name": "name_value"}],
19028+
"notebook": {
19029+
"name": "name_value",
19030+
"service": "service_value",
19031+
"last_author": "last_author_value",
19032+
"notebook_update_time": {},
19033+
},
1902719034
}
1902819035
# The version of a generated dependency at test runtime may differ from the version used during generation.
1902919036
# Delete any fields which are not present in the current runtime dependency
@@ -29017,6 +29024,12 @@ def test_update_finding_rest(request_type):
2901729024
}
2901829025
],
2901929026
"load_balancers": [{"name": "name_value"}],
29027+
"notebook": {
29028+
"name": "name_value",
29029+
"service": "service_value",
29030+
"last_author": "last_author_value",
29031+
"notebook_update_time": {},
29032+
},
2902029033
}
2902129034
# The version of a generated dependency at test runtime may differ from the version used during generation.
2902229035
# Delete any fields which are not present in the current runtime dependency

0 commit comments

Comments
 (0)