Skip to content

Commit c704e63

Browse files
feat: [google-cloud-securitycenter] Add cloud_armor field to finding's list of attributes (#12586)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 625555619 Source-Link: googleapis/googleapis@42c6f00 Source-Link: googleapis/googleapis-gen@113f042 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5Y2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiIxMTNmMDQyZDExNmY0Mzg4NDM0ZGUwZTdkNDExNmJkODllZjc2OWMzIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 7e97037 commit c704e63

17 files changed

Lines changed: 313 additions & 9 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
BackupDisasterRecovery,
3636
)
3737
from google.cloud.securitycenter_v1.types.bigquery_export import BigQueryExport
38+
from google.cloud.securitycenter_v1.types.cloud_armor import (
39+
AdaptiveProtection,
40+
Attack,
41+
CloudArmor,
42+
Requests,
43+
SecurityPolicy,
44+
)
3845
from google.cloud.securitycenter_v1.types.cloud_dlp_data_profile import (
3946
CloudDlpDataProfile,
4047
)
@@ -164,6 +171,11 @@
164171
"Asset",
165172
"BackupDisasterRecovery",
166173
"BigQueryExport",
174+
"AdaptiveProtection",
175+
"Attack",
176+
"CloudArmor",
177+
"Requests",
178+
"SecurityPolicy",
167179
"CloudDlpDataProfile",
168180
"CloudDlpInspection",
169181
"Compliance",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.30.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
from .types.asset import Asset
2525
from .types.backup_disaster_recovery import BackupDisasterRecovery
2626
from .types.bigquery_export import BigQueryExport
27+
from .types.cloud_armor import (
28+
AdaptiveProtection,
29+
Attack,
30+
CloudArmor,
31+
Requests,
32+
SecurityPolicy,
33+
)
2734
from .types.cloud_dlp_data_profile import CloudDlpDataProfile
2835
from .types.cloud_dlp_inspection import CloudDlpInspection
2936
from .types.compliance import Compliance
@@ -133,12 +140,15 @@
133140
__all__ = (
134141
"SecurityCenterAsyncClient",
135142
"Access",
143+
"AdaptiveProtection",
136144
"Application",
137145
"Asset",
146+
"Attack",
138147
"BackupDisasterRecovery",
139148
"BigQueryExport",
140149
"BulkMuteFindingsRequest",
141150
"BulkMuteFindingsResponse",
151+
"CloudArmor",
142152
"CloudDlpDataProfile",
143153
"CloudDlpInspection",
144154
"CloudLoggingEntry",
@@ -217,13 +227,15 @@
217227
"Package",
218228
"Process",
219229
"Reference",
230+
"Requests",
220231
"Resource",
221232
"RunAssetDiscoveryRequest",
222233
"RunAssetDiscoveryResponse",
223234
"SecurityBulletin",
224235
"SecurityCenterClient",
225236
"SecurityHealthAnalyticsCustomModule",
226237
"SecurityMarks",
238+
"SecurityPolicy",
227239
"SecurityPosture",
228240
"ServiceAccountDelegationInfo",
229241
"SetFindingStateRequest",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.30.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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
@@ -58,6 +58,7 @@
5858
application,
5959
backup_disaster_recovery,
6060
bigquery_export,
61+
cloud_armor,
6162
cloud_dlp_data_profile,
6263
cloud_dlp_inspection,
6364
compliance,

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
@@ -62,6 +62,7 @@
6262
application,
6363
backup_disaster_recovery,
6464
bigquery_export,
65+
cloud_armor,
6566
cloud_dlp_data_profile,
6667
cloud_dlp_inspection,
6768
compliance,

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
from .asset import Asset
1919
from .backup_disaster_recovery import BackupDisasterRecovery
2020
from .bigquery_export import BigQueryExport
21+
from .cloud_armor import (
22+
AdaptiveProtection,
23+
Attack,
24+
CloudArmor,
25+
Requests,
26+
SecurityPolicy,
27+
)
2128
from .cloud_dlp_data_profile import CloudDlpDataProfile
2229
from .cloud_dlp_inspection import CloudDlpInspection
2330
from .compliance import Compliance
@@ -130,6 +137,11 @@
130137
"Asset",
131138
"BackupDisasterRecovery",
132139
"BigQueryExport",
140+
"AdaptiveProtection",
141+
"Attack",
142+
"CloudArmor",
143+
"Requests",
144+
"SecurityPolicy",
133145
"CloudDlpDataProfile",
134146
"CloudDlpInspection",
135147
"Compliance",
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
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 duration_pb2 # type: ignore
21+
import proto # type: ignore
22+
23+
__protobuf__ = proto.module(
24+
package="google.cloud.securitycenter.v1",
25+
manifest={
26+
"CloudArmor",
27+
"SecurityPolicy",
28+
"Requests",
29+
"AdaptiveProtection",
30+
"Attack",
31+
},
32+
)
33+
34+
35+
class CloudArmor(proto.Message):
36+
r"""Fields related to Google Cloud Armor findings.
37+
38+
Attributes:
39+
security_policy (google.cloud.securitycenter_v1.types.SecurityPolicy):
40+
Information about the `Google Cloud Armor security
41+
policy <https://cloud.google.com/armor/docs/security-policy-overview>`__
42+
relevant to the finding.
43+
requests (google.cloud.securitycenter_v1.types.Requests):
44+
Information about incoming requests evaluated by `Google
45+
Cloud Armor security
46+
policies <https://cloud.google.com/armor/docs/security-policy-overview>`__.
47+
adaptive_protection (google.cloud.securitycenter_v1.types.AdaptiveProtection):
48+
Information about potential Layer 7 DDoS attacks identified
49+
by `Google Cloud Armor Adaptive
50+
Protection <https://cloud.google.com/armor/docs/adaptive-protection-overview>`__.
51+
attack (google.cloud.securitycenter_v1.types.Attack):
52+
Information about DDoS attack volume and
53+
classification.
54+
threat_vector (str):
55+
Distinguish between volumetric & protocol DDoS attack and
56+
application layer attacks. For example, “L3_4” for Layer 3
57+
and Layer 4 DDoS attacks, or “L_7” for Layer 7 DDoS attacks.
58+
duration (google.protobuf.duration_pb2.Duration):
59+
Duration of attack from the start until the
60+
current moment (updated every 5 minutes).
61+
"""
62+
63+
security_policy: "SecurityPolicy" = proto.Field(
64+
proto.MESSAGE,
65+
number=1,
66+
message="SecurityPolicy",
67+
)
68+
requests: "Requests" = proto.Field(
69+
proto.MESSAGE,
70+
number=2,
71+
message="Requests",
72+
)
73+
adaptive_protection: "AdaptiveProtection" = proto.Field(
74+
proto.MESSAGE,
75+
number=3,
76+
message="AdaptiveProtection",
77+
)
78+
attack: "Attack" = proto.Field(
79+
proto.MESSAGE,
80+
number=4,
81+
message="Attack",
82+
)
83+
threat_vector: str = proto.Field(
84+
proto.STRING,
85+
number=5,
86+
)
87+
duration: duration_pb2.Duration = proto.Field(
88+
proto.MESSAGE,
89+
number=6,
90+
message=duration_pb2.Duration,
91+
)
92+
93+
94+
class SecurityPolicy(proto.Message):
95+
r"""Information about the `Google Cloud Armor security
96+
policy <https://cloud.google.com/armor/docs/security-policy-overview>`__
97+
relevant to the finding.
98+
99+
Attributes:
100+
name (str):
101+
The name of the Google Cloud Armor security
102+
policy, for example, "my-security-policy".
103+
type_ (str):
104+
The type of Google Cloud Armor security
105+
policy for example, ‘backend security policy’,
106+
‘edge security policy’, ‘network edge security
107+
policy’, or ‘always-on DDoS protection’.
108+
preview (bool):
109+
Whether or not the associated rule or policy
110+
is in preview mode.
111+
"""
112+
113+
name: str = proto.Field(
114+
proto.STRING,
115+
number=1,
116+
)
117+
type_: str = proto.Field(
118+
proto.STRING,
119+
number=2,
120+
)
121+
preview: bool = proto.Field(
122+
proto.BOOL,
123+
number=3,
124+
)
125+
126+
127+
class Requests(proto.Message):
128+
r"""Information about the requests relevant to the finding.
129+
130+
Attributes:
131+
ratio (float):
132+
For 'Increasing deny ratio', the ratio is the
133+
denied traffic divided by the allowed traffic.
134+
For 'Allowed traffic spike', the ratio is the
135+
allowed traffic in the short term divided by
136+
allowed traffic in the long term.
137+
short_term_allowed (int):
138+
Allowed RPS (requests per second) in the
139+
short term.
140+
long_term_allowed (int):
141+
Allowed RPS (requests per second) over the
142+
long term.
143+
long_term_denied (int):
144+
Denied RPS (requests per second) over the
145+
long term.
146+
"""
147+
148+
ratio: float = proto.Field(
149+
proto.DOUBLE,
150+
number=1,
151+
)
152+
short_term_allowed: int = proto.Field(
153+
proto.INT32,
154+
number=2,
155+
)
156+
long_term_allowed: int = proto.Field(
157+
proto.INT32,
158+
number=3,
159+
)
160+
long_term_denied: int = proto.Field(
161+
proto.INT32,
162+
number=4,
163+
)
164+
165+
166+
class AdaptiveProtection(proto.Message):
167+
r"""Information about `Google Cloud Armor Adaptive
168+
Protection <https://cloud.google.com/armor/docs/cloud-armor-overview#google-cloud-armor-adaptive-protection>`__.
169+
170+
Attributes:
171+
confidence (float):
172+
A score of 0 means that there is low confidence that the
173+
detected event is an actual attack. A score of 1 means that
174+
there is high confidence that the detected event is an
175+
attack. See the `Adaptive Protection
176+
documentation <https://cloud.google.com/armor/docs/adaptive-protection-overview#configure-alert-tuning>`__
177+
for further explanation.
178+
"""
179+
180+
confidence: float = proto.Field(
181+
proto.DOUBLE,
182+
number=1,
183+
)
184+
185+
186+
class Attack(proto.Message):
187+
r"""Information about DDoS attack volume and classification.
188+
189+
Attributes:
190+
volume_pps (int):
191+
Total PPS (packets per second) volume of
192+
attack.
193+
volume_bps (int):
194+
Total BPS (bytes per second) volume of
195+
attack.
196+
classification (str):
197+
Type of attack, for example, ‘SYN-flood’,
198+
‘NTP-udp’, or ‘CHARGEN-udp’.
199+
"""
200+
201+
volume_pps: int = proto.Field(
202+
proto.INT32,
203+
number=1,
204+
)
205+
volume_bps: int = proto.Field(
206+
proto.INT32,
207+
number=2,
208+
)
209+
classification: str = proto.Field(
210+
proto.STRING,
211+
number=3,
212+
)
213+
214+
215+
__all__ = tuple(sorted(__protobuf__.manifest))

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
@@ -47,6 +47,7 @@
4747
from google.cloud.securitycenter_v1.types import vulnerability as gcs_vulnerability
4848
from google.cloud.securitycenter_v1.types import access as gcs_access
4949
from google.cloud.securitycenter_v1.types import application as gcs_application
50+
from google.cloud.securitycenter_v1.types import cloud_armor as gcs_cloud_armor
5051
from google.cloud.securitycenter_v1.types import database as gcs_database
5152
from google.cloud.securitycenter_v1.types import indicator as gcs_indicator
5253
from google.cloud.securitycenter_v1.types import kubernetes as gcs_kubernetes
@@ -263,6 +264,8 @@ class Finding(proto.Message):
263264
load_balancers (MutableSequence[google.cloud.securitycenter_v1.types.LoadBalancer]):
264265
The load balancers associated with the
265266
finding.
267+
cloud_armor (google.cloud.securitycenter_v1.types.CloudArmor):
268+
Fields related to Cloud Armor findings.
266269
notebook (google.cloud.securitycenter_v1.types.Notebook):
267270
Notebook associated with the finding.
268271
"""
@@ -643,6 +646,11 @@ class FindingClass(proto.Enum):
643646
number=58,
644647
message=load_balancer.LoadBalancer,
645648
)
649+
cloud_armor: gcs_cloud_armor.CloudArmor = proto.Field(
650+
proto.MESSAGE,
651+
number=59,
652+
message=gcs_cloud_armor.CloudArmor,
653+
)
646654
notebook: gcs_notebook.Notebook = proto.Field(
647655
proto.MESSAGE,
648656
number=63,

packages/google-cloud-securitycenter/google/cloud/securitycenter_v1beta1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.30.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

0 commit comments

Comments
 (0)