Skip to content

Commit

Permalink
feat: Add SOCIAL_ENGINEERING_EXTENDED_COVERAGE threat type (#350)
Browse files Browse the repository at this point in the history
* feat: Add SOCIAL_ENGINEERING_EXTENDED_COVERAGE threat type

PiperOrigin-RevId: 481130618

Source-Link: googleapis/googleapis@9fba835

Source-Link: googleapis/googleapis-gen@5d66ac0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWQ2NmFjMDcyNDk1MmZhNzI1Y2NmOTQwZmJiZWM5ZmI1MDlkZGRlMyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Oct 14, 2022
1 parent d8442dd commit c7cc2b0
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 141 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -79,7 +79,8 @@ service WebRiskService {
// content, the site will be added to the [Google's Social Engineering
// lists](https://support.google.com/webmasters/answer/6350487/) in order to
// protect users that could get exposed to this threat in the future. Only
// projects with CREATE_SUBMISSION_USERS visibility can use this method.
// allowlisted projects can use this method during Early Access. Please reach
// out to Sales or your customer engineer to obtain access.
rpc CreateSubmission(CreateSubmissionRequest) returns (Submission) {
option (google.api.http) = {
post: "/v1/{parent=projects/*}/submissions"
Expand Down Expand Up @@ -107,7 +108,9 @@ message ComputeThreatListDiffRequest {
repeated CompressionType supported_compressions = 3;
}

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

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

message ComputeThreatListDiffResponse {
// The expected state of a client's local database.
message Checksum {
// The SHA256 hash of the client state; that is, of the sorted list of all
// hashes present in the database.
bytes sha256 = 1;
}

// The type of response sent to the client.
enum ResponseType {
// Unknown.
Expand All @@ -143,6 +139,13 @@ message ComputeThreatListDiffResponse {
RESET = 2;
}

// The expected state of a client's local database.
message Checksum {
// The SHA256 hash of the client state; that is, of the sorted list of all
// hashes present in the database.
bytes sha256 = 1;
}

// The type of response. This may indicate that an action must be taken by the
// client when the response is received.
ResponseType response_type = 4;
Expand Down Expand Up @@ -192,14 +195,16 @@ message SearchUrisResponse {
google.protobuf.Timestamp expire_time = 2;
}

// The threat list matches. This may be empty if the URI is on no list.
// The threat list matches. This might be empty if the URI is on no list.
ThreatUri threat = 1;
}

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

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

// Contains the set of entries to add to a local database.
// May contain a combination of compressed and raw data in a single response.
message ThreatEntryAdditions {
// The raw SHA256-formatted entries.
// Repeated to allow returning sets of hashes with different prefix sizes.
repeated RawHashes raw_hashes = 1;

// The encoded 4-byte prefixes of SHA256-formatted entries, using a
// Golomb-Rice encoding. The hashes are converted to uint32, sorted in
// ascending order, then delta encoded and stored as encoded_data.
RiceDeltaEncoding rice_hashes = 2;
}

// Contains the set of entries to remove from a local database.
message ThreatEntryRemovals {
// The raw removal indices for a local list.
RawIndices raw_indices = 1;

// The encoded local, lexicographically-sorted list indices, using a
// Golomb-Rice encoding. Used for sending compressed removal indices. The
// removal indices (uint32) are sorted in ascending order, then delta encoded
// and stored as encoded_data.
RiceDeltaEncoding rice_indices = 2;
}

// The type of threat. This maps dirrectly to the threat list a threat may
// The type of threat. This maps directly to the threat list a threat may
// belong to.
enum ThreatType {
// Unknown.
// No entries should match this threat type. This threat type is unused.
THREAT_TYPE_UNSPECIFIED = 0;

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

// Unwanted software targeting any platform.
UNWANTED_SOFTWARE = 3;

// A list of extended coverage social engineering URIs targeting any
// platform.
SOCIAL_ENGINEERING_EXTENDED_COVERAGE = 4;
}

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

// Contains the set of entries to add to a local database.
// May contain a combination of compressed and raw data in a single response.
message ThreatEntryAdditions {
// The raw SHA256-formatted entries.
// Repeated to allow returning sets of hashes with different prefix sizes.
repeated RawHashes raw_hashes = 1;

// The encoded 4-byte prefixes of SHA256-formatted entries, using a
// Golomb-Rice encoding. The hashes are converted to uint32, sorted in
// ascending order, then delta encoded and stored as encoded_data.
RiceDeltaEncoding rice_hashes = 2;
}

// Contains the set of entries to remove from a local database.
message ThreatEntryRemovals {
// The raw removal indices for a local list.
RawIndices raw_indices = 1;

// The encoded local, lexicographically-sorted list indices, using a
// Golomb-Rice encoding. Used for sending compressed removal indices. The
// removal indices (uint32) are sorted in ascending order, then delta encoded
// and stored as encoded_data.
RiceDeltaEncoding rice_indices = 2;
}

// A set of raw indices to remove from a local list.
message RawIndices {
// The indices to remove from a lexicographically-sorted local list.
Expand Down Expand Up @@ -331,9 +340,9 @@ message RiceDeltaEncoding {
bytes encoded_data = 4;
}

// Wraps a URI that might be displaying phishing content.
// Wraps a URI that might be displaying malicious content.
message Submission {
// Required. The URI that is being reported for phishing content to be analyzed.
// Required. The URI that is being reported for malicious content to be analyzed.
string uri = 1 [(google.api.field_behavior) = REQUIRED];
}

Expand Down
45 changes: 23 additions & 22 deletions packages/google-cloud-webrisk/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c7cc2b0

Please sign in to comment.