Types for Google Cloud Webrisk v1beta1 API¶
- class google.cloud.webrisk_v1beta1.types.CompressionType(value)[source]¶
Bases:
proto.enums.Enum
The ways in which threat entry sets can be compressed.
- Values:
- COMPRESSION_TYPE_UNSPECIFIED (0):
Unknown.
- RAW (1):
Raw, uncompressed data.
- RICE (2):
Rice-Golomb encoded data.
- class google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Describes an API diff request.
- threat_type¶
The ThreatList to update.
- version_token¶
The current version token of the client for the requested list (the client version that was received from the last successful diff).
- Type
- constraints¶
Required. The constraints associated with this request.
- class Constraints(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The constraints for this diff.
- max_diff_entries¶
The maximum size in number of entries. The diff will not contain more entries than this value. This should be a power of 2 between 210 and 220. If zero, no diff size limit is set.
- Type
- max_database_entries¶
Sets the maximum number of entries that the client is willing to have in the local database. This should be a power of 2 between 210 and 220. If zero, no database size limit is set.
- Type
- supported_compressions¶
The compression types supported by the client.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.CompressionType]
- class google.cloud.webrisk_v1beta1.types.ComputeThreatListDiffResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
- response_type¶
The type of response. This may indicate that an action must be taken by the client when the response is received.
- additions¶
A set of entries to add to a local threat type’s list.
- removals¶
A set of entries to remove from a local threat type’s list. This field may be empty.
- checksum¶
The expected SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database after applying the provided diff. If the client state doesn’t match the expected state, the client must disregard this diff and retry later.
- recommended_next_diff¶
The soonest the client should wait before issuing any diff request. Querying sooner is unlikely to produce a meaningful diff. Waiting longer is acceptable considering the use case. If this field is not set clients may update as soon as they want.
- class Checksum(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The expected state of a client’s local database.
- class ResponseType(value)[source]¶
Bases:
proto.enums.Enum
The type of response sent to the client.
- Values:
- RESPONSE_TYPE_UNSPECIFIED (0):
Unknown.
- DIFF (1):
Partial updates are applied to the client’s existing local database.
- RESET (2):
Full updates resets the client’s entire local database. This means that either the client had no state, was seriously out-of-date, or the client is believed to be corrupt.
- class google.cloud.webrisk_v1beta1.types.RawHashes(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The uncompressed threat entries in hash format. Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 bytes, but some hashes are lengthened if they collide with the hash of a popular URI.
Used for sending ThreatEntryAdditons to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression.
- prefix_size¶
The number of bytes for each prefix encoded below. This field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash).
- Type
- class google.cloud.webrisk_v1beta1.types.RawIndices(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A set of raw indices to remove from a local list.
- class google.cloud.webrisk_v1beta1.types.RiceDeltaEncoding(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices.
- first_value¶
The offset of the first entry in the encoded data, or, if only a single integer was encoded, that single integer’s value. If the field is empty or missing, assume zero.
- Type
- rice_parameter¶
The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is, zero) if
num_entries
is zero.- Type
- entry_count¶
The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in
first_value
.- Type
- class google.cloud.webrisk_v1beta1.types.SearchHashesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request to return full hashes matched by the provided hash prefixes.
- hash_prefix¶
A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. For JSON requests, this field is base64-encoded.
- Type
- threat_types¶
Required. The ThreatLists to search in.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.ThreatType]
- class google.cloud.webrisk_v1beta1.types.SearchHashesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
- threats¶
The full hashes that matched the requested prefixes. The hash will be populated in the key.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.SearchHashesResponse.ThreatHash]
- negative_expire_time¶
For requested entities that did not match the threat list, how long to cache the response until.
- class ThreatHash(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Contains threat information on a matching hash.
- threat_types¶
The ThreatList this threat belongs to. This must contain at least one entry.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.ThreatType]
- hash_¶
A 32 byte SHA256 hash. This field is in binary format. For JSON requests, hashes are base64-encoded.
- Type
- expire_time¶
The cache lifetime for the returned match. Clients must not cache this response past this timestamp to avoid false positives.
- class google.cloud.webrisk_v1beta1.types.SearchUrisRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request to check URI entries against threatLists.
- threat_types¶
Required. The ThreatLists to search in.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.ThreatType]
- class google.cloud.webrisk_v1beta1.types.SearchUrisResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
- threat¶
The threat list matches. This may be empty if the URI is on no list.
- class ThreatUri(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Contains threat information on a matching uri.
- threat_types¶
The ThreatList this threat belongs to.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.ThreatType]
- expire_time¶
The cache lifetime for the returned match. Clients must not cache this response past this timestamp to avoid false positives.
- class google.cloud.webrisk_v1beta1.types.ThreatEntryAdditions(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Contains the set of entries to add to a local database. May contain a combination of compressed and raw data in a single response.
- raw_hashes¶
The raw SHA256-formatted entries. Repeated to allow returning sets of hashes with different prefix sizes.
- Type
MutableSequence[google.cloud.webrisk_v1beta1.types.RawHashes]
- rice_hashes¶
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.
- class google.cloud.webrisk_v1beta1.types.ThreatEntryRemovals(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Contains the set of entries to remove from a local database.
- raw_indices¶
The raw removal indices for a local list.
- rice_indices¶
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.
- class google.cloud.webrisk_v1beta1.types.ThreatType(value)[source]¶
Bases:
proto.enums.Enum
The type of threat. This maps dirrectly to the threat list a threat may belong to.
- Values:
- THREAT_TYPE_UNSPECIFIED (0):
Unknown.
- MALWARE (1):
Malware targeting any platform.
- SOCIAL_ENGINEERING (2):
Social engineering targeting any platform.
- UNWANTED_SOFTWARE (3):
Unwanted software targeting any platform.