Skip to content

Commit 9fba835

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add SOCIAL_ENGINEERING_EXTENDED_COVERAGE threat type
PiperOrigin-RevId: 481130618
1 parent 9700deb commit 9fba835

4 files changed

Lines changed: 126 additions & 51 deletions

File tree

google/cloud/webrisk/v1/BUILD.bazel

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -59,12 +68,15 @@ java_gapic_library(
5968
srcs = [":webrisk_proto_with_info"],
6069
gapic_yaml = "webrisk_gapic.yaml",
6170
grpc_service_config = "webrisk_grpc_service_config.json",
71+
rest_numeric_enums = False,
72+
service_yaml = "webrisk_v1.yaml",
6273
test_deps = [
6374
":webrisk_java_grpc",
6475
],
6576
transport = "grpc+rest",
6677
deps = [
6778
":webrisk_java_proto",
79+
"//google/api:api_java_proto",
6880
],
6981
)
7082

@@ -116,6 +128,8 @@ go_gapic_library(
116128
srcs = [":webrisk_proto_with_info"],
117129
grpc_service_config = "webrisk_grpc_service_config.json",
118130
importpath = "cloud.google.com/go/webrisk/apiv1;webrisk",
131+
metadata = True,
132+
rest_numeric_enums = False,
119133
service_yaml = "webrisk_v1.yaml",
120134
transport = "grpc+rest",
121135
deps = [
@@ -135,6 +149,7 @@ go_gapic_assembly_pkg(
135149
name = "gapi-cloud-webrisk-v1-go",
136150
deps = [
137151
":webrisk_go_gapic",
152+
":webrisk_go_gapic_srcjar-metadata.srcjar",
138153
":webrisk_go_gapic_srcjar-test.srcjar",
139154
":webrisk_go_proto",
140155
],
@@ -143,7 +158,6 @@ go_gapic_assembly_pkg(
143158
##############################################################################
144159
# Python
145160
##############################################################################
146-
147161
load(
148162
"@com_google_googleapis_imports//:imports.bzl",
149163
"py_gapic_assembly_pkg",
@@ -155,7 +169,11 @@ py_gapic_library(
155169
name = "webrisk_py_gapic",
156170
srcs = [":webrisk_proto"],
157171
grpc_service_config = "webrisk_grpc_service_config.json",
172+
rest_numeric_enums = False,
173+
service_yaml = "webrisk_v1.yaml",
158174
transport = "grpc",
175+
deps = [
176+
],
159177
)
160178

161179
py_test(
@@ -168,6 +186,7 @@ py_test(
168186
deps = [":webrisk_py_gapic"],
169187
)
170188

189+
# Open Source Packages
171190
py_gapic_assembly_pkg(
172191
name = "webrisk-v1-py",
173192
deps = [
@@ -201,6 +220,8 @@ php_gapic_library(
201220
name = "webrisk_php_gapic",
202221
srcs = [":webrisk_proto_with_info"],
203222
grpc_service_config = "webrisk_grpc_service_config.json",
223+
rest_numeric_enums = False,
224+
service_yaml = "webrisk_v1.yaml",
204225
deps = [
205226
":webrisk_php_grpc",
206227
":webrisk_php_proto",
@@ -233,6 +254,7 @@ nodejs_gapic_library(
233254
extra_protoc_parameters = ["metadata"],
234255
grpc_service_config = "webrisk_grpc_service_config.json",
235256
package = "google.cloud.webrisk.v1",
257+
rest_numeric_enums = False,
236258
service_yaml = "webrisk_v1.yaml",
237259
deps = [],
238260
)
@@ -271,15 +293,17 @@ ruby_cloud_gapic_library(
271293
name = "webrisk_ruby_gapic",
272294
srcs = [":webrisk_proto_with_info"],
273295
extra_protoc_parameters = [
274-
"ruby-cloud-gem-name=google-cloud-web_risk-v1",
275-
"ruby-cloud-env-prefix=WEBRISK",
276-
"ruby-cloud-product-url=https://cloud.google.com/web-risk",
277296
"ruby-cloud-api-id=webrisk.googleapis.com",
278297
"ruby-cloud-api-shortname=webrisk",
298+
"ruby-cloud-env-prefix=WEBRISK",
299+
"ruby-cloud-gem-name=google-cloud-web_risk-v1",
300+
"ruby-cloud-product-url=https://cloud.google.com/web-risk",
279301
],
280302
grpc_service_config = "webrisk_grpc_service_config.json",
303+
rest_numeric_enums = False,
281304
ruby_cloud_description = "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources.",
282305
ruby_cloud_title = "Web Risk V1",
306+
service_yaml = "webrisk_v1.yaml",
283307
deps = [
284308
":webrisk_ruby_grpc",
285309
":webrisk_ruby_proto",
@@ -323,6 +347,7 @@ csharp_gapic_library(
323347
srcs = [":webrisk_proto_with_info"],
324348
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
325349
grpc_service_config = "webrisk_grpc_service_config.json",
350+
rest_numeric_enums = False,
326351
service_yaml = "webrisk_v1.yaml",
327352
deps = [
328353
":webrisk_csharp_grpc",

google/cloud/webrisk/v1/webrisk.proto

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -79,7 +79,8 @@ service WebRiskService {
7979
// content, the site will be added to the [Google's Social Engineering
8080
// lists](https://support.google.com/webmasters/answer/6350487/) in order to
8181
// protect users that could get exposed to this threat in the future. Only
82-
// projects with CREATE_SUBMISSION_USERS visibility can use this method.
82+
// allowlisted projects can use this method during Early Access. Please reach
83+
// out to Sales or your customer engineer to obtain access.
8384
rpc CreateSubmission(CreateSubmissionRequest) returns (Submission) {
8485
option (google.api.http) = {
8586
post: "/v1/{parent=projects/*}/submissions"
@@ -107,7 +108,9 @@ message ComputeThreatListDiffRequest {
107108
repeated CompressionType supported_compressions = 3;
108109
}
109110

110-
// Required. The threat list to update. Only a single ThreatType should be specified.
111+
// Required. The threat list to update. Only a single ThreatType should be specified
112+
// per request. If you want to handle multiple ThreatTypes, you must make one
113+
// request per ThreatType.
111114
ThreatType threat_type = 1 [(google.api.field_behavior) = REQUIRED];
112115

113116
// The current version token of the client for the requested list (the
@@ -122,13 +125,6 @@ message ComputeThreatListDiffRequest {
122125
}
123126

124127
message ComputeThreatListDiffResponse {
125-
// The expected state of a client's local database.
126-
message Checksum {
127-
// The SHA256 hash of the client state; that is, of the sorted list of all
128-
// hashes present in the database.
129-
bytes sha256 = 1;
130-
}
131-
132128
// The type of response sent to the client.
133129
enum ResponseType {
134130
// Unknown.
@@ -143,6 +139,13 @@ message ComputeThreatListDiffResponse {
143139
RESET = 2;
144140
}
145141

142+
// The expected state of a client's local database.
143+
message Checksum {
144+
// The SHA256 hash of the client state; that is, of the sorted list of all
145+
// hashes present in the database.
146+
bytes sha256 = 1;
147+
}
148+
146149
// The type of response. This may indicate that an action must be taken by the
147150
// client when the response is received.
148151
ResponseType response_type = 4;
@@ -192,14 +195,16 @@ message SearchUrisResponse {
192195
google.protobuf.Timestamp expire_time = 2;
193196
}
194197

195-
// The threat list matches. This may be empty if the URI is on no list.
198+
// The threat list matches. This might be empty if the URI is on no list.
196199
ThreatUri threat = 1;
197200
}
198201

199202
// Request to return full hashes matched by the provided hash prefixes.
200203
message SearchHashesRequest {
201204
// A hash prefix, consisting of the most significant 4-32 bytes of a SHA256
202205
// hash. For JSON requests, this field is base64-encoded.
206+
// Note that if this parameter is provided by a URI, it must be encoded using
207+
// the web safe base64 variant (RFC 4648).
203208
bytes hash_prefix = 1;
204209

205210
// Required. The ThreatLists to search in. Multiple ThreatLists may be specified.
@@ -231,35 +236,10 @@ message SearchHashesResponse {
231236
google.protobuf.Timestamp negative_expire_time = 2;
232237
}
233238

234-
// Contains the set of entries to add to a local database.
235-
// May contain a combination of compressed and raw data in a single response.
236-
message ThreatEntryAdditions {
237-
// The raw SHA256-formatted entries.
238-
// Repeated to allow returning sets of hashes with different prefix sizes.
239-
repeated RawHashes raw_hashes = 1;
240-
241-
// The encoded 4-byte prefixes of SHA256-formatted entries, using a
242-
// Golomb-Rice encoding. The hashes are converted to uint32, sorted in
243-
// ascending order, then delta encoded and stored as encoded_data.
244-
RiceDeltaEncoding rice_hashes = 2;
245-
}
246-
247-
// Contains the set of entries to remove from a local database.
248-
message ThreatEntryRemovals {
249-
// The raw removal indices for a local list.
250-
RawIndices raw_indices = 1;
251-
252-
// The encoded local, lexicographically-sorted list indices, using a
253-
// Golomb-Rice encoding. Used for sending compressed removal indices. The
254-
// removal indices (uint32) are sorted in ascending order, then delta encoded
255-
// and stored as encoded_data.
256-
RiceDeltaEncoding rice_indices = 2;
257-
}
258-
259-
// The type of threat. This maps dirrectly to the threat list a threat may
239+
// The type of threat. This maps directly to the threat list a threat may
260240
// belong to.
261241
enum ThreatType {
262-
// Unknown.
242+
// No entries should match this threat type. This threat type is unused.
263243
THREAT_TYPE_UNSPECIFIED = 0;
264244

265245
// Malware targeting any platform.
@@ -270,6 +250,10 @@ enum ThreatType {
270250

271251
// Unwanted software targeting any platform.
272252
UNWANTED_SOFTWARE = 3;
253+
254+
// A list of extended coverage social engineering URIs targeting any
255+
// platform.
256+
SOCIAL_ENGINEERING_EXTENDED_COVERAGE = 4;
273257
}
274258

275259
// The ways in which threat entry sets can be compressed.
@@ -284,6 +268,31 @@ enum CompressionType {
284268
RICE = 2;
285269
}
286270

271+
// Contains the set of entries to add to a local database.
272+
// May contain a combination of compressed and raw data in a single response.
273+
message ThreatEntryAdditions {
274+
// The raw SHA256-formatted entries.
275+
// Repeated to allow returning sets of hashes with different prefix sizes.
276+
repeated RawHashes raw_hashes = 1;
277+
278+
// The encoded 4-byte prefixes of SHA256-formatted entries, using a
279+
// Golomb-Rice encoding. The hashes are converted to uint32, sorted in
280+
// ascending order, then delta encoded and stored as encoded_data.
281+
RiceDeltaEncoding rice_hashes = 2;
282+
}
283+
284+
// Contains the set of entries to remove from a local database.
285+
message ThreatEntryRemovals {
286+
// The raw removal indices for a local list.
287+
RawIndices raw_indices = 1;
288+
289+
// The encoded local, lexicographically-sorted list indices, using a
290+
// Golomb-Rice encoding. Used for sending compressed removal indices. The
291+
// removal indices (uint32) are sorted in ascending order, then delta encoded
292+
// and stored as encoded_data.
293+
RiceDeltaEncoding rice_indices = 2;
294+
}
295+
287296
// A set of raw indices to remove from a local list.
288297
message RawIndices {
289298
// The indices to remove from a lexicographically-sorted local list.
@@ -331,9 +340,9 @@ message RiceDeltaEncoding {
331340
bytes encoded_data = 4;
332341
}
333342

334-
// Wraps a URI that might be displaying phishing content.
343+
// Wraps a URI that might be displaying malicious content.
335344
message Submission {
336-
// Required. The URI that is being reported for phishing content to be analyzed.
345+
// Required. The URI that is being reported for malicious content to be analyzed.
337346
string uri = 1 [(google.api.field_behavior) = REQUIRED];
338347
}
339348

google/cloud/webrisk/v1/webrisk_grpc_service_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"method": "CreateSubmission"
3434
}
3535
],
36-
"timeout": "60s"
36+
"timeout": "600s"
3737
}
3838
]
3939
}

0 commit comments

Comments
 (0)