Skip to content

Commit

Permalink
feat: added deidentify replacement dictionaries feat: added field for…
Browse files Browse the repository at this point in the history
… BigQuery inspect template inclusion lists feat: added field to support infotype versioning (#667)

* feat: added deidentify replacement dictionaries feat: added field for BigQuery inspect template inclusion lists feat: added field to support infotype versioning

PiperOrigin-RevId: 413780624

Source-Link: googleapis/googleapis@ed9918e

Source-Link: googleapis/googleapis-gen@9286ba6
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTI4NmJhNjBlMWMxZjZiY2Q1NTllOTgzNDc1NmIyZmEzZTUxZjI2ZCJ9

* 🦉 Updates from OwlBot

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 Dec 3, 2021
1 parent e8e7af9 commit d11a028
Show file tree
Hide file tree
Showing 8 changed files with 723 additions and 110 deletions.
126 changes: 83 additions & 43 deletions packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2021 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 @@ -360,6 +360,10 @@ service DlpService {
post: "/v2/{parent=projects/*/locations/*}/jobTriggers"
body: "*"
}
additional_bindings {
post: "/v2/{parent=organizations/*/locations/*}/jobTriggers"
body: "*"
}
};
option (google.api.method_signature) = "parent,job_trigger";
}
Expand All @@ -374,16 +378,17 @@ service DlpService {
patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
body: "*"
}
additional_bindings {
patch: "/v2/{name=organizations/*/locations/*/jobTriggers/*}"
body: "*"
}
};
option (google.api.method_signature) = "name,job_trigger,update_mask";
}

// Inspect hybrid content and store findings to a trigger. The inspection
// will be processed asynchronously. To review the findings monitor the
// jobs within the trigger.
// Early access feature is in a pre-release state and might change or have
// limited support. For more information, see
// https://cloud.google.com/products#product-launch-stages.
rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect"
Expand All @@ -400,6 +405,9 @@ service DlpService {
additional_bindings {
get: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
}
additional_bindings {
get: "/v2/{name=organizations/*/locations/*/jobTriggers/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand All @@ -412,6 +420,9 @@ service DlpService {
additional_bindings {
get: "/v2/{parent=projects/*/locations/*}/jobTriggers"
}
additional_bindings {
get: "/v2/{parent=organizations/*/locations/*}/jobTriggers"
}
};
option (google.api.method_signature) = "parent";
}
Expand All @@ -424,6 +435,9 @@ service DlpService {
additional_bindings {
delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
}
additional_bindings {
delete: "/v2/{name=organizations/*/locations/*/jobTriggers/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand Down Expand Up @@ -470,6 +484,9 @@ service DlpService {
additional_bindings {
get: "/v2/{parent=projects/*/locations/*}/dlpJobs"
}
additional_bindings {
get: "/v2/{parent=organizations/*/locations/*}/dlpJobs"
}
};
option (google.api.method_signature) = "parent";
}
Expand Down Expand Up @@ -623,11 +640,8 @@ service DlpService {
}

// Inspect hybrid content and store findings to a job.
// To review the findings inspect the job. Inspection will occur
// To review the findings, inspect the job. Inspection will occur
// asynchronously.
// Early access feature is in a pre-release state and might change or have
// limited support. For more information, see
// https://cloud.google.com/products#product-launch-stages.
rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect"
Expand All @@ -638,9 +652,6 @@ service DlpService {

// Finish a running hybrid DlpJob. Triggers the finalization steps and running
// of any enabled actions that have not yet run.
// Early access feature is in a pre-release state and might change or have
// limited support. For more information, see
// https://cloud.google.com/products#product-launch-stages.
rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish"
Expand Down Expand Up @@ -708,7 +719,8 @@ message InspectionRuleSet {
// When used with redactContent only info_types and min_likelihood are currently
// used.
message InspectConfig {
// Configuration to control the number of findings returned.
// Configuration to control the number of findings returned. Cannot be set if
// de-identification is requested.
message FindingLimits {
// Max findings configuration per infoType, per content item or long
// running DlpJob.
Expand Down Expand Up @@ -782,7 +794,9 @@ message InspectConfig {

// Container for bytes to inspect or redact.
message ByteContentItem {
// The type of data being sent for inspection.
// The type of data being sent for inspection. To learn more, see
// [Supported file
// types](https://cloud.google.com/dlp/docs/supported-file-types).
enum BytesType {
// Unused
BYTES_TYPE_UNSPECIFIED = 0;
Expand Down Expand Up @@ -845,9 +859,9 @@ message ContentItem {
}
}

// Structured content to inspect. Up to 50,000 `Value`s per request allowed.
// See https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
// learn more.
// Structured content to inspect. Up to 50,000 `Value`s per request allowed. See
// https://cloud.google.com/dlp/docs/inspecting-structured-text#inspecting_a_table
// to learn more.
message Table {
// Values of the row.
message Row {
Expand Down Expand Up @@ -945,6 +959,9 @@ message Finding {
string job_name = 13 [(google.api.resource_reference) = {
type: "dlp.googleapis.com/DlpJob"
}];

// The unique finding id.
string finding_id = 15;
}

// Specifies the location of the finding.
Expand Down Expand Up @@ -1488,16 +1505,13 @@ message InspectDataSourceDetails {
repeated InfoTypeStats info_type_stats = 3;

// Statistics related to the processing of hybrid inspect.
// Early access feature is in a pre-release state and might change or have
// limited support. For more information, see
// https://cloud.google.com/products#product-launch-stages.
HybridInspectStatistics hybrid_stats = 7;
}

// The configuration used for this job.
RequestedOptions requested_options = 2;

// A summary of the outcome of this inspect job.
// A summary of the outcome of this inspection job.
Result result = 3;
}

Expand Down Expand Up @@ -2200,7 +2214,7 @@ message TransformationErrorHandling {
// A rule for transforming a value.
message PrimitiveTransformation {
oneof transformation {
// Replace
// Replace with a specified value.
ReplaceValueConfig replace_config = 1;

// Redact
Expand Down Expand Up @@ -2232,6 +2246,9 @@ message PrimitiveTransformation {

// Deterministic Crypto
CryptoDeterministicConfig crypto_deterministic_config = 12;

// Replace with a value randomly drawn (with replacement) from a dictionary.
ReplaceDictionaryConfig replace_dictionary_config = 13;
}
}

Expand Down Expand Up @@ -2282,7 +2299,9 @@ message CryptoHashConfig {
// input. Outputs a base64 encoded representation of the encrypted output.
// Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
message CryptoDeterministicConfig {
// The key used by the encryption function.
// The key used by the encryption function. For deterministic encryption
// using AES-SIV, the provided key is internally expanded to 64 bytes prior to
// use.
CryptoKey crypto_key = 1;

// The custom info type to annotate the surrogate with.
Expand Down Expand Up @@ -2346,6 +2365,16 @@ message ReplaceValueConfig {
Value new_value = 1;
}

// Replace each input value with a value randomly selected from the dictionary.
message ReplaceDictionaryConfig {
oneof type {
// A list of words to select from for random replacement. The
// [limits](https://cloud.google.com/dlp/limits) page contains details about
// the size limits of dictionaries.
CustomInfoType.Dictionary.WordList word_list = 1;
}
}

// Replace each matching finding with the name of the info_type.
message ReplaceWithInfoTypeConfig {

Expand Down Expand Up @@ -2429,8 +2458,8 @@ message CharacterMaskConfig {
// the user for simple bucketing strategies.
//
// The transformed value will be a hyphenated string of
// {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20
// all values that are within this bucket will be replaced with "10-20".
// {lower_bound}-{upper_bound}. For example, if lower_bound = 10 and upper_bound
// = 20, all values that are within this bucket will be replaced with "10-20".
//
// This can be used on data of type: double, long.
//
Expand Down Expand Up @@ -2593,10 +2622,11 @@ message CryptoReplaceFfxFpeConfig {
}

// This is a data encryption key (DEK) (as opposed to
// a key encryption key (KEK) stored by KMS).
// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate
// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot
// unwrap the data crypto key.
// a key encryption key (KEK) stored by Cloud Key Management Service
// (Cloud KMS).
// When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate
// IAM policy on the KEK to ensure an attacker cannot
// unwrap the DEK.
message CryptoKey {
// Sources of crypto keys.
oneof source {
Expand All @@ -2606,7 +2636,7 @@ message CryptoKey {
// Unwrapped crypto key
UnwrappedCryptoKey unwrapped = 2;

// Kms wrapped key
// Key wrapped using Cloud KMS
KmsWrappedCryptoKey kms_wrapped = 3;
}
}
Expand All @@ -2631,10 +2661,16 @@ message UnwrappedCryptoKey {
}

// Include to use an existing data crypto key wrapped by KMS.
// The wrapped key must be a 128/192/256 bit key.
// The wrapped key must be a 128-, 192-, or 256-bit key.
// Authorization requires the following IAM permissions when sending a request
// to perform a crypto transformation using a kms-wrapped crypto key:
// to perform a crypto transformation using a KMS-wrapped crypto key:
// dlp.kms.encrypt
//
// For more information, see [Creating a wrapped key]
// (https://cloud.google.com/dlp/docs/create-wrapped-key).
//
// Note: When you use Cloud KMS for cryptographic operations,
// [charges apply](https://cloud.google.com/kms/pricing).
message KmsWrappedCryptoKey {
// Required. The wrapped data crypto key.
bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -2697,6 +2733,9 @@ message InfoTypeTransformations {
// The transformation to apply to the field.
message FieldTransformation {
// Required. Input field(s) to apply the transformation to.
// When you have columns that reference their position within a list,
// omit the index from the FieldId. FieldId name matching ignores the index.
// For example, instead of "contact.nums[0].type", use "contact.nums.type".
repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED];

// Only apply the transformation if the condition evaluates to true for the
Expand Down Expand Up @@ -2868,7 +2907,7 @@ message TransformationSummary {
int64 transformed_bytes = 7;
}

// Schedule for triggeredJobs.
// Schedule for inspect job triggers.
message Schedule {
oneof option {
// With this option a job is started a regular periodic basis. For
Expand Down Expand Up @@ -2955,7 +2994,7 @@ message DeidentifyTemplate {
// Output only. The last update timestamp of an inspectTemplate.
google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// ///////////// // The core content of the template // ///////////////
// The core content of the template.
DeidentifyConfig deidentify_config = 6;
}

Expand Down Expand Up @@ -2985,9 +3024,6 @@ message JobTrigger {
Schedule schedule = 1;

// For use with hybrid jobs. Jobs must be manually created and finished.
// Early access feature is in a pre-release state and might change or have
// limited support. For more information, see
// https://cloud.google.com/products#product-launch-stages.
Manual manual = 2;
}
}
Expand Down Expand Up @@ -3090,11 +3126,11 @@ message Action {

}

// Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the
// Publish findings of a DlpJob to Data Catalog. Labels summarizing the
// results of the DlpJob will be applied to the entry for the resource scanned
// in Cloud Data Catalog. Any labels previously written by another DlpJob will
// in Data Catalog. Any labels previously written by another DlpJob will
// be deleted. InfoType naming patterns are strictly enforced when using this
// feature. Note that the findings will be persisted in Cloud Data Catalog
// feature. Note that the findings will be persisted in Data Catalog
// storage and are governed by Data Catalog service-specific policy, see
// https://cloud.google.com/terms/service-terms
// Only a single instance of this action can be specified and only allowed if
Expand Down Expand Up @@ -3402,10 +3438,11 @@ message CreateDlpJobRequest {

// The configuration details for the specific type of job to run.
oneof job {
// Set to control what and how to inspect.
// An inspection job scans a storage repository for InfoTypes.
InspectJobConfig inspect_job = 2;

// Set to choose what metric to calculate.
// A risk analysis job calculates re-identification risk metrics for a
// BigQuery table.
RiskAnalysisJobConfig risk_job = 3;
}

Expand Down Expand Up @@ -3477,7 +3514,7 @@ message ListJobTriggersRequest {
// * Restrictions can be combined by `AND` or `OR` logical operators. A
// sequence of restrictions implicitly uses `AND`.
// * A restriction has the form of `{field} {operator} {value}`.
// * Supported fields/values for inspect jobs:
// * Supported fields/values for inspect triggers:
// - `status` - HEALTHY|PAUSED|CANCELLED
// - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
// - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
Expand All @@ -3495,6 +3532,9 @@ message ListJobTriggersRequest {
// The length of this field should be no more than 500 characters.
string filter = 5;

// The type of jobs. Will use `DlpJobType.INSPECT` if not set.
DlpJobType type = 6;

// Deprecated. This field has no effect.
string location_id = 7;
}
Expand Down Expand Up @@ -4347,7 +4387,7 @@ enum InfoTypeSupportedBy {

// An enum to represent the various types of DLP jobs.
enum DlpJobType {
// Unused
// Defaults to INSPECT_JOB.
DLP_JOB_TYPE_UNSPECIFIED = 0;

// The job inspected Google Cloud for sensitive data.
Expand Down
Loading

0 comments on commit d11a028

Please sign in to comment.