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
124127message 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.
200203message 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.
261241enum 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.
288297message 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.
335344message 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
0 commit comments