1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.privacy.dlp.v2; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/privacy/dlp/v2/storage.proto"; 24import "google/protobuf/duration.proto"; 25import "google/protobuf/empty.proto"; 26import "google/protobuf/field_mask.proto"; 27import "google/protobuf/timestamp.proto"; 28import "google/rpc/status.proto"; 29import "google/type/date.proto"; 30import "google/type/dayofweek.proto"; 31import "google/type/timeofday.proto"; 32 33option csharp_namespace = "Google.Cloud.Dlp.V2"; 34option go_package = "cloud.google.com/go/dlp/apiv2/dlppb;dlppb"; 35option java_multiple_files = true; 36option java_outer_classname = "DlpProto"; 37option java_package = "com.google.privacy.dlp.v2"; 38option php_namespace = "Google\\Cloud\\Dlp\\V2"; 39option ruby_package = "Google::Cloud::Dlp::V2"; 40option (google.api.resource_definition) = { 41 type: "dlp.googleapis.com/DlpContent" 42 pattern: "projects/{project}/dlpContent" 43 pattern: "projects/{project}/locations/{location}/dlpContent" 44}; 45option (google.api.resource_definition) = { 46 type: "dlp.googleapis.com/OrganizationLocation" 47 pattern: "organizations/{organization}/locations/{location}" 48}; 49 50// The Cloud Data Loss Prevention (DLP) API is a service that allows clients 51// to detect the presence of Personally Identifiable Information (PII) and other 52// privacy-sensitive data in user-supplied, unstructured data streams, like text 53// blocks or images. 54// The service also includes methods for sensitive data redaction and 55// scheduling of data scans on Google Cloud Platform based data sets. 56// 57// To learn more about concepts and find how-to guides see 58// https://cloud.google.com/sensitive-data-protection/docs/. 59service DlpService { 60 option (google.api.default_host) = "dlp.googleapis.com"; 61 option (google.api.oauth_scopes) = 62 "https://www.googleapis.com/auth/cloud-platform"; 63 64 // Finds potentially sensitive info in content. 65 // This method has limits on input size, processing time, and output size. 66 // 67 // When no InfoTypes or CustomInfoTypes are specified in this request, the 68 // system will automatically choose what detectors to run. By default this may 69 // be all types, but may change over time as detectors are updated. 70 // 71 // For how to guides, see 72 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-images 73 // and 74 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-text, 75 rpc InspectContent(InspectContentRequest) returns (InspectContentResponse) { 76 option (google.api.http) = { 77 post: "/v2/{parent=projects/*}/content:inspect" 78 body: "*" 79 additional_bindings { 80 post: "/v2/{parent=projects/*/locations/*}/content:inspect" 81 body: "*" 82 } 83 }; 84 } 85 86 // Redacts potentially sensitive info from an image. 87 // This method has limits on input size, processing time, and output size. 88 // See 89 // https://cloud.google.com/sensitive-data-protection/docs/redacting-sensitive-data-images 90 // to learn more. 91 // 92 // When no InfoTypes or CustomInfoTypes are specified in this request, the 93 // system will automatically choose what detectors to run. By default this may 94 // be all types, but may change over time as detectors are updated. 95 rpc RedactImage(RedactImageRequest) returns (RedactImageResponse) { 96 option (google.api.http) = { 97 post: "/v2/{parent=projects/*}/image:redact" 98 body: "*" 99 additional_bindings { 100 post: "/v2/{parent=projects/*/locations/*}/image:redact" 101 body: "*" 102 } 103 }; 104 } 105 106 // De-identifies potentially sensitive info from a ContentItem. 107 // This method has limits on input size and output size. 108 // See 109 // https://cloud.google.com/sensitive-data-protection/docs/deidentify-sensitive-data 110 // to learn more. 111 // 112 // When no InfoTypes or CustomInfoTypes are specified in this request, the 113 // system will automatically choose what detectors to run. By default this may 114 // be all types, but may change over time as detectors are updated. 115 rpc DeidentifyContent(DeidentifyContentRequest) 116 returns (DeidentifyContentResponse) { 117 option (google.api.http) = { 118 post: "/v2/{parent=projects/*}/content:deidentify" 119 body: "*" 120 additional_bindings { 121 post: "/v2/{parent=projects/*/locations/*}/content:deidentify" 122 body: "*" 123 } 124 }; 125 } 126 127 // Re-identifies content that has been de-identified. 128 // See 129 // https://cloud.google.com/sensitive-data-protection/docs/pseudonymization#re-identification_in_free_text_code_example 130 // to learn more. 131 rpc ReidentifyContent(ReidentifyContentRequest) 132 returns (ReidentifyContentResponse) { 133 option (google.api.http) = { 134 post: "/v2/{parent=projects/*}/content:reidentify" 135 body: "*" 136 additional_bindings { 137 post: "/v2/{parent=projects/*/locations/*}/content:reidentify" 138 body: "*" 139 } 140 }; 141 } 142 143 // Returns a list of the sensitive information types that DLP API 144 // supports. See 145 // https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference 146 // to learn more. 147 rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) { 148 option (google.api.http) = { 149 get: "/v2/infoTypes" 150 additional_bindings { get: "/v2/{parent=locations/*}/infoTypes" } 151 }; 152 option (google.api.method_signature) = "parent"; 153 } 154 155 // Creates an InspectTemplate for reusing frequently used configuration 156 // for inspecting content, images, and storage. 157 // See 158 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates 159 // to learn more. 160 rpc CreateInspectTemplate(CreateInspectTemplateRequest) 161 returns (InspectTemplate) { 162 option (google.api.http) = { 163 post: "/v2/{parent=organizations/*}/inspectTemplates" 164 body: "*" 165 additional_bindings { 166 post: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" 167 body: "*" 168 } 169 additional_bindings { 170 post: "/v2/{parent=projects/*}/inspectTemplates" 171 body: "*" 172 } 173 additional_bindings { 174 post: "/v2/{parent=projects/*/locations/*}/inspectTemplates" 175 body: "*" 176 } 177 }; 178 option (google.api.method_signature) = "parent,inspect_template"; 179 } 180 181 // Updates the InspectTemplate. 182 // See 183 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates 184 // to learn more. 185 rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) 186 returns (InspectTemplate) { 187 option (google.api.http) = { 188 patch: "/v2/{name=organizations/*/inspectTemplates/*}" 189 body: "*" 190 additional_bindings { 191 patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" 192 body: "*" 193 } 194 additional_bindings { 195 patch: "/v2/{name=projects/*/inspectTemplates/*}" 196 body: "*" 197 } 198 additional_bindings { 199 patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" 200 body: "*" 201 } 202 }; 203 option (google.api.method_signature) = "name,inspect_template,update_mask"; 204 } 205 206 // Gets an InspectTemplate. 207 // See 208 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates 209 // to learn more. 210 rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) { 211 option (google.api.http) = { 212 get: "/v2/{name=organizations/*/inspectTemplates/*}" 213 additional_bindings { 214 get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" 215 } 216 additional_bindings { get: "/v2/{name=projects/*/inspectTemplates/*}" } 217 additional_bindings { 218 get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" 219 } 220 }; 221 option (google.api.method_signature) = "name"; 222 } 223 224 // Lists InspectTemplates. 225 // See 226 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates 227 // to learn more. 228 rpc ListInspectTemplates(ListInspectTemplatesRequest) 229 returns (ListInspectTemplatesResponse) { 230 option (google.api.http) = { 231 get: "/v2/{parent=organizations/*}/inspectTemplates" 232 additional_bindings { 233 get: "/v2/{parent=organizations/*/locations/*}/inspectTemplates" 234 } 235 additional_bindings { get: "/v2/{parent=projects/*}/inspectTemplates" } 236 additional_bindings { 237 get: "/v2/{parent=projects/*/locations/*}/inspectTemplates" 238 } 239 }; 240 option (google.api.method_signature) = "parent"; 241 } 242 243 // Deletes an InspectTemplate. 244 // See 245 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates 246 // to learn more. 247 rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) 248 returns (google.protobuf.Empty) { 249 option (google.api.http) = { 250 delete: "/v2/{name=organizations/*/inspectTemplates/*}" 251 additional_bindings { 252 delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}" 253 } 254 additional_bindings { delete: "/v2/{name=projects/*/inspectTemplates/*}" } 255 additional_bindings { 256 delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}" 257 } 258 }; 259 option (google.api.method_signature) = "name"; 260 } 261 262 // Creates a DeidentifyTemplate for reusing frequently used configuration 263 // for de-identifying content, images, and storage. 264 // See 265 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid 266 // to learn more. 267 rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) 268 returns (DeidentifyTemplate) { 269 option (google.api.http) = { 270 post: "/v2/{parent=organizations/*}/deidentifyTemplates" 271 body: "*" 272 additional_bindings { 273 post: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" 274 body: "*" 275 } 276 additional_bindings { 277 post: "/v2/{parent=projects/*}/deidentifyTemplates" 278 body: "*" 279 } 280 additional_bindings { 281 post: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" 282 body: "*" 283 } 284 }; 285 option (google.api.method_signature) = "parent,deidentify_template"; 286 } 287 288 // Updates the DeidentifyTemplate. 289 // See 290 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid 291 // to learn more. 292 rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) 293 returns (DeidentifyTemplate) { 294 option (google.api.http) = { 295 patch: "/v2/{name=organizations/*/deidentifyTemplates/*}" 296 body: "*" 297 additional_bindings { 298 patch: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" 299 body: "*" 300 } 301 additional_bindings { 302 patch: "/v2/{name=projects/*/deidentifyTemplates/*}" 303 body: "*" 304 } 305 additional_bindings { 306 patch: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" 307 body: "*" 308 } 309 }; 310 option (google.api.method_signature) = 311 "name,deidentify_template,update_mask"; 312 } 313 314 // Gets a DeidentifyTemplate. 315 // See 316 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid 317 // to learn more. 318 rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) 319 returns (DeidentifyTemplate) { 320 option (google.api.http) = { 321 get: "/v2/{name=organizations/*/deidentifyTemplates/*}" 322 additional_bindings { 323 get: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" 324 } 325 additional_bindings { get: "/v2/{name=projects/*/deidentifyTemplates/*}" } 326 additional_bindings { 327 get: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" 328 } 329 }; 330 option (google.api.method_signature) = "name"; 331 } 332 333 // Lists DeidentifyTemplates. 334 // See 335 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid 336 // to learn more. 337 rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) 338 returns (ListDeidentifyTemplatesResponse) { 339 option (google.api.http) = { 340 get: "/v2/{parent=organizations/*}/deidentifyTemplates" 341 additional_bindings { 342 get: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates" 343 } 344 additional_bindings { get: "/v2/{parent=projects/*}/deidentifyTemplates" } 345 additional_bindings { 346 get: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates" 347 } 348 }; 349 option (google.api.method_signature) = "parent"; 350 } 351 352 // Deletes a DeidentifyTemplate. 353 // See 354 // https://cloud.google.com/sensitive-data-protection/docs/creating-templates-deid 355 // to learn more. 356 rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) 357 returns (google.protobuf.Empty) { 358 option (google.api.http) = { 359 delete: "/v2/{name=organizations/*/deidentifyTemplates/*}" 360 additional_bindings { 361 delete: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}" 362 } 363 additional_bindings { 364 delete: "/v2/{name=projects/*/deidentifyTemplates/*}" 365 } 366 additional_bindings { 367 delete: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}" 368 } 369 }; 370 option (google.api.method_signature) = "name"; 371 } 372 373 // Creates a job trigger to run DLP actions such as scanning storage for 374 // sensitive information on a set schedule. 375 // See 376 // https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers 377 // to learn more. 378 rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) { 379 option (google.api.http) = { 380 post: "/v2/{parent=projects/*}/jobTriggers" 381 body: "*" 382 additional_bindings { 383 post: "/v2/{parent=projects/*/locations/*}/jobTriggers" 384 body: "*" 385 } 386 additional_bindings { 387 post: "/v2/{parent=organizations/*/locations/*}/jobTriggers" 388 body: "*" 389 } 390 }; 391 option (google.api.method_signature) = "parent,job_trigger"; 392 } 393 394 // Updates a job trigger. 395 // See 396 // https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers 397 // to learn more. 398 rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) { 399 option (google.api.http) = { 400 patch: "/v2/{name=projects/*/jobTriggers/*}" 401 body: "*" 402 additional_bindings { 403 patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}" 404 body: "*" 405 } 406 additional_bindings { 407 patch: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" 408 body: "*" 409 } 410 }; 411 option (google.api.method_signature) = "name,job_trigger,update_mask"; 412 } 413 414 // Inspect hybrid content and store findings to a trigger. The inspection 415 // will be processed asynchronously. To review the findings monitor the 416 // jobs within the trigger. 417 rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) 418 returns (HybridInspectResponse) { 419 option (google.api.http) = { 420 post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect" 421 body: "*" 422 }; 423 option (google.api.method_signature) = "name"; 424 } 425 426 // Gets a job trigger. 427 // See 428 // https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers 429 // to learn more. 430 rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) { 431 option (google.api.http) = { 432 get: "/v2/{name=projects/*/jobTriggers/*}" 433 additional_bindings { 434 get: "/v2/{name=projects/*/locations/*/jobTriggers/*}" 435 } 436 additional_bindings { 437 get: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" 438 } 439 }; 440 option (google.api.method_signature) = "name"; 441 } 442 443 // Lists job triggers. 444 // See 445 // https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers 446 // to learn more. 447 rpc ListJobTriggers(ListJobTriggersRequest) 448 returns (ListJobTriggersResponse) { 449 option (google.api.http) = { 450 get: "/v2/{parent=projects/*}/jobTriggers" 451 additional_bindings { 452 get: "/v2/{parent=projects/*/locations/*}/jobTriggers" 453 } 454 additional_bindings { 455 get: "/v2/{parent=organizations/*/locations/*}/jobTriggers" 456 } 457 }; 458 option (google.api.method_signature) = "parent"; 459 } 460 461 // Deletes a job trigger. 462 // See 463 // https://cloud.google.com/sensitive-data-protection/docs/creating-job-triggers 464 // to learn more. 465 rpc DeleteJobTrigger(DeleteJobTriggerRequest) 466 returns (google.protobuf.Empty) { 467 option (google.api.http) = { 468 delete: "/v2/{name=projects/*/jobTriggers/*}" 469 additional_bindings { 470 delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}" 471 } 472 additional_bindings { 473 delete: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" 474 } 475 }; 476 option (google.api.method_signature) = "name"; 477 } 478 479 // Activate a job trigger. Causes the immediate execute of a trigger 480 // instead of waiting on the trigger event to occur. 481 rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) { 482 option (google.api.http) = { 483 post: "/v2/{name=projects/*/jobTriggers/*}:activate" 484 body: "*" 485 additional_bindings { 486 post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate" 487 body: "*" 488 } 489 }; 490 } 491 492 // Creates a config for discovery to scan and profile storage. 493 rpc CreateDiscoveryConfig(CreateDiscoveryConfigRequest) 494 returns (DiscoveryConfig) { 495 option (google.api.http) = { 496 post: "/v2/{parent=projects/*/locations/*}/discoveryConfigs" 497 body: "*" 498 additional_bindings { 499 post: "/v2/{parent=organizations/*/locations/*}/discoveryConfigs" 500 body: "*" 501 } 502 }; 503 option (google.api.method_signature) = "parent,discovery_config"; 504 } 505 506 // Updates a discovery configuration. 507 rpc UpdateDiscoveryConfig(UpdateDiscoveryConfigRequest) 508 returns (DiscoveryConfig) { 509 option (google.api.http) = { 510 patch: "/v2/{name=projects/*/locations/*/discoveryConfigs/*}" 511 body: "*" 512 additional_bindings { 513 patch: "/v2/{name=organizations/*/locations/*/discoveryConfigs/*}" 514 body: "*" 515 } 516 }; 517 option (google.api.method_signature) = "name,discovery_config,update_mask"; 518 } 519 520 // Gets a discovery configuration. 521 rpc GetDiscoveryConfig(GetDiscoveryConfigRequest) returns (DiscoveryConfig) { 522 option (google.api.http) = { 523 get: "/v2/{name=projects/*/locations/*/discoveryConfigs/*}" 524 additional_bindings { 525 get: "/v2/{name=organizations/*/locations/*/discoveryConfigs/*}" 526 } 527 }; 528 option (google.api.method_signature) = "name"; 529 } 530 531 // Lists discovery configurations. 532 rpc ListDiscoveryConfigs(ListDiscoveryConfigsRequest) 533 returns (ListDiscoveryConfigsResponse) { 534 option (google.api.http) = { 535 get: "/v2/{parent=projects/*/locations/*}/discoveryConfigs" 536 additional_bindings { 537 get: "/v2/{parent=organizations/*/locations/*}/discoveryConfigs" 538 } 539 }; 540 option (google.api.method_signature) = "parent"; 541 } 542 543 // Deletes a discovery configuration. 544 rpc DeleteDiscoveryConfig(DeleteDiscoveryConfigRequest) 545 returns (google.protobuf.Empty) { 546 option (google.api.http) = { 547 delete: "/v2/{name=projects/*/locations/*/discoveryConfigs/*}" 548 additional_bindings { 549 delete: "/v2/{name=organizations/*/locations/*/discoveryConfigs/*}" 550 } 551 }; 552 option (google.api.method_signature) = "name"; 553 } 554 555 // Creates a new job to inspect storage or calculate risk metrics. 556 // See 557 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage 558 // and 559 // https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis 560 // to learn more. 561 // 562 // When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the 563 // system will automatically choose what detectors to run. By default this may 564 // be all types, but may change over time as detectors are updated. 565 rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) { 566 option (google.api.http) = { 567 post: "/v2/{parent=projects/*}/dlpJobs" 568 body: "*" 569 additional_bindings { 570 post: "/v2/{parent=projects/*/locations/*}/dlpJobs" 571 body: "*" 572 } 573 }; 574 option (google.api.method_signature) = "parent,inspect_job"; 575 option (google.api.method_signature) = "parent,risk_job"; 576 } 577 578 // Lists DlpJobs that match the specified filter in the request. 579 // See 580 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage 581 // and 582 // https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis 583 // to learn more. 584 rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) { 585 option (google.api.http) = { 586 get: "/v2/{parent=projects/*}/dlpJobs" 587 additional_bindings { get: "/v2/{parent=projects/*/locations/*}/dlpJobs" } 588 additional_bindings { 589 get: "/v2/{parent=organizations/*/locations/*}/dlpJobs" 590 } 591 }; 592 option (google.api.method_signature) = "parent"; 593 } 594 595 // Gets the latest state of a long-running DlpJob. 596 // See 597 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage 598 // and 599 // https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis 600 // to learn more. 601 rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) { 602 option (google.api.http) = { 603 get: "/v2/{name=projects/*/dlpJobs/*}" 604 additional_bindings { get: "/v2/{name=projects/*/locations/*/dlpJobs/*}" } 605 }; 606 option (google.api.method_signature) = "name"; 607 } 608 609 // Deletes a long-running DlpJob. This method indicates that the client is 610 // no longer interested in the DlpJob result. The job will be canceled if 611 // possible. 612 // See 613 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage 614 // and 615 // https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis 616 // to learn more. 617 rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) { 618 option (google.api.http) = { 619 delete: "/v2/{name=projects/*/dlpJobs/*}" 620 additional_bindings { 621 delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}" 622 } 623 }; 624 option (google.api.method_signature) = "name"; 625 } 626 627 // Starts asynchronous cancellation on a long-running DlpJob. The server 628 // makes a best effort to cancel the DlpJob, but success is not 629 // guaranteed. 630 // See 631 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage 632 // and 633 // https://cloud.google.com/sensitive-data-protection/docs/compute-risk-analysis 634 // to learn more. 635 rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) { 636 option (google.api.http) = { 637 post: "/v2/{name=projects/*/dlpJobs/*}:cancel" 638 body: "*" 639 additional_bindings { 640 post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel" 641 body: "*" 642 } 643 }; 644 } 645 646 // Creates a pre-built stored infoType to be used for inspection. 647 // See 648 // https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes 649 // to learn more. 650 rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) 651 returns (StoredInfoType) { 652 option (google.api.http) = { 653 post: "/v2/{parent=organizations/*}/storedInfoTypes" 654 body: "*" 655 additional_bindings { 656 post: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" 657 body: "*" 658 } 659 additional_bindings { 660 post: "/v2/{parent=projects/*}/storedInfoTypes" 661 body: "*" 662 } 663 additional_bindings { 664 post: "/v2/{parent=projects/*/locations/*}/storedInfoTypes" 665 body: "*" 666 } 667 }; 668 option (google.api.method_signature) = "parent,config"; 669 } 670 671 // Updates the stored infoType by creating a new version. The existing version 672 // will continue to be used until the new version is ready. 673 // See 674 // https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes 675 // to learn more. 676 rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) 677 returns (StoredInfoType) { 678 option (google.api.http) = { 679 patch: "/v2/{name=organizations/*/storedInfoTypes/*}" 680 body: "*" 681 additional_bindings { 682 patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" 683 body: "*" 684 } 685 additional_bindings { 686 patch: "/v2/{name=projects/*/storedInfoTypes/*}" 687 body: "*" 688 } 689 additional_bindings { 690 patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" 691 body: "*" 692 } 693 }; 694 option (google.api.method_signature) = "name,config,update_mask"; 695 } 696 697 // Gets a stored infoType. 698 // See 699 // https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes 700 // to learn more. 701 rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) { 702 option (google.api.http) = { 703 get: "/v2/{name=organizations/*/storedInfoTypes/*}" 704 additional_bindings { 705 get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" 706 } 707 additional_bindings { get: "/v2/{name=projects/*/storedInfoTypes/*}" } 708 additional_bindings { 709 get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" 710 } 711 }; 712 option (google.api.method_signature) = "name"; 713 } 714 715 // Lists stored infoTypes. 716 // See 717 // https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes 718 // to learn more. 719 rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) 720 returns (ListStoredInfoTypesResponse) { 721 option (google.api.http) = { 722 get: "/v2/{parent=organizations/*}/storedInfoTypes" 723 additional_bindings { 724 get: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes" 725 } 726 additional_bindings { get: "/v2/{parent=projects/*}/storedInfoTypes" } 727 additional_bindings { 728 get: "/v2/{parent=projects/*/locations/*}/storedInfoTypes" 729 } 730 }; 731 option (google.api.method_signature) = "parent"; 732 } 733 734 // Deletes a stored infoType. 735 // See 736 // https://cloud.google.com/sensitive-data-protection/docs/creating-stored-infotypes 737 // to learn more. 738 rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) 739 returns (google.protobuf.Empty) { 740 option (google.api.http) = { 741 delete: "/v2/{name=organizations/*/storedInfoTypes/*}" 742 additional_bindings { 743 delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}" 744 } 745 additional_bindings { delete: "/v2/{name=projects/*/storedInfoTypes/*}" } 746 additional_bindings { 747 delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}" 748 } 749 }; 750 option (google.api.method_signature) = "name"; 751 } 752 753 // Lists data profiles for an organization. 754 rpc ListProjectDataProfiles(ListProjectDataProfilesRequest) 755 returns (ListProjectDataProfilesResponse) { 756 option (google.api.http) = { 757 get: "/v2/{parent=organizations/*/locations/*}/projectDataProfiles" 758 additional_bindings { 759 get: "/v2/{parent=projects/*/locations/*}/projectDataProfiles" 760 } 761 }; 762 option (google.api.method_signature) = "parent"; 763 } 764 765 // Lists data profiles for an organization. 766 rpc ListTableDataProfiles(ListTableDataProfilesRequest) 767 returns (ListTableDataProfilesResponse) { 768 option (google.api.http) = { 769 get: "/v2/{parent=organizations/*/locations/*}/tableDataProfiles" 770 additional_bindings { 771 get: "/v2/{parent=projects/*/locations/*}/tableDataProfiles" 772 } 773 }; 774 option (google.api.method_signature) = "parent"; 775 } 776 777 // Lists data profiles for an organization. 778 rpc ListColumnDataProfiles(ListColumnDataProfilesRequest) 779 returns (ListColumnDataProfilesResponse) { 780 option (google.api.http) = { 781 get: "/v2/{parent=organizations/*/locations/*}/columnDataProfiles" 782 additional_bindings { 783 get: "/v2/{parent=projects/*/locations/*}/columnDataProfiles" 784 } 785 }; 786 option (google.api.method_signature) = "parent"; 787 } 788 789 // Gets a project data profile. 790 rpc GetProjectDataProfile(GetProjectDataProfileRequest) 791 returns (ProjectDataProfile) { 792 option (google.api.http) = { 793 get: "/v2/{name=organizations/*/locations/*/projectDataProfiles/*}" 794 additional_bindings { 795 get: "/v2/{name=projects/*/locations/*/projectDataProfiles/*}" 796 } 797 }; 798 option (google.api.method_signature) = "name"; 799 } 800 801 // Gets a table data profile. 802 rpc GetTableDataProfile(GetTableDataProfileRequest) 803 returns (TableDataProfile) { 804 option (google.api.http) = { 805 get: "/v2/{name=organizations/*/locations/*/tableDataProfiles/*}" 806 additional_bindings { 807 get: "/v2/{name=projects/*/locations/*/tableDataProfiles/*}" 808 } 809 }; 810 option (google.api.method_signature) = "name"; 811 } 812 813 // Gets a column data profile. 814 rpc GetColumnDataProfile(GetColumnDataProfileRequest) 815 returns (ColumnDataProfile) { 816 option (google.api.http) = { 817 get: "/v2/{name=organizations/*/locations/*/columnDataProfiles/*}" 818 additional_bindings { 819 get: "/v2/{name=projects/*/locations/*/columnDataProfiles/*}" 820 } 821 }; 822 option (google.api.method_signature) = "name"; 823 } 824 825 // Inspect hybrid content and store findings to a job. 826 // To review the findings, inspect the job. Inspection will occur 827 // asynchronously. 828 rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) 829 returns (HybridInspectResponse) { 830 option (google.api.http) = { 831 post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect" 832 body: "*" 833 }; 834 option (google.api.method_signature) = "name"; 835 } 836 837 // Finish a running hybrid DlpJob. Triggers the finalization steps and running 838 // of any enabled actions that have not yet run. 839 rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) { 840 option (google.api.http) = { 841 post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish" 842 body: "*" 843 }; 844 } 845} 846 847// List of excluded infoTypes. 848message ExcludeInfoTypes { 849 // InfoType list in ExclusionRule rule drops a finding when it overlaps or 850 // contained within with a finding of an infoType from this list. For 851 // example, for `InspectionRuleSet.info_types` containing "PHONE_NUMBER"` and 852 // `exclusion_rule` containing `exclude_info_types.info_types` with 853 // "EMAIL_ADDRESS" the phone number findings are dropped if they overlap 854 // with EMAIL_ADDRESS finding. 855 // That leads to "[email protected]" to generate only a single 856 // finding, namely email address. 857 repeated InfoType info_types = 1; 858} 859 860// The rule to exclude findings based on a hotword. For record inspection of 861// tables, column names are considered hotwords. An example of this is to 862// exclude a finding if it belongs to a BigQuery column that matches a specific 863// pattern. 864message ExcludeByHotword { 865 // Regular expression pattern defining what qualifies as a hotword. 866 CustomInfoType.Regex hotword_regex = 1; 867 868 // Range of characters within which the entire hotword must reside. 869 // The total length of the window cannot exceed 1000 characters. 870 // The windowBefore property in proximity should be set to 1 if the hotword 871 // needs to be included in a column header. 872 CustomInfoType.DetectionRule.Proximity proximity = 2; 873} 874 875// The rule that specifies conditions when findings of infoTypes specified in 876// `InspectionRuleSet` are removed from results. 877message ExclusionRule { 878 // Exclusion rule types. 879 oneof type { 880 // Dictionary which defines the rule. 881 CustomInfoType.Dictionary dictionary = 1; 882 883 // Regular expression which defines the rule. 884 CustomInfoType.Regex regex = 2; 885 886 // Set of infoTypes for which findings would affect this rule. 887 ExcludeInfoTypes exclude_info_types = 3; 888 889 // Drop if the hotword rule is contained in the proximate context. For 890 // tabular data, the context includes the column name. 891 ExcludeByHotword exclude_by_hotword = 5; 892 } 893 894 // How the rule is applied, see MatchingType documentation for details. 895 MatchingType matching_type = 4; 896} 897 898// A single inspection rule to be applied to infoTypes, specified in 899// `InspectionRuleSet`. 900message InspectionRule { 901 // Inspection rule types. 902 oneof type { 903 // Hotword-based detection rule. 904 CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1; 905 906 // Exclusion rule. 907 ExclusionRule exclusion_rule = 2; 908 } 909} 910 911// Rule set for modifying a set of infoTypes to alter behavior under certain 912// circumstances, depending on the specific details of the rules within the set. 913message InspectionRuleSet { 914 // List of infoTypes this rule set is applied to. 915 repeated InfoType info_types = 1; 916 917 // Set of rules to be applied to infoTypes. The rules are applied in order. 918 repeated InspectionRule rules = 2; 919} 920 921// Configuration description of the scanning process. 922// When used with redactContent only info_types and min_likelihood are currently 923// used. 924message InspectConfig { 925 // Configuration for setting a minimum likelihood per infotype. Used to 926 // customize the minimum likelihood level for specific infotypes in the 927 // request. For example, use this if you want to lower the precision for 928 // PERSON_NAME without lowering the precision for the other infotypes in the 929 // request. 930 message InfoTypeLikelihood { 931 // Type of information the likelihood threshold applies to. Only one 932 // likelihood per info_type should be provided. If InfoTypeLikelihood does 933 // not have an info_type, the configuration fails. 934 InfoType info_type = 1; 935 936 // Only returns findings equal to or above this threshold. This field is 937 // required or else the configuration fails. 938 Likelihood min_likelihood = 2; 939 } 940 941 // Configuration to control the number of findings returned for inspection. 942 // This is not used for de-identification or data profiling. 943 // 944 // When redacting sensitive data from images, finding limits don't apply. They 945 // can cause unexpected or inconsistent results, where only some data is 946 // redacted. Don't include finding limits in 947 // [RedactImage][google.privacy.dlp.v2.DlpService.RedactImage] 948 // requests. Otherwise, Cloud DLP returns an error. 949 message FindingLimits { 950 // Max findings configuration per infoType, per content item or long 951 // running DlpJob. 952 message InfoTypeLimit { 953 // Type of information the findings limit applies to. Only one limit per 954 // info_type should be provided. If InfoTypeLimit does not have an 955 // info_type, the DLP API applies the limit against all info_types that 956 // are found but not specified in another InfoTypeLimit. 957 InfoType info_type = 1; 958 959 // Max findings limit for the given infoType. 960 int32 max_findings = 2; 961 } 962 963 // Max number of findings that are returned for each item scanned. 964 // 965 // When set within an 966 // [InspectContentRequest][google.privacy.dlp.v2.InspectContentRequest], 967 // this field is ignored. 968 // 969 // This value isn't a hard limit. If the number of findings for an item 970 // reaches this limit, the inspection of that item ends gradually, not 971 // abruptly. Therefore, the actual number of findings that Cloud DLP returns 972 // for the item can be multiple times higher than this value. 973 int32 max_findings_per_item = 1; 974 975 // Max number of findings that are returned per request or job. 976 // 977 // If you set this field in an 978 // [InspectContentRequest][google.privacy.dlp.v2.InspectContentRequest], the 979 // resulting maximum value is the value that you set or 3,000, whichever is 980 // lower. 981 // 982 // This value isn't a hard limit. If an inspection reaches this limit, the 983 // inspection ends gradually, not abruptly. Therefore, the actual number of 984 // findings that Cloud DLP returns can be multiple times higher than this 985 // value. 986 int32 max_findings_per_request = 2; 987 988 // Configuration of findings limit given for specified infoTypes. 989 repeated InfoTypeLimit max_findings_per_info_type = 3; 990 } 991 992 // Restricts what info_types to look for. The values must correspond to 993 // InfoType values returned by ListInfoTypes or listed at 994 // https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference. 995 // 996 // When no InfoTypes or CustomInfoTypes are specified in a request, the 997 // system may automatically choose a default list of detectors to run, which 998 // may change over time. 999 // 1000 // If you need precise control and predictability as to what detectors are 1001 // run you should specify specific InfoTypes listed in the reference, 1002 // otherwise a default list will be used, which may change over time. 1003 repeated InfoType info_types = 1; 1004 1005 // Only returns findings equal to or above this threshold. The default is 1006 // POSSIBLE. 1007 // 1008 // In general, the highest likelihood setting yields the fewest findings in 1009 // results and the lowest chance of a false positive. For more information, 1010 // see [Match 1011 // likelihood](https://cloud.google.com/sensitive-data-protection/docs/likelihood). 1012 Likelihood min_likelihood = 2; 1013 1014 // Minimum likelihood per infotype. For each infotype, a user can specify a 1015 // minimum likelihood. The system only returns a finding if its likelihood is 1016 // above this threshold. If this field is not set, the system uses the 1017 // InspectConfig min_likelihood. 1018 repeated InfoTypeLikelihood min_likelihood_per_info_type = 11; 1019 1020 // Configuration to control the number of findings returned. 1021 // This is not used for data profiling. 1022 // 1023 // When redacting sensitive data from images, finding limits don't apply. They 1024 // can cause unexpected or inconsistent results, where only some data is 1025 // redacted. Don't include finding limits in 1026 // [RedactImage][google.privacy.dlp.v2.DlpService.RedactImage] 1027 // requests. Otherwise, Cloud DLP returns an error. 1028 // 1029 // When set within an 1030 // [InspectJobConfig][google.privacy.dlp.v2.InspectJobConfig], the specified 1031 // maximum values aren't hard limits. If an inspection job reaches these 1032 // limits, the job ends gradually, not abruptly. Therefore, the actual number 1033 // of findings that Cloud DLP returns can be multiple times higher than these 1034 // maximum values. 1035 FindingLimits limits = 3; 1036 1037 // When true, a contextual quote from the data that triggered a finding is 1038 // included in the response; see 1039 // [Finding.quote][google.privacy.dlp.v2.Finding.quote]. This is not used for 1040 // data profiling. 1041 bool include_quote = 4; 1042 1043 // When true, excludes type information of the findings. 1044 // This is not used for data profiling. 1045 bool exclude_info_types = 5; 1046 1047 // CustomInfoTypes provided by the user. See 1048 // https://cloud.google.com/sensitive-data-protection/docs/creating-custom-infotypes 1049 // to learn more. 1050 repeated CustomInfoType custom_info_types = 6; 1051 1052 // Deprecated and unused. 1053 repeated ContentOption content_options = 8; 1054 1055 // Set of rules to apply to the findings for this InspectConfig. 1056 // Exclusion rules, contained in the set are executed in the end, other 1057 // rules are executed in the order they are specified for each info type. 1058 repeated InspectionRuleSet rule_set = 10; 1059} 1060 1061// Container for bytes to inspect or redact. 1062message ByteContentItem { 1063 // The type of data being sent for inspection. To learn more, see 1064 // [Supported file 1065 // types](https://cloud.google.com/sensitive-data-protection/docs/supported-file-types). 1066 enum BytesType { 1067 // Unused 1068 BYTES_TYPE_UNSPECIFIED = 0; 1069 1070 // Any image type. 1071 IMAGE = 6; 1072 1073 // jpeg 1074 IMAGE_JPEG = 1; 1075 1076 // bmp 1077 IMAGE_BMP = 2; 1078 1079 // png 1080 IMAGE_PNG = 3; 1081 1082 // svg 1083 IMAGE_SVG = 4; 1084 1085 // plain text 1086 TEXT_UTF8 = 5; 1087 1088 // docx, docm, dotx, dotm 1089 WORD_DOCUMENT = 7; 1090 1091 // pdf 1092 PDF = 8; 1093 1094 // pptx, pptm, potx, potm, pot 1095 POWERPOINT_DOCUMENT = 9; 1096 1097 // xlsx, xlsm, xltx, xltm 1098 EXCEL_DOCUMENT = 10; 1099 1100 // avro 1101 AVRO = 11; 1102 1103 // csv 1104 CSV = 12; 1105 1106 // tsv 1107 TSV = 13; 1108 } 1109 1110 // The type of data stored in the bytes string. Default will be TEXT_UTF8. 1111 BytesType type = 1; 1112 1113 // Content data to inspect or redact. 1114 bytes data = 2; 1115} 1116 1117// Type of content to inspect. 1118message ContentItem { 1119 // Data of the item either in the byte array or UTF-8 string form, or table. 1120 oneof data_item { 1121 // String data to inspect or redact. 1122 string value = 3; 1123 1124 // Structured content for inspection. See 1125 // https://cloud.google.com/sensitive-data-protection/docs/inspecting-text#inspecting_a_table 1126 // to learn more. 1127 Table table = 4; 1128 1129 // Content data to inspect or redact. Replaces `type` and `data`. 1130 ByteContentItem byte_item = 5; 1131 } 1132} 1133 1134// Structured content to inspect. Up to 50,000 `Value`s per request allowed. See 1135// https://cloud.google.com/sensitive-data-protection/docs/inspecting-structured-text#inspecting_a_table 1136// to learn more. 1137message Table { 1138 // Values of the row. 1139 message Row { 1140 // Individual cells. 1141 repeated Value values = 1; 1142 } 1143 1144 // Headers of the table. 1145 repeated FieldId headers = 1; 1146 1147 // Rows of the table. 1148 repeated Row rows = 2; 1149} 1150 1151// All the findings for a single scanned item. 1152message InspectResult { 1153 // List of findings for an item. 1154 repeated Finding findings = 1; 1155 1156 // If true, then this item might have more findings than were returned, 1157 // and the findings returned are an arbitrary subset of all findings. 1158 // The findings list might be truncated because the input items were too 1159 // large, or because the server reached the maximum amount of resources 1160 // allowed for a single API call. For best results, divide the input into 1161 // smaller batches. 1162 bool findings_truncated = 2; 1163} 1164 1165// Represents a piece of potentially sensitive content. 1166message Finding { 1167 option (google.api.resource) = { 1168 type: "dlp.googleapis.com/Finding" 1169 pattern: "projects/{project}/locations/{location}/findings/{finding}" 1170 }; 1171 1172 // Resource name in format 1173 // projects/{project}/locations/{location}/findings/{finding} Populated only 1174 // when viewing persisted findings. 1175 string name = 14; 1176 1177 // The content that was found. Even if the content is not textual, it 1178 // may be converted to a textual representation here. 1179 // Provided if `include_quote` is true and the finding is 1180 // less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes 1181 // in length, the quote may be omitted. 1182 string quote = 1; 1183 1184 // The type of content that might have been found. 1185 // Provided if `excluded_types` is false. 1186 InfoType info_type = 2; 1187 1188 // Confidence of how likely it is that the `info_type` is correct. 1189 Likelihood likelihood = 3; 1190 1191 // Where the content was found. 1192 Location location = 4; 1193 1194 // Timestamp when finding was detected. 1195 google.protobuf.Timestamp create_time = 6; 1196 1197 // Contains data parsed from quotes. Only populated if include_quote was set 1198 // to true and a supported infoType was requested. Currently supported 1199 // infoTypes: DATE, DATE_OF_BIRTH and TIME. 1200 QuoteInfo quote_info = 7; 1201 1202 // The job that stored the finding. 1203 string resource_name = 8 1204 [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; 1205 1206 // Job trigger name, if applicable, for this finding. 1207 string trigger_name = 9 [ 1208 (google.api.resource_reference) = { type: "dlp.googleapis.com/JobTrigger" } 1209 ]; 1210 1211 // The labels associated with this `Finding`. 1212 // 1213 // Label keys must be between 1 and 63 characters long and must conform 1214 // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. 1215 // 1216 // Label values must be between 0 and 63 characters long and must conform 1217 // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. 1218 // 1219 // No more than 10 labels can be associated with a given finding. 1220 // 1221 // Examples: 1222 // * `"environment" : "production"` 1223 // * `"pipeline" : "etl"` 1224 map<string, string> labels = 10; 1225 1226 // Time the job started that produced this finding. 1227 google.protobuf.Timestamp job_create_time = 11; 1228 1229 // The job that stored the finding. 1230 string job_name = 13 1231 [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; 1232 1233 // The unique finding id. 1234 string finding_id = 15; 1235} 1236 1237// Specifies the location of the finding. 1238message Location { 1239 // Zero-based byte offsets delimiting the finding. 1240 // These are relative to the finding's containing element. 1241 // Note that when the content is not textual, this references 1242 // the UTF-8 encoded textual representation of the content. 1243 // Omitted if content is an image. 1244 Range byte_range = 1; 1245 1246 // Unicode character offsets delimiting the finding. 1247 // These are relative to the finding's containing element. 1248 // Provided when the content is text. 1249 Range codepoint_range = 2; 1250 1251 // List of nested objects pointing to the precise location of the finding 1252 // within the file or record. 1253 repeated ContentLocation content_locations = 7; 1254 1255 // Information about the container where this finding occurred, if available. 1256 Container container = 8; 1257} 1258 1259// Precise location of the finding within a document, record, image, or metadata 1260// container. 1261message ContentLocation { 1262 // Name of the container where the finding is located. 1263 // The top level name is the source file name or table name. Names of some 1264 // common storage containers are formatted as follows: 1265 // 1266 // * BigQuery tables: `{project_id}:{dataset_id}.{table_id}` 1267 // * Cloud Storage files: `gs://{bucket}/{path}` 1268 // * Datastore namespace: {namespace} 1269 // 1270 // Nested names could be absent if the embedded object has no string 1271 // identifier (for example, an image contained within a document). 1272 string container_name = 1; 1273 1274 // Type of the container within the file with location of the finding. 1275 oneof location { 1276 // Location within a row or record of a database table. 1277 RecordLocation record_location = 2; 1278 1279 // Location within an image's pixels. 1280 ImageLocation image_location = 3; 1281 1282 // Location data for document files. 1283 DocumentLocation document_location = 5; 1284 1285 // Location within the metadata for inspected content. 1286 MetadataLocation metadata_location = 8; 1287 } 1288 1289 // Finding container modification timestamp, if applicable. For Cloud Storage, 1290 // this field contains the last file modification timestamp. For a BigQuery 1291 // table, this field contains the last_modified_time property. For Datastore, 1292 // this field isn't populated. 1293 google.protobuf.Timestamp container_timestamp = 6; 1294 1295 // Finding container version, if available 1296 // ("generation" for Cloud Storage). 1297 string container_version = 7; 1298} 1299 1300// Metadata Location 1301message MetadataLocation { 1302 // Type of metadata containing the finding. 1303 MetadataType type = 1; 1304 1305 // Label of the piece of metadata containing the finding, for example - 1306 // latitude, author, caption. 1307 oneof label { 1308 // Storage metadata. 1309 StorageMetadataLabel storage_label = 3; 1310 } 1311} 1312 1313// Storage metadata label to indicate which metadata entry contains findings. 1314message StorageMetadataLabel { 1315 // Label name. 1316 string key = 1; 1317} 1318 1319// Location of a finding within a document. 1320message DocumentLocation { 1321 // Offset of the line, from the beginning of the file, where the finding 1322 // is located. 1323 int64 file_offset = 1; 1324} 1325 1326// Location of a finding within a row or record. 1327message RecordLocation { 1328 // Key of the finding. 1329 RecordKey record_key = 1; 1330 1331 // Field id of the field containing the finding. 1332 FieldId field_id = 2; 1333 1334 // Location within a `ContentItem.Table`. 1335 TableLocation table_location = 3; 1336} 1337 1338// Location of a finding within a table. 1339message TableLocation { 1340 // The zero-based index of the row where the finding is located. Only 1341 // populated for resources that have a natural ordering, not BigQuery. In 1342 // BigQuery, to identify the row a finding came from, populate 1343 // BigQueryOptions.identifying_fields with your primary key column names and 1344 // when you store the findings the value of those columns will be stored 1345 // inside of Finding. 1346 int64 row_index = 1; 1347} 1348 1349// Represents a container that may contain DLP findings. 1350// Examples of a container include a file, table, or database record. 1351message Container { 1352 // Container type, for example BigQuery or Cloud Storage. 1353 string type = 1; 1354 1355 // Project where the finding was found. 1356 // Can be different from the project that owns the finding. 1357 string project_id = 2; 1358 1359 // A string representation of the full container name. 1360 // Examples: 1361 // - BigQuery: 'Project:DataSetId.TableId' 1362 // - Cloud Storage: 'gs://Bucket/folders/filename.txt' 1363 string full_path = 3; 1364 1365 // The root of the container. 1366 // Examples: 1367 // 1368 // - For BigQuery table `project_id:dataset_id.table_id`, the root is 1369 // `dataset_id` 1370 // - For Cloud Storage file `gs://bucket/folder/filename.txt`, the root 1371 // is `gs://bucket` 1372 string root_path = 4; 1373 1374 // The rest of the path after the root. 1375 // Examples: 1376 // 1377 // - For BigQuery table `project_id:dataset_id.table_id`, the relative path is 1378 // `table_id` 1379 // - For Cloud Storage file `gs://bucket/folder/filename.txt`, the relative 1380 // path is `folder/filename.txt` 1381 string relative_path = 5; 1382 1383 // Findings container modification timestamp, if applicable. For Cloud 1384 // Storage, this field contains the last file modification timestamp. For a 1385 // BigQuery table, this field contains the last_modified_time property. For 1386 // Datastore, this field isn't populated. 1387 google.protobuf.Timestamp update_time = 6; 1388 1389 // Findings container version, if available 1390 // ("generation" for Cloud Storage). 1391 string version = 7; 1392} 1393 1394// Generic half-open interval [start, end) 1395message Range { 1396 // Index of the first character of the range (inclusive). 1397 int64 start = 1; 1398 1399 // Index of the last character of the range (exclusive). 1400 int64 end = 2; 1401} 1402 1403// Location of the finding within an image. 1404message ImageLocation { 1405 // Bounding boxes locating the pixels within the image containing the finding. 1406 repeated BoundingBox bounding_boxes = 1; 1407} 1408 1409// Bounding box encompassing detected text within an image. 1410message BoundingBox { 1411 // Top coordinate of the bounding box. (0,0) is upper left. 1412 int32 top = 1; 1413 1414 // Left coordinate of the bounding box. (0,0) is upper left. 1415 int32 left = 2; 1416 1417 // Width of the bounding box in pixels. 1418 int32 width = 3; 1419 1420 // Height of the bounding box in pixels. 1421 int32 height = 4; 1422} 1423 1424// Request to search for potentially sensitive info in an image and redact it 1425// by covering it with a colored rectangle. 1426message RedactImageRequest { 1427 // Configuration for determining how redaction of images should occur. 1428 message ImageRedactionConfig { 1429 // Type of information to redact from images. 1430 oneof target { 1431 // Only one per info_type should be provided per request. If not 1432 // specified, and redact_all_text is false, the DLP API will redact all 1433 // text that it matches against all info_types that are found, but not 1434 // specified in another ImageRedactionConfig. 1435 InfoType info_type = 1; 1436 1437 // If true, all text found in the image, regardless whether it matches an 1438 // info_type, is redacted. Only one should be provided. 1439 bool redact_all_text = 2; 1440 } 1441 1442 // The color to use when redacting content from an image. If not specified, 1443 // the default is black. 1444 Color redaction_color = 3; 1445 } 1446 1447 // Parent resource name. 1448 // 1449 // The format of this value varies depending on whether you have [specified a 1450 // processing 1451 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 1452 // 1453 // + Projects scope, location specified:<br/> 1454 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 1455 // + Projects scope, no location specified (defaults to global):<br/> 1456 // `projects/`<var>PROJECT_ID</var> 1457 // 1458 // The following example `parent` string specifies a parent project with the 1459 // identifier `example-project`, and specifies the `europe-west3` location 1460 // for processing data: 1461 // 1462 // parent=projects/example-project/locations/europe-west3 1463 string parent = 1 [(google.api.resource_reference) = { 1464 child_type: "dlp.googleapis.com/DlpContent" 1465 }]; 1466 1467 // Deprecated. This field has no effect. 1468 string location_id = 8; 1469 1470 // Configuration for the inspector. 1471 InspectConfig inspect_config = 2; 1472 1473 // The configuration for specifying what content to redact from images. 1474 repeated ImageRedactionConfig image_redaction_configs = 5; 1475 1476 // Whether the response should include findings along with the redacted 1477 // image. 1478 bool include_findings = 6; 1479 1480 // The content must be PNG, JPEG, SVG or BMP. 1481 ByteContentItem byte_item = 7; 1482} 1483 1484// Represents a color in the RGB color space. 1485message Color { 1486 // The amount of red in the color as a value in the interval [0, 1]. 1487 float red = 1; 1488 1489 // The amount of green in the color as a value in the interval [0, 1]. 1490 float green = 2; 1491 1492 // The amount of blue in the color as a value in the interval [0, 1]. 1493 float blue = 3; 1494} 1495 1496// Results of redacting an image. 1497message RedactImageResponse { 1498 // The redacted image. The type will be the same as the original image. 1499 bytes redacted_image = 1; 1500 1501 // If an image was being inspected and the InspectConfig's include_quote was 1502 // set to true, then this field will include all text, if any, that was found 1503 // in the image. 1504 string extracted_text = 2; 1505 1506 // The findings. Populated when include_findings in the request is true. 1507 InspectResult inspect_result = 3; 1508} 1509 1510// Request to de-identify a ContentItem. 1511message DeidentifyContentRequest { 1512 // Parent resource name. 1513 // 1514 // The format of this value varies depending on whether you have [specified a 1515 // processing 1516 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 1517 // 1518 // + Projects scope, location specified:<br/> 1519 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 1520 // + Projects scope, no location specified (defaults to global):<br/> 1521 // `projects/`<var>PROJECT_ID</var> 1522 // 1523 // The following example `parent` string specifies a parent project with the 1524 // identifier `example-project`, and specifies the `europe-west3` location 1525 // for processing data: 1526 // 1527 // parent=projects/example-project/locations/europe-west3 1528 string parent = 1 [(google.api.resource_reference) = { 1529 child_type: "dlp.googleapis.com/DlpContent" 1530 }]; 1531 1532 // Configuration for the de-identification of the content item. 1533 // Items specified here will override the template referenced by the 1534 // deidentify_template_name argument. 1535 DeidentifyConfig deidentify_config = 2; 1536 1537 // Configuration for the inspector. 1538 // Items specified here will override the template referenced by the 1539 // inspect_template_name argument. 1540 InspectConfig inspect_config = 3; 1541 1542 // The item to de-identify. Will be treated as text. 1543 // 1544 // This value must be of type 1545 // [Table][google.privacy.dlp.v2.Table] if your 1546 // [deidentify_config][google.privacy.dlp.v2.DeidentifyContentRequest.deidentify_config] 1547 // is a 1548 // [RecordTransformations][google.privacy.dlp.v2.RecordTransformations] 1549 // object. 1550 ContentItem item = 4; 1551 1552 // Template to use. Any configuration directly specified in 1553 // inspect_config will override those set in the template. Singular fields 1554 // that are set in this request will replace their corresponding fields in the 1555 // template. Repeated fields are appended. Singular sub-messages and groups 1556 // are recursively merged. 1557 string inspect_template_name = 5; 1558 1559 // Template to use. Any configuration directly specified in 1560 // deidentify_config will override those set in the template. Singular fields 1561 // that are set in this request will replace their corresponding fields in the 1562 // template. Repeated fields are appended. Singular sub-messages and groups 1563 // are recursively merged. 1564 string deidentify_template_name = 6; 1565 1566 // Deprecated. This field has no effect. 1567 string location_id = 7; 1568} 1569 1570// Results of de-identifying a ContentItem. 1571message DeidentifyContentResponse { 1572 // The de-identified item. 1573 ContentItem item = 1; 1574 1575 // An overview of the changes that were made on the `item`. 1576 TransformationOverview overview = 2; 1577} 1578 1579// Request to re-identify an item. 1580message ReidentifyContentRequest { 1581 // Required. Parent resource name. 1582 // 1583 // The format of this value varies depending on whether you have [specified a 1584 // processing 1585 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 1586 // 1587 // + Projects scope, location specified:<br/> 1588 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 1589 // + Projects scope, no location specified (defaults to global):<br/> 1590 // `projects/`<var>PROJECT_ID</var> 1591 // 1592 // The following example `parent` string specifies a parent project with the 1593 // identifier `example-project`, and specifies the `europe-west3` location 1594 // for processing data: 1595 // 1596 // parent=projects/example-project/locations/europe-west3 1597 string parent = 1 [ 1598 (google.api.field_behavior) = REQUIRED, 1599 (google.api.resource_reference) = { 1600 child_type: "dlp.googleapis.com/DlpContent" 1601 } 1602 ]; 1603 1604 // Configuration for the re-identification of the content item. 1605 // This field shares the same proto message type that is used for 1606 // de-identification, however its usage here is for the reversal of the 1607 // previous de-identification. Re-identification is performed by examining 1608 // the transformations used to de-identify the items and executing the 1609 // reverse. This requires that only reversible transformations 1610 // be provided here. The reversible transformations are: 1611 // 1612 // - `CryptoDeterministicConfig` 1613 // - `CryptoReplaceFfxFpeConfig` 1614 DeidentifyConfig reidentify_config = 2; 1615 1616 // Configuration for the inspector. 1617 InspectConfig inspect_config = 3; 1618 1619 // The item to re-identify. Will be treated as text. 1620 ContentItem item = 4; 1621 1622 // Template to use. Any configuration directly specified in 1623 // `inspect_config` will override those set in the template. Singular fields 1624 // that are set in this request will replace their corresponding fields in the 1625 // template. Repeated fields are appended. Singular sub-messages and groups 1626 // are recursively merged. 1627 string inspect_template_name = 5; 1628 1629 // Template to use. References an instance of `DeidentifyTemplate`. 1630 // Any configuration directly specified in `reidentify_config` or 1631 // `inspect_config` will override those set in the template. The 1632 // `DeidentifyTemplate` used must include only reversible transformations. 1633 // Singular fields that are set in this request will replace their 1634 // corresponding fields in the template. Repeated fields are appended. 1635 // Singular sub-messages and groups are recursively merged. 1636 string reidentify_template_name = 6; 1637 1638 // Deprecated. This field has no effect. 1639 string location_id = 7; 1640} 1641 1642// Results of re-identifying an item. 1643message ReidentifyContentResponse { 1644 // The re-identified item. 1645 ContentItem item = 1; 1646 1647 // An overview of the changes that were made to the `item`. 1648 TransformationOverview overview = 2; 1649} 1650 1651// Request to search for potentially sensitive info in a ContentItem. 1652message InspectContentRequest { 1653 // Parent resource name. 1654 // 1655 // The format of this value varies depending on whether you have [specified a 1656 // processing 1657 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 1658 // 1659 // + Projects scope, location specified:<br/> 1660 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 1661 // + Projects scope, no location specified (defaults to global):<br/> 1662 // `projects/`<var>PROJECT_ID</var> 1663 // 1664 // The following example `parent` string specifies a parent project with the 1665 // identifier `example-project`, and specifies the `europe-west3` location 1666 // for processing data: 1667 // 1668 // parent=projects/example-project/locations/europe-west3 1669 string parent = 1 [(google.api.resource_reference) = { 1670 child_type: "dlp.googleapis.com/DlpContent" 1671 }]; 1672 1673 // Configuration for the inspector. What specified here will override 1674 // the template referenced by the inspect_template_name argument. 1675 InspectConfig inspect_config = 2; 1676 1677 // The item to inspect. 1678 ContentItem item = 3; 1679 1680 // Template to use. Any configuration directly specified in 1681 // inspect_config will override those set in the template. Singular fields 1682 // that are set in this request will replace their corresponding fields in the 1683 // template. Repeated fields are appended. Singular sub-messages and groups 1684 // are recursively merged. 1685 string inspect_template_name = 4; 1686 1687 // Deprecated. This field has no effect. 1688 string location_id = 5; 1689} 1690 1691// Results of inspecting an item. 1692message InspectContentResponse { 1693 // The findings. 1694 InspectResult result = 1; 1695} 1696 1697// Cloud repository for storing output. 1698message OutputStorageConfig { 1699 // Predefined schemas for storing findings. 1700 // Only for use with external storage. 1701 enum OutputSchema { 1702 // Unused. 1703 OUTPUT_SCHEMA_UNSPECIFIED = 0; 1704 1705 // Basic schema including only `info_type`, `quote`, `certainty`, and 1706 // `timestamp`. 1707 BASIC_COLUMNS = 1; 1708 1709 // Schema tailored to findings from scanning Cloud Storage. 1710 GCS_COLUMNS = 2; 1711 1712 // Schema tailored to findings from scanning Google Datastore. 1713 DATASTORE_COLUMNS = 3; 1714 1715 // Schema tailored to findings from scanning Google BigQuery. 1716 BIG_QUERY_COLUMNS = 4; 1717 1718 // Schema containing all columns. 1719 ALL_COLUMNS = 5; 1720 } 1721 1722 // Output storage types. 1723 oneof type { 1724 // Store findings in an existing table or a new table in an existing 1725 // dataset. If table_id is not set a new one will be generated 1726 // for you with the following format: 1727 // dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific time zone will be used 1728 // for generating the date details. 1729 // 1730 // For Inspect, each column in an existing output table must have the same 1731 // name, type, and mode of a field in the `Finding` object. 1732 // 1733 // For Risk, an existing output table should be the output of a previous 1734 // Risk analysis job run on the same source table, with the same privacy 1735 // metric and quasi-identifiers. Risk jobs that analyze the same table but 1736 // compute a different privacy metric, or use different sets of 1737 // quasi-identifiers, cannot store their results in the same table. 1738 BigQueryTable table = 1; 1739 } 1740 1741 // Schema used for writing the findings for Inspect jobs. This field is only 1742 // used for Inspect and must be unspecified for Risk jobs. Columns are derived 1743 // from the `Finding` object. If appending to an existing table, any columns 1744 // from the predefined schema that are missing will be added. No columns in 1745 // the existing table will be deleted. 1746 // 1747 // If unspecified, then all available columns will be used for a new table or 1748 // an (existing) table with no schema, and no changes will be made to an 1749 // existing table that has a schema. 1750 // Only for use with external storage. 1751 OutputSchema output_schema = 3; 1752} 1753 1754// Statistics regarding a specific InfoType. 1755message InfoTypeStats { 1756 // The type of finding this stat is for. 1757 InfoType info_type = 1; 1758 1759 // Number of findings for this infoType. 1760 int64 count = 2; 1761} 1762 1763// The results of an inspect DataSource job. 1764message InspectDataSourceDetails { 1765 // Snapshot of the inspection configuration. 1766 message RequestedOptions { 1767 // If run with an InspectTemplate, a snapshot of its state at the time of 1768 // this run. 1769 InspectTemplate snapshot_inspect_template = 1; 1770 1771 // Inspect config. 1772 InspectJobConfig job_config = 3; 1773 } 1774 1775 // All result fields mentioned below are updated while the job is processing. 1776 message Result { 1777 // Total size in bytes that were processed. 1778 int64 processed_bytes = 1; 1779 1780 // Estimate of the number of bytes to process. 1781 int64 total_estimated_bytes = 2; 1782 1783 // Statistics of how many instances of each info type were found during 1784 // inspect job. 1785 repeated InfoTypeStats info_type_stats = 3; 1786 1787 // Statistics related to the processing of hybrid inspect. 1788 HybridInspectStatistics hybrid_stats = 7; 1789 } 1790 1791 // The configuration used for this job. 1792 RequestedOptions requested_options = 2; 1793 1794 // A summary of the outcome of this inspection job. 1795 Result result = 3; 1796} 1797 1798// The schema of data to be saved to the BigQuery table when the 1799// `DataProfileAction` is enabled. 1800message DataProfileBigQueryRowSchema { 1801 // Data profile type. 1802 oneof data_profile { 1803 // Table data profile column 1804 TableDataProfile table_profile = 1; 1805 1806 // Column data profile column 1807 ColumnDataProfile column_profile = 2; 1808 } 1809} 1810 1811// Statistics related to processing hybrid inspect requests. 1812message HybridInspectStatistics { 1813 // The number of hybrid inspection requests processed within this job. 1814 int64 processed_count = 1; 1815 1816 // The number of hybrid inspection requests aborted because the job ran 1817 // out of quota or was ended before they could be processed. 1818 int64 aborted_count = 2; 1819 1820 // The number of hybrid requests currently being processed. Only populated 1821 // when called via method `getDlpJob`. 1822 // A burst of traffic may cause hybrid inspect requests to be enqueued. 1823 // Processing will take place as quickly as possible, but resource limitations 1824 // may impact how long a request is enqueued for. 1825 int64 pending_count = 3; 1826} 1827 1828// The results of an [Action][google.privacy.dlp.v2.Action]. 1829message ActionDetails { 1830 // Summary of what occurred in the actions. 1831 oneof details { 1832 // Outcome of a de-identification action. 1833 DeidentifyDataSourceDetails deidentify_details = 1; 1834 } 1835} 1836 1837// Summary of what was modified during a transformation. 1838message DeidentifyDataSourceStats { 1839 // Total size in bytes that were transformed in some way. 1840 int64 transformed_bytes = 1; 1841 1842 // Number of successfully applied transformations. 1843 int64 transformation_count = 2; 1844 1845 // Number of errors encountered while trying to apply transformations. 1846 int64 transformation_error_count = 3; 1847} 1848 1849// The results of a [Deidentify][google.privacy.dlp.v2.Action.Deidentify] action 1850// from an inspect job. 1851message DeidentifyDataSourceDetails { 1852 // De-identification options. 1853 message RequestedDeidentifyOptions { 1854 // Snapshot of the state of the `DeidentifyTemplate` from the 1855 // [Deidentify][google.privacy.dlp.v2.Action.Deidentify] action at the time 1856 // this job was run. 1857 DeidentifyTemplate snapshot_deidentify_template = 1; 1858 1859 // Snapshot of the state of the structured `DeidentifyTemplate` from the 1860 // `Deidentify` action at the time this job was run. 1861 DeidentifyTemplate snapshot_structured_deidentify_template = 2; 1862 1863 // Snapshot of the state of the image transformation `DeidentifyTemplate` 1864 // from the `Deidentify` action at the time this job was run. 1865 DeidentifyTemplate snapshot_image_redact_template = 3; 1866 } 1867 1868 // De-identification config used for the request. 1869 RequestedDeidentifyOptions requested_options = 1; 1870 1871 // Stats about the de-identification operation. 1872 DeidentifyDataSourceStats deidentify_stats = 2; 1873} 1874 1875// InfoType description. 1876message InfoTypeDescription { 1877 // Internal name of the infoType. 1878 string name = 1; 1879 1880 // Human readable form of the infoType name. 1881 string display_name = 2; 1882 1883 // Which parts of the API supports this InfoType. 1884 repeated InfoTypeSupportedBy supported_by = 3; 1885 1886 // Description of the infotype. Translated when language is provided in the 1887 // request. 1888 string description = 4; 1889 1890 // A list of available versions for the infotype. 1891 repeated VersionDescription versions = 9; 1892 1893 // The category of the infoType. 1894 repeated InfoTypeCategory categories = 10; 1895 1896 // The default sensitivity of the infoType. 1897 SensitivityScore sensitivity_score = 11; 1898} 1899 1900// Classification of infoTypes to organize them according to geographic 1901// location, industry, and data type. 1902message InfoTypeCategory { 1903 // Enum of the current locations. 1904 // We might add more locations in the future. 1905 enum LocationCategory { 1906 // Unused location 1907 LOCATION_UNSPECIFIED = 0; 1908 1909 // The infoType is not issued by or tied to a specific region, but is used 1910 // almost everywhere. 1911 GLOBAL = 1; 1912 1913 // The infoType is typically used in Argentina. 1914 ARGENTINA = 2; 1915 1916 // The infoType is typically used in Australia. 1917 AUSTRALIA = 3; 1918 1919 // The infoType is typically used in Belgium. 1920 BELGIUM = 4; 1921 1922 // The infoType is typically used in Brazil. 1923 BRAZIL = 5; 1924 1925 // The infoType is typically used in Canada. 1926 CANADA = 6; 1927 1928 // The infoType is typically used in Chile. 1929 CHILE = 7; 1930 1931 // The infoType is typically used in China. 1932 CHINA = 8; 1933 1934 // The infoType is typically used in Colombia. 1935 COLOMBIA = 9; 1936 1937 // The infoType is typically used in Croatia. 1938 CROATIA = 42; 1939 1940 // The infoType is typically used in Denmark. 1941 DENMARK = 10; 1942 1943 // The infoType is typically used in France. 1944 FRANCE = 11; 1945 1946 // The infoType is typically used in Finland. 1947 FINLAND = 12; 1948 1949 // The infoType is typically used in Germany. 1950 GERMANY = 13; 1951 1952 // The infoType is typically used in Hong Kong. 1953 HONG_KONG = 14; 1954 1955 // The infoType is typically used in India. 1956 INDIA = 15; 1957 1958 // The infoType is typically used in Indonesia. 1959 INDONESIA = 16; 1960 1961 // The infoType is typically used in Ireland. 1962 IRELAND = 17; 1963 1964 // The infoType is typically used in Israel. 1965 ISRAEL = 18; 1966 1967 // The infoType is typically used in Italy. 1968 ITALY = 19; 1969 1970 // The infoType is typically used in Japan. 1971 JAPAN = 20; 1972 1973 // The infoType is typically used in Korea. 1974 KOREA = 21; 1975 1976 // The infoType is typically used in Mexico. 1977 MEXICO = 22; 1978 1979 // The infoType is typically used in the Netherlands. 1980 THE_NETHERLANDS = 23; 1981 1982 // The infoType is typically used in New Zealand. 1983 NEW_ZEALAND = 41; 1984 1985 // The infoType is typically used in Norway. 1986 NORWAY = 24; 1987 1988 // The infoType is typically used in Paraguay. 1989 PARAGUAY = 25; 1990 1991 // The infoType is typically used in Peru. 1992 PERU = 26; 1993 1994 // The infoType is typically used in Poland. 1995 POLAND = 27; 1996 1997 // The infoType is typically used in Portugal. 1998 PORTUGAL = 28; 1999 2000 // The infoType is typically used in Singapore. 2001 SINGAPORE = 29; 2002 2003 // The infoType is typically used in South Africa. 2004 SOUTH_AFRICA = 30; 2005 2006 // The infoType is typically used in Spain. 2007 SPAIN = 31; 2008 2009 // The infoType is typically used in Sweden. 2010 SWEDEN = 32; 2011 2012 // The infoType is typically used in Switzerland. 2013 SWITZERLAND = 43; 2014 2015 // The infoType is typically used in Taiwan. 2016 TAIWAN = 33; 2017 2018 // The infoType is typically used in Thailand. 2019 THAILAND = 34; 2020 2021 // The infoType is typically used in Turkey. 2022 TURKEY = 35; 2023 2024 // The infoType is typically used in the United Kingdom. 2025 UNITED_KINGDOM = 36; 2026 2027 // The infoType is typically used in the United States. 2028 UNITED_STATES = 37; 2029 2030 // The infoType is typically used in Uruguay. 2031 URUGUAY = 38; 2032 2033 // The infoType is typically used in Venezuela. 2034 VENEZUELA = 39; 2035 2036 // The infoType is typically used in Google internally. 2037 INTERNAL = 40; 2038 } 2039 2040 // Enum of the current industries in the category. 2041 // We might add more industries in the future. 2042 enum IndustryCategory { 2043 // Unused industry 2044 INDUSTRY_UNSPECIFIED = 0; 2045 2046 // The infoType is typically used in the finance industry. 2047 FINANCE = 1; 2048 2049 // The infoType is typically used in the health industry. 2050 HEALTH = 2; 2051 2052 // The infoType is typically used in the telecommunications industry. 2053 TELECOMMUNICATIONS = 3; 2054 } 2055 2056 // Enum of the current types in the category. 2057 // We might add more types in the future. 2058 enum TypeCategory { 2059 // Unused type 2060 TYPE_UNSPECIFIED = 0; 2061 2062 // Personally identifiable information, for example, a 2063 // name or phone number 2064 PII = 1; 2065 2066 // Personally identifiable information that is especially sensitive, for 2067 // example, a passport number. 2068 SPII = 2; 2069 2070 // Attributes that can partially identify someone, especially in 2071 // combination with other attributes, like age, height, and gender. 2072 DEMOGRAPHIC = 3; 2073 2074 // Confidential or secret information, for example, a password. 2075 CREDENTIAL = 4; 2076 2077 // An identification document issued by a government. 2078 GOVERNMENT_ID = 5; 2079 2080 // A document, for example, a resume or source code. 2081 DOCUMENT = 6; 2082 2083 // Information that is not sensitive on its own, but provides details about 2084 // the circumstances surrounding an entity or an event. 2085 CONTEXTUAL_INFORMATION = 7; 2086 } 2087 2088 // Categories of infotypes. 2089 oneof category { 2090 // The region or country that issued the ID or document represented by the 2091 // infoType. 2092 LocationCategory location_category = 1; 2093 2094 // The group of relevant businesses where this infoType is commonly used 2095 IndustryCategory industry_category = 2; 2096 2097 // The class of identifiers where this infoType belongs 2098 TypeCategory type_category = 3; 2099 } 2100} 2101 2102// Details about each available version for an infotype. 2103message VersionDescription { 2104 // Name of the version 2105 string version = 1; 2106 2107 // Description of the version. 2108 string description = 2; 2109} 2110 2111// Request for the list of infoTypes. 2112message ListInfoTypesRequest { 2113 // The parent resource name. 2114 // 2115 // The format of this value is as follows: 2116 // 2117 // locations/<var>LOCATION_ID</var> 2118 string parent = 4; 2119 2120 // BCP-47 language code for localized infoType friendly 2121 // names. If omitted, or if localized strings are not available, 2122 // en-US strings will be returned. 2123 string language_code = 1; 2124 2125 // filter to only return infoTypes supported by certain parts of the 2126 // API. Defaults to supported_by=INSPECT. 2127 string filter = 2; 2128 2129 // Deprecated. This field has no effect. 2130 string location_id = 3; 2131} 2132 2133// Response to the ListInfoTypes request. 2134message ListInfoTypesResponse { 2135 // Set of sensitive infoTypes. 2136 repeated InfoTypeDescription info_types = 1; 2137} 2138 2139// Configuration for a risk analysis job. See 2140// https://cloud.google.com/sensitive-data-protection/docs/concepts-risk-analysis 2141// to learn more. 2142message RiskAnalysisJobConfig { 2143 // Privacy metric to compute. 2144 PrivacyMetric privacy_metric = 1; 2145 2146 // Input dataset to compute metrics over. 2147 BigQueryTable source_table = 2; 2148 2149 // Actions to execute at the completion of the job. Are executed in the order 2150 // provided. 2151 repeated Action actions = 3; 2152} 2153 2154// A column with a semantic tag attached. 2155message QuasiId { 2156 // Required. Identifies the column. 2157 FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; 2158 2159 // Semantic tag that identifies what a column contains, to determine which 2160 // statistical model to use to estimate the reidentifiability of each 2161 // value. [required] 2162 oneof tag { 2163 // A column can be tagged with a InfoType to use the relevant public 2164 // dataset as a statistical model of population, if available. We 2165 // currently support US ZIP codes, region codes, ages and genders. 2166 // To programmatically obtain the list of supported InfoTypes, use 2167 // ListInfoTypes with the supported_by=RISK_ANALYSIS filter. 2168 InfoType info_type = 2; 2169 2170 // A column can be tagged with a custom tag. In this case, the user must 2171 // indicate an auxiliary table that contains statistical information on 2172 // the possible values of this column (below). 2173 string custom_tag = 3; 2174 2175 // If no semantic tag is indicated, we infer the statistical model from 2176 // the distribution of values in the input data 2177 google.protobuf.Empty inferred = 4; 2178 } 2179} 2180 2181// An auxiliary table containing statistical information on the relative 2182// frequency of different quasi-identifiers values. It has one or several 2183// quasi-identifiers columns, and one column that indicates the relative 2184// frequency of each quasi-identifier tuple. 2185// If a tuple is present in the data but not in the auxiliary table, the 2186// corresponding relative frequency is assumed to be zero (and thus, the 2187// tuple is highly reidentifiable). 2188message StatisticalTable { 2189 // A quasi-identifier column has a custom_tag, used to know which column 2190 // in the data corresponds to which column in the statistical model. 2191 message QuasiIdentifierField { 2192 // Identifies the column. 2193 FieldId field = 1; 2194 2195 // A column can be tagged with a custom tag. In this case, the user must 2196 // indicate an auxiliary table that contains statistical information on 2197 // the possible values of this column (below). 2198 string custom_tag = 2; 2199 } 2200 2201 // Required. Auxiliary table location. 2202 BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; 2203 2204 // Required. Quasi-identifier columns. 2205 repeated QuasiIdentifierField quasi_ids = 1 2206 [(google.api.field_behavior) = REQUIRED]; 2207 2208 // Required. The relative frequency column must contain a floating-point 2209 // number between 0 and 1 (inclusive). Null values are assumed to be zero. 2210 FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; 2211} 2212 2213// Privacy metric to compute for reidentification risk analysis. 2214message PrivacyMetric { 2215 // Compute numerical stats over an individual column, including 2216 // min, max, and quantiles. 2217 message NumericalStatsConfig { 2218 // Field to compute numerical stats on. Supported types are 2219 // integer, float, date, datetime, timestamp, time. 2220 FieldId field = 1; 2221 } 2222 2223 // Compute numerical stats over an individual column, including 2224 // number of distinct values and value count distribution. 2225 message CategoricalStatsConfig { 2226 // Field to compute categorical stats on. All column types are 2227 // supported except for arrays and structs. However, it may be more 2228 // informative to use NumericalStats when the field type is supported, 2229 // depending on the data. 2230 FieldId field = 1; 2231 } 2232 2233 // k-anonymity metric, used for analysis of reidentification risk. 2234 message KAnonymityConfig { 2235 // Set of fields to compute k-anonymity over. When multiple fields are 2236 // specified, they are considered a single composite key. Structs and 2237 // repeated data types are not supported; however, nested fields are 2238 // supported so long as they are not structs themselves or nested within 2239 // a repeated field. 2240 repeated FieldId quasi_ids = 1; 2241 2242 // Message indicating that multiple rows might be associated to a 2243 // single individual. If the same entity_id is associated to multiple 2244 // quasi-identifier tuples over distinct rows, we consider the entire 2245 // collection of tuples as the composite quasi-identifier. This collection 2246 // is a multiset: the order in which the different tuples appear in the 2247 // dataset is ignored, but their frequency is taken into account. 2248 // 2249 // Important note: a maximum of 1000 rows can be associated to a single 2250 // entity ID. If more rows are associated with the same entity ID, some 2251 // might be ignored. 2252 EntityId entity_id = 2; 2253 } 2254 2255 // l-diversity metric, used for analysis of reidentification risk. 2256 message LDiversityConfig { 2257 // Set of quasi-identifiers indicating how equivalence classes are 2258 // defined for the l-diversity computation. When multiple fields are 2259 // specified, they are considered a single composite key. 2260 repeated FieldId quasi_ids = 1; 2261 2262 // Sensitive field for computing the l-value. 2263 FieldId sensitive_attribute = 2; 2264 } 2265 2266 // Reidentifiability metric. This corresponds to a risk model similar to what 2267 // is called "journalist risk" in the literature, except the attack dataset is 2268 // statistically modeled instead of being perfectly known. This can be done 2269 // using publicly available data (like the US Census), or using a custom 2270 // statistical model (indicated as one or several BigQuery tables), or by 2271 // extrapolating from the distribution of values in the input dataset. 2272 message KMapEstimationConfig { 2273 // A column with a semantic tag attached. 2274 message TaggedField { 2275 // Required. Identifies the column. 2276 FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; 2277 2278 // Semantic tag that identifies what a column contains, to determine which 2279 // statistical model to use to estimate the reidentifiability of each 2280 // value. [required] 2281 oneof tag { 2282 // A column can be tagged with a InfoType to use the relevant public 2283 // dataset as a statistical model of population, if available. We 2284 // currently support US ZIP codes, region codes, ages and genders. 2285 // To programmatically obtain the list of supported InfoTypes, use 2286 // ListInfoTypes with the supported_by=RISK_ANALYSIS filter. 2287 InfoType info_type = 2; 2288 2289 // A column can be tagged with a custom tag. In this case, the user must 2290 // indicate an auxiliary table that contains statistical information on 2291 // the possible values of this column (below). 2292 string custom_tag = 3; 2293 2294 // If no semantic tag is indicated, we infer the statistical model from 2295 // the distribution of values in the input data 2296 google.protobuf.Empty inferred = 4; 2297 } 2298 } 2299 2300 // An auxiliary table contains statistical information on the relative 2301 // frequency of different quasi-identifiers values. It has one or several 2302 // quasi-identifiers columns, and one column that indicates the relative 2303 // frequency of each quasi-identifier tuple. 2304 // If a tuple is present in the data but not in the auxiliary table, the 2305 // corresponding relative frequency is assumed to be zero (and thus, the 2306 // tuple is highly reidentifiable). 2307 message AuxiliaryTable { 2308 // A quasi-identifier column has a custom_tag, used to know which column 2309 // in the data corresponds to which column in the statistical model. 2310 message QuasiIdField { 2311 // Identifies the column. 2312 FieldId field = 1; 2313 2314 // A auxiliary field. 2315 string custom_tag = 2; 2316 } 2317 2318 // Required. Auxiliary table location. 2319 BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED]; 2320 2321 // Required. Quasi-identifier columns. 2322 repeated QuasiIdField quasi_ids = 1 2323 [(google.api.field_behavior) = REQUIRED]; 2324 2325 // Required. The relative frequency column must contain a floating-point 2326 // number between 0 and 1 (inclusive). Null values are assumed to be zero. 2327 FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED]; 2328 } 2329 2330 // Required. Fields considered to be quasi-identifiers. No two columns can 2331 // have the same tag. 2332 repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; 2333 2334 // ISO 3166-1 alpha-2 region code to use in the statistical modeling. 2335 // Set if no column is tagged with a region-specific InfoType (like 2336 // US_ZIP_5) or a region code. 2337 string region_code = 2; 2338 2339 // Several auxiliary tables can be used in the analysis. Each custom_tag 2340 // used to tag a quasi-identifiers column must appear in exactly one column 2341 // of one auxiliary table. 2342 repeated AuxiliaryTable auxiliary_tables = 3; 2343 } 2344 2345 // δ-presence metric, used to estimate how likely it is for an attacker to 2346 // figure out that one given individual appears in a de-identified dataset. 2347 // Similarly to the k-map metric, we cannot compute δ-presence exactly without 2348 // knowing the attack dataset, so we use a statistical model instead. 2349 message DeltaPresenceEstimationConfig { 2350 // Required. Fields considered to be quasi-identifiers. No two fields can 2351 // have the same tag. 2352 repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED]; 2353 2354 // ISO 3166-1 alpha-2 region code to use in the statistical modeling. 2355 // Set if no column is tagged with a region-specific InfoType (like 2356 // US_ZIP_5) or a region code. 2357 string region_code = 2; 2358 2359 // Several auxiliary tables can be used in the analysis. Each custom_tag 2360 // used to tag a quasi-identifiers field must appear in exactly one 2361 // field of one auxiliary table. 2362 repeated StatisticalTable auxiliary_tables = 3; 2363 } 2364 2365 // Types of analysis. 2366 oneof type { 2367 // Numerical stats 2368 NumericalStatsConfig numerical_stats_config = 1; 2369 2370 // Categorical stats 2371 CategoricalStatsConfig categorical_stats_config = 2; 2372 2373 // K-anonymity 2374 KAnonymityConfig k_anonymity_config = 3; 2375 2376 // l-diversity 2377 LDiversityConfig l_diversity_config = 4; 2378 2379 // k-map 2380 KMapEstimationConfig k_map_estimation_config = 5; 2381 2382 // delta-presence 2383 DeltaPresenceEstimationConfig delta_presence_estimation_config = 6; 2384 } 2385} 2386 2387// Result of a risk analysis operation request. 2388message AnalyzeDataSourceRiskDetails { 2389 // Result of the numerical stats computation. 2390 message NumericalStatsResult { 2391 // Minimum value appearing in the column. 2392 Value min_value = 1; 2393 2394 // Maximum value appearing in the column. 2395 Value max_value = 2; 2396 2397 // List of 99 values that partition the set of field values into 100 equal 2398 // sized buckets. 2399 repeated Value quantile_values = 4; 2400 } 2401 2402 // Result of the categorical stats computation. 2403 message CategoricalStatsResult { 2404 // Histogram of value frequencies in the column. 2405 message CategoricalStatsHistogramBucket { 2406 // Lower bound on the value frequency of the values in this bucket. 2407 int64 value_frequency_lower_bound = 1; 2408 2409 // Upper bound on the value frequency of the values in this bucket. 2410 int64 value_frequency_upper_bound = 2; 2411 2412 // Total number of values in this bucket. 2413 int64 bucket_size = 3; 2414 2415 // Sample of value frequencies in this bucket. The total number of 2416 // values returned per bucket is capped at 20. 2417 repeated ValueFrequency bucket_values = 4; 2418 2419 // Total number of distinct values in this bucket. 2420 int64 bucket_value_count = 5; 2421 } 2422 2423 // Histogram of value frequencies in the column. 2424 repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 2425 5; 2426 } 2427 2428 // Result of the k-anonymity computation. 2429 message KAnonymityResult { 2430 // The set of columns' values that share the same ldiversity value 2431 message KAnonymityEquivalenceClass { 2432 // Set of values defining the equivalence class. One value per 2433 // quasi-identifier column in the original KAnonymity metric message. 2434 // The order is always the same as the original request. 2435 repeated Value quasi_ids_values = 1; 2436 2437 // Size of the equivalence class, for example number of rows with the 2438 // above set of values. 2439 int64 equivalence_class_size = 2; 2440 } 2441 2442 // Histogram of k-anonymity equivalence classes. 2443 message KAnonymityHistogramBucket { 2444 // Lower bound on the size of the equivalence classes in this bucket. 2445 int64 equivalence_class_size_lower_bound = 1; 2446 2447 // Upper bound on the size of the equivalence classes in this bucket. 2448 int64 equivalence_class_size_upper_bound = 2; 2449 2450 // Total number of equivalence classes in this bucket. 2451 int64 bucket_size = 3; 2452 2453 // Sample of equivalence classes in this bucket. The total number of 2454 // classes returned per bucket is capped at 20. 2455 repeated KAnonymityEquivalenceClass bucket_values = 4; 2456 2457 // Total number of distinct equivalence classes in this bucket. 2458 int64 bucket_value_count = 5; 2459 } 2460 2461 // Histogram of k-anonymity equivalence classes. 2462 repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5; 2463 } 2464 2465 // Result of the l-diversity computation. 2466 message LDiversityResult { 2467 // The set of columns' values that share the same ldiversity value. 2468 message LDiversityEquivalenceClass { 2469 // Quasi-identifier values defining the k-anonymity equivalence 2470 // class. The order is always the same as the original request. 2471 repeated Value quasi_ids_values = 1; 2472 2473 // Size of the k-anonymity equivalence class. 2474 int64 equivalence_class_size = 2; 2475 2476 // Number of distinct sensitive values in this equivalence class. 2477 int64 num_distinct_sensitive_values = 3; 2478 2479 // Estimated frequencies of top sensitive values. 2480 repeated ValueFrequency top_sensitive_values = 4; 2481 } 2482 2483 // Histogram of l-diversity equivalence class sensitive value frequencies. 2484 message LDiversityHistogramBucket { 2485 // Lower bound on the sensitive value frequencies of the equivalence 2486 // classes in this bucket. 2487 int64 sensitive_value_frequency_lower_bound = 1; 2488 2489 // Upper bound on the sensitive value frequencies of the equivalence 2490 // classes in this bucket. 2491 int64 sensitive_value_frequency_upper_bound = 2; 2492 2493 // Total number of equivalence classes in this bucket. 2494 int64 bucket_size = 3; 2495 2496 // Sample of equivalence classes in this bucket. The total number of 2497 // classes returned per bucket is capped at 20. 2498 repeated LDiversityEquivalenceClass bucket_values = 4; 2499 2500 // Total number of distinct equivalence classes in this bucket. 2501 int64 bucket_value_count = 5; 2502 } 2503 2504 // Histogram of l-diversity equivalence class sensitive value frequencies. 2505 repeated LDiversityHistogramBucket 2506 sensitive_value_frequency_histogram_buckets = 5; 2507 } 2508 2509 // Result of the reidentifiability analysis. Note that these results are an 2510 // estimation, not exact values. 2511 message KMapEstimationResult { 2512 // A tuple of values for the quasi-identifier columns. 2513 message KMapEstimationQuasiIdValues { 2514 // The quasi-identifier values. 2515 repeated Value quasi_ids_values = 1; 2516 2517 // The estimated anonymity for these quasi-identifier values. 2518 int64 estimated_anonymity = 2; 2519 } 2520 2521 // A KMapEstimationHistogramBucket message with the following values: 2522 // min_anonymity: 3 2523 // max_anonymity: 5 2524 // frequency: 42 2525 // means that there are 42 records whose quasi-identifier values correspond 2526 // to 3, 4 or 5 people in the overlying population. An important particular 2527 // case is when min_anonymity = max_anonymity = 1: the frequency field then 2528 // corresponds to the number of uniquely identifiable records. 2529 message KMapEstimationHistogramBucket { 2530 // Always positive. 2531 int64 min_anonymity = 1; 2532 2533 // Always greater than or equal to min_anonymity. 2534 int64 max_anonymity = 2; 2535 2536 // Number of records within these anonymity bounds. 2537 int64 bucket_size = 5; 2538 2539 // Sample of quasi-identifier tuple values in this bucket. The total 2540 // number of classes returned per bucket is capped at 20. 2541 repeated KMapEstimationQuasiIdValues bucket_values = 6; 2542 2543 // Total number of distinct quasi-identifier tuple values in this bucket. 2544 int64 bucket_value_count = 7; 2545 } 2546 2547 // The intervals [min_anonymity, max_anonymity] do not overlap. If a value 2548 // doesn't correspond to any such interval, the associated frequency is 2549 // zero. For example, the following records: 2550 // {min_anonymity: 1, max_anonymity: 1, frequency: 17} 2551 // {min_anonymity: 2, max_anonymity: 3, frequency: 42} 2552 // {min_anonymity: 5, max_anonymity: 10, frequency: 99} 2553 // mean that there are no record with an estimated anonymity of 4, 5, or 2554 // larger than 10. 2555 repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1; 2556 } 2557 2558 // Result of the δ-presence computation. Note that these results are an 2559 // estimation, not exact values. 2560 message DeltaPresenceEstimationResult { 2561 // A tuple of values for the quasi-identifier columns. 2562 message DeltaPresenceEstimationQuasiIdValues { 2563 // The quasi-identifier values. 2564 repeated Value quasi_ids_values = 1; 2565 2566 // The estimated probability that a given individual sharing these 2567 // quasi-identifier values is in the dataset. This value, typically 2568 // called δ, is the ratio between the number of records in the dataset 2569 // with these quasi-identifier values, and the total number of individuals 2570 // (inside *and* outside the dataset) with these quasi-identifier values. 2571 // For example, if there are 15 individuals in the dataset who share the 2572 // same quasi-identifier values, and an estimated 100 people in the entire 2573 // population with these values, then δ is 0.15. 2574 double estimated_probability = 2; 2575 } 2576 2577 // A DeltaPresenceEstimationHistogramBucket message with the following 2578 // values: 2579 // min_probability: 0.1 2580 // max_probability: 0.2 2581 // frequency: 42 2582 // means that there are 42 records for which δ is in [0.1, 0.2). An 2583 // important particular case is when min_probability = max_probability = 1: 2584 // then, every individual who shares this quasi-identifier combination is in 2585 // the dataset. 2586 message DeltaPresenceEstimationHistogramBucket { 2587 // Between 0 and 1. 2588 double min_probability = 1; 2589 2590 // Always greater than or equal to min_probability. 2591 double max_probability = 2; 2592 2593 // Number of records within these probability bounds. 2594 int64 bucket_size = 5; 2595 2596 // Sample of quasi-identifier tuple values in this bucket. The total 2597 // number of classes returned per bucket is capped at 20. 2598 repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6; 2599 2600 // Total number of distinct quasi-identifier tuple values in this bucket. 2601 int64 bucket_value_count = 7; 2602 } 2603 2604 // The intervals [min_probability, max_probability) do not overlap. If a 2605 // value doesn't correspond to any such interval, the associated frequency 2606 // is zero. For example, the following records: 2607 // {min_probability: 0, max_probability: 0.1, frequency: 17} 2608 // {min_probability: 0.2, max_probability: 0.3, frequency: 42} 2609 // {min_probability: 0.3, max_probability: 0.4, frequency: 99} 2610 // mean that there are no record with an estimated probability in [0.1, 0.2) 2611 // nor larger or equal to 0.4. 2612 repeated DeltaPresenceEstimationHistogramBucket 2613 delta_presence_estimation_histogram = 1; 2614 } 2615 2616 // Risk analysis options. 2617 message RequestedRiskAnalysisOptions { 2618 // The job config for the risk job. 2619 RiskAnalysisJobConfig job_config = 1; 2620 } 2621 2622 // Privacy metric to compute. 2623 PrivacyMetric requested_privacy_metric = 1; 2624 2625 // Input dataset to compute metrics over. 2626 BigQueryTable requested_source_table = 2; 2627 2628 // Values associated with this metric. 2629 oneof result { 2630 // Numerical stats result 2631 NumericalStatsResult numerical_stats_result = 3; 2632 2633 // Categorical stats result 2634 CategoricalStatsResult categorical_stats_result = 4; 2635 2636 // K-anonymity result 2637 KAnonymityResult k_anonymity_result = 5; 2638 2639 // L-divesity result 2640 LDiversityResult l_diversity_result = 6; 2641 2642 // K-map result 2643 KMapEstimationResult k_map_estimation_result = 7; 2644 2645 // Delta-presence result 2646 DeltaPresenceEstimationResult delta_presence_estimation_result = 9; 2647 } 2648 2649 // The configuration used for this job. 2650 RequestedRiskAnalysisOptions requested_options = 10; 2651} 2652 2653// A value of a field, including its frequency. 2654message ValueFrequency { 2655 // A value contained in the field in question. 2656 Value value = 1; 2657 2658 // How many times the value is contained in the field. 2659 int64 count = 2; 2660} 2661 2662// Set of primitive values supported by the system. 2663// Note that for the purposes of inspection or transformation, the number 2664// of bytes considered to comprise a 'Value' is based on its representation 2665// as a UTF-8 encoded string. For example, if 'integer_value' is set to 2666// 123456789, the number of bytes would be counted as 9, even though an 2667// int64 only holds up to 8 bytes of data. 2668message Value { 2669 // Value types 2670 oneof type { 2671 // integer 2672 int64 integer_value = 1; 2673 2674 // float 2675 double float_value = 2; 2676 2677 // string 2678 string string_value = 3; 2679 2680 // boolean 2681 bool boolean_value = 4; 2682 2683 // timestamp 2684 google.protobuf.Timestamp timestamp_value = 5; 2685 2686 // time of day 2687 google.type.TimeOfDay time_value = 6; 2688 2689 // date 2690 google.type.Date date_value = 7; 2691 2692 // day of week 2693 google.type.DayOfWeek day_of_week_value = 8; 2694 } 2695} 2696 2697// Message for infoType-dependent details parsed from quote. 2698message QuoteInfo { 2699 // Object representation of the quote. 2700 oneof parsed_quote { 2701 // The date time indicated by the quote. 2702 DateTime date_time = 2; 2703 } 2704} 2705 2706// Message for a date time object. 2707// e.g. 2018-01-01, 5th August. 2708message DateTime { 2709 // Time zone of the date time object. 2710 message TimeZone { 2711 // Set only if the offset can be determined. Positive for time ahead of UTC. 2712 // E.g. For "UTC-9", this value is -540. 2713 int32 offset_minutes = 1; 2714 } 2715 2716 // One or more of the following must be set. 2717 // Must be a valid date or time value. 2718 google.type.Date date = 1; 2719 2720 // Day of week 2721 google.type.DayOfWeek day_of_week = 2; 2722 2723 // Time of day 2724 google.type.TimeOfDay time = 3; 2725 2726 // Time zone 2727 TimeZone time_zone = 4; 2728} 2729 2730// The configuration that controls how the data will change. 2731message DeidentifyConfig { 2732 // Type of transformation 2733 oneof transformation { 2734 // Treat the dataset as free-form text and apply the same free text 2735 // transformation everywhere. 2736 InfoTypeTransformations info_type_transformations = 1; 2737 2738 // Treat the dataset as structured. Transformations can be applied to 2739 // specific locations within structured datasets, such as transforming 2740 // a column within a table. 2741 RecordTransformations record_transformations = 2; 2742 2743 // Treat the dataset as an image and redact. 2744 ImageTransformations image_transformations = 4; 2745 } 2746 2747 // Mode for handling transformation errors. If left unspecified, the default 2748 // mode is `TransformationErrorHandling.ThrowError`. 2749 TransformationErrorHandling transformation_error_handling = 3; 2750} 2751 2752// A type of transformation that is applied over images. 2753message ImageTransformations { 2754 // Configuration for determining how redaction of images should occur. 2755 message ImageTransformation { 2756 // Apply transformation to the selected info_types. 2757 message SelectedInfoTypes { 2758 // Required. InfoTypes to apply the transformation to. Required. Provided 2759 // InfoType must be unique within the ImageTransformations message. 2760 repeated InfoType info_types = 5 [(google.api.field_behavior) = REQUIRED]; 2761 } 2762 2763 // Apply transformation to all findings. 2764 message AllInfoTypes {} 2765 2766 // Apply to all text. 2767 message AllText {} 2768 2769 // Part of the image to transform. 2770 oneof target { 2771 // Apply transformation to the selected info_types. 2772 SelectedInfoTypes selected_info_types = 4; 2773 2774 // Apply transformation to all findings not specified in other 2775 // ImageTransformation's selected_info_types. Only one instance is allowed 2776 // within the ImageTransformations message. 2777 AllInfoTypes all_info_types = 5; 2778 2779 // Apply transformation to all text that doesn't match an infoType. Only 2780 // one instance is allowed within the ImageTransformations message. 2781 AllText all_text = 6; 2782 } 2783 2784 // The color to use when redacting content from an image. If not 2785 // specified, the default is black. 2786 Color redaction_color = 3; 2787 } 2788 2789 // List of transforms to make. 2790 repeated ImageTransformation transforms = 2; 2791} 2792 2793// How to handle transformation errors during de-identification. A 2794// transformation error occurs when the requested transformation is incompatible 2795// with the data. For example, trying to de-identify an IP address using a 2796// `DateShift` transformation would result in a transformation error, since date 2797// info cannot be extracted from an IP address. 2798// Information about any incompatible transformations, and how they were 2799// handled, is returned in the response as part of the 2800// `TransformationOverviews`. 2801message TransformationErrorHandling { 2802 // Throw an error and fail the request when a transformation error occurs. 2803 message ThrowError {} 2804 2805 // Skips the data without modifying it if the requested transformation would 2806 // cause an error. For example, if a `DateShift` transformation were applied 2807 // an an IP address, this mode would leave the IP address unchanged in the 2808 // response. 2809 message LeaveUntransformed {} 2810 2811 // How transformation errors should be handled. 2812 oneof mode { 2813 // Throw an error 2814 ThrowError throw_error = 1; 2815 2816 // Ignore errors 2817 LeaveUntransformed leave_untransformed = 2; 2818 } 2819} 2820 2821// A rule for transforming a value. 2822message PrimitiveTransformation { 2823 // Type of transformation. 2824 oneof transformation { 2825 // Replace with a specified value. 2826 ReplaceValueConfig replace_config = 1; 2827 2828 // Redact 2829 RedactConfig redact_config = 2; 2830 2831 // Mask 2832 CharacterMaskConfig character_mask_config = 3; 2833 2834 // Ffx-Fpe 2835 CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4; 2836 2837 // Fixed size bucketing 2838 FixedSizeBucketingConfig fixed_size_bucketing_config = 5; 2839 2840 // Bucketing 2841 BucketingConfig bucketing_config = 6; 2842 2843 // Replace with infotype 2844 ReplaceWithInfoTypeConfig replace_with_info_type_config = 7; 2845 2846 // Time extraction 2847 TimePartConfig time_part_config = 8; 2848 2849 // Crypto 2850 CryptoHashConfig crypto_hash_config = 9; 2851 2852 // Date Shift 2853 DateShiftConfig date_shift_config = 11; 2854 2855 // Deterministic Crypto 2856 CryptoDeterministicConfig crypto_deterministic_config = 12; 2857 2858 // Replace with a value randomly drawn (with replacement) from a dictionary. 2859 ReplaceDictionaryConfig replace_dictionary_config = 13; 2860 } 2861} 2862 2863// For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a 2864// portion of the value. 2865message TimePartConfig { 2866 // Components that make up time. 2867 enum TimePart { 2868 // Unused 2869 TIME_PART_UNSPECIFIED = 0; 2870 2871 // [0-9999] 2872 YEAR = 1; 2873 2874 // [1-12] 2875 MONTH = 2; 2876 2877 // [1-31] 2878 DAY_OF_MONTH = 3; 2879 2880 // [1-7] 2881 DAY_OF_WEEK = 4; 2882 2883 // [1-53] 2884 WEEK_OF_YEAR = 5; 2885 2886 // [0-23] 2887 HOUR_OF_DAY = 6; 2888 } 2889 2890 // The part of the time to keep. 2891 TimePart part_to_extract = 1; 2892} 2893 2894// Pseudonymization method that generates surrogates via cryptographic hashing. 2895// Uses SHA-256. 2896// The key size must be either 32 or 64 bytes. 2897// Outputs a base64 encoded representation of the hashed output 2898// (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). 2899// Currently, only string and integer values can be hashed. 2900// See https://cloud.google.com/sensitive-data-protection/docs/pseudonymization 2901// to learn more. 2902message CryptoHashConfig { 2903 // The key used by the hash function. 2904 CryptoKey crypto_key = 1; 2905} 2906 2907// Pseudonymization method that generates deterministic encryption for the given 2908// input. Outputs a base64 encoded representation of the encrypted output. 2909// Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297. 2910message CryptoDeterministicConfig { 2911 // The key used by the encryption function. For deterministic encryption 2912 // using AES-SIV, the provided key is internally expanded to 64 bytes prior to 2913 // use. 2914 CryptoKey crypto_key = 1; 2915 2916 // The custom info type to annotate the surrogate with. 2917 // This annotation will be applied to the surrogate by prefixing it with 2918 // the name of the custom info type followed by the number of 2919 // characters comprising the surrogate. The following scheme defines the 2920 // format: {info type name}({surrogate character count}):{surrogate} 2921 // 2922 // For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and 2923 // the surrogate is 'abc', the full replacement value 2924 // will be: 'MY_TOKEN_INFO_TYPE(3):abc' 2925 // 2926 // This annotation identifies the surrogate when inspecting content using the 2927 // custom info type 'Surrogate'. This facilitates reversal of the 2928 // surrogate when it occurs in free text. 2929 // 2930 // Note: For record transformations where the entire cell in a table is being 2931 // transformed, surrogates are not mandatory. Surrogates are used to denote 2932 // the location of the token and are necessary for re-identification in free 2933 // form text. 2934 // 2935 // In order for inspection to work properly, the name of this info type must 2936 // not occur naturally anywhere in your data; otherwise, inspection may either 2937 // 2938 // - reverse a surrogate that does not correspond to an actual identifier 2939 // - be unable to parse the surrogate and result in an error 2940 // 2941 // Therefore, choose your custom info type name carefully after considering 2942 // what your data looks like. One way to select a name that has a high chance 2943 // of yielding reliable detection is to include one or more unicode characters 2944 // that are highly improbable to exist in your data. 2945 // For example, assuming your data is entered from a regular ASCII keyboard, 2946 // the symbol with the hex code point 29DD might be used like so: 2947 // ⧝MY_TOKEN_TYPE. 2948 InfoType surrogate_info_type = 2; 2949 2950 // A context may be used for higher security and maintaining 2951 // referential integrity such that the same identifier in two different 2952 // contexts will be given a distinct surrogate. The context is appended to 2953 // plaintext value being encrypted. On decryption the provided context is 2954 // validated against the value used during encryption. If a context was 2955 // provided during encryption, same context must be provided during decryption 2956 // as well. 2957 // 2958 // If the context is not set, plaintext would be used as is for encryption. 2959 // If the context is set but: 2960 // 2961 // 1. there is no record present when transforming a given value or 2962 // 2. the field is not present when transforming a given value, 2963 // 2964 // plaintext would be used as is for encryption. 2965 // 2966 // Note that case (1) is expected when an `InfoTypeTransformation` is 2967 // applied to both structured and unstructured `ContentItem`s. 2968 FieldId context = 3; 2969} 2970 2971// Replace each input value with a given `Value`. 2972message ReplaceValueConfig { 2973 // Value to replace it with. 2974 Value new_value = 1; 2975} 2976 2977// Replace each input value with a value randomly selected from the dictionary. 2978message ReplaceDictionaryConfig { 2979 // Type of dictionary. 2980 oneof type { 2981 // A list of words to select from for random replacement. The 2982 // [limits](https://cloud.google.com/sensitive-data-protection/limits) page 2983 // contains details about the size limits of dictionaries. 2984 CustomInfoType.Dictionary.WordList word_list = 1; 2985 } 2986} 2987 2988// Replace each matching finding with the name of the info_type. 2989message ReplaceWithInfoTypeConfig {} 2990 2991// Redact a given value. For example, if used with an `InfoTypeTransformation` 2992// transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the 2993// output would be 'My phone number is '. 2994message RedactConfig {} 2995 2996// Characters to skip when doing deidentification of a value. These will be left 2997// alone and skipped. 2998message CharsToIgnore { 2999 // Convenience enum for indicating common characters to not transform. 3000 enum CommonCharsToIgnore { 3001 // Unused. 3002 COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0; 3003 3004 // 0-9 3005 NUMERIC = 1; 3006 3007 // A-Z 3008 ALPHA_UPPER_CASE = 2; 3009 3010 // a-z 3011 ALPHA_LOWER_CASE = 3; 3012 3013 // US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ 3014 PUNCTUATION = 4; 3015 3016 // Whitespace character, one of [ \t\n\x0B\f\r] 3017 WHITESPACE = 5; 3018 } 3019 3020 // Type of characters to skip. 3021 oneof characters { 3022 // Characters to not transform when masking. 3023 string characters_to_skip = 1; 3024 3025 // Common characters to not transform when masking. Useful to avoid removing 3026 // punctuation. 3027 CommonCharsToIgnore common_characters_to_ignore = 2; 3028 } 3029} 3030 3031// Partially mask a string by replacing a given number of characters with a 3032// fixed character. Masking can start from the beginning or end of the string. 3033// This can be used on data of any type (numbers, longs, and so on) and when 3034// de-identifying structured data we'll attempt to preserve the original data's 3035// type. (This allows you to take a long like 123 and modify it to a string like 3036// **3. 3037message CharacterMaskConfig { 3038 // Character to use to mask the sensitive values—for example, `*` for an 3039 // alphabetic string such as a name, or `0` for a numeric string such as ZIP 3040 // code or credit card number. This string must have a length of 1. If not 3041 // supplied, this value defaults to `*` for strings, and `0` for digits. 3042 string masking_character = 1; 3043 3044 // Number of characters to mask. If not set, all matching chars will be 3045 // masked. Skipped characters do not count towards this tally. 3046 // 3047 // If `number_to_mask` is negative, this denotes inverse masking. Cloud DLP 3048 // masks all but a number of characters. 3049 // For example, suppose you have the following values: 3050 // 3051 // - `masking_character` is `*` 3052 // - `number_to_mask` is `-4` 3053 // - `reverse_order` is `false` 3054 // - `CharsToIgnore` includes `-` 3055 // - Input string is `1234-5678-9012-3456` 3056 // 3057 // The resulting de-identified string is 3058 // `****-****-****-3456`. Cloud DLP masks all but the last four characters. 3059 // If `reverse_order` is `true`, all but the first four characters are masked 3060 // as `1234-****-****-****`. 3061 int32 number_to_mask = 2; 3062 3063 // Mask characters in reverse order. For example, if `masking_character` is 3064 // `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the 3065 // input string `1234-5678-9012-3456` is masked as `00000000000000-3456`. 3066 // If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order` 3067 // is `true`, then the string `12345` is masked as `12***`. 3068 bool reverse_order = 3; 3069 3070 // When masking a string, items in this list will be skipped when replacing 3071 // characters. For example, if the input string is `555-555-5555` and you 3072 // instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP 3073 // returns `***-**5-5555`. 3074 repeated CharsToIgnore characters_to_ignore = 4; 3075} 3076 3077// Buckets values based on fixed size ranges. The 3078// Bucketing transformation can provide all of this functionality, 3079// but requires more configuration. This message is provided as a convenience to 3080// the user for simple bucketing strategies. 3081// 3082// The transformed value will be a hyphenated string of 3083// {lower_bound}-{upper_bound}. For example, if lower_bound = 10 and upper_bound 3084// = 20, all values that are within this bucket will be replaced with "10-20". 3085// 3086// This can be used on data of type: double, long. 3087// 3088// If the bound Value type differs from the type of data 3089// being transformed, we will first attempt converting the type of the data to 3090// be transformed to match the type of the bound before comparing. 3091// 3092// See 3093// https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to 3094// learn more. 3095message FixedSizeBucketingConfig { 3096 // Required. Lower bound value of buckets. All values less than `lower_bound` 3097 // are grouped together into a single bucket; for example if `lower_bound` = 3098 // 10, then all values less than 10 are replaced with the value "-10". 3099 Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED]; 3100 3101 // Required. Upper bound value of buckets. All values greater than upper_bound 3102 // are grouped together into a single bucket; for example if `upper_bound` = 3103 // 89, then all values greater than 89 are replaced with the value "89+". 3104 Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED]; 3105 3106 // Required. Size of each bucket (except for minimum and maximum buckets). So 3107 // if `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the 3108 // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, 3109 // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. 3110 double bucket_size = 3 [(google.api.field_behavior) = REQUIRED]; 3111} 3112 3113// Generalization function that buckets values based on ranges. The ranges and 3114// replacement values are dynamically provided by the user for custom behavior, 3115// such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH 3116// This can be used on 3117// data of type: number, long, string, timestamp. 3118// If the bound `Value` type differs from the type of data being transformed, we 3119// will first attempt converting the type of the data to be transformed to match 3120// the type of the bound before comparing. 3121// See 3122// https://cloud.google.com/sensitive-data-protection/docs/concepts-bucketing to 3123// learn more. 3124message BucketingConfig { 3125 // Bucket is represented as a range, along with replacement values. 3126 message Bucket { 3127 // Lower bound of the range, inclusive. Type should be the same as max if 3128 // used. 3129 Value min = 1; 3130 3131 // Upper bound of the range, exclusive; type must match min. 3132 Value max = 2; 3133 3134 // Required. Replacement value for this bucket. 3135 Value replacement_value = 3 [(google.api.field_behavior) = REQUIRED]; 3136 } 3137 3138 // Set of buckets. Ranges must be non-overlapping. 3139 repeated Bucket buckets = 1; 3140} 3141 3142// Replaces an identifier with a surrogate using Format Preserving Encryption 3143// (FPE) with the FFX mode of operation; however when used in the 3144// `ReidentifyContent` API method, it serves the opposite function by reversing 3145// the surrogate back into the original identifier. The identifier must be 3146// encoded as ASCII. For a given crypto key and context, the same identifier 3147// will be replaced with the same surrogate. Identifiers must be at least two 3148// characters long. In the case that the identifier is the empty string, it will 3149// be skipped. See 3150// https://cloud.google.com/sensitive-data-protection/docs/pseudonymization to 3151// learn more. 3152// 3153// Note: We recommend using CryptoDeterministicConfig for all use cases which 3154// do not require preserving the input alphabet space and size, plus warrant 3155// referential integrity. 3156message CryptoReplaceFfxFpeConfig { 3157 // These are commonly used subsets of the alphabet that the FFX mode 3158 // natively supports. In the algorithm, the alphabet is selected using 3159 // the "radix". Therefore each corresponds to a particular radix. 3160 enum FfxCommonNativeAlphabet { 3161 // Unused. 3162 FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0; 3163 3164 // `[0-9]` (radix of 10) 3165 NUMERIC = 1; 3166 3167 // `[0-9A-F]` (radix of 16) 3168 HEXADECIMAL = 2; 3169 3170 // `[0-9A-Z]` (radix of 36) 3171 UPPER_CASE_ALPHA_NUMERIC = 3; 3172 3173 // `[0-9A-Za-z]` (radix of 62) 3174 ALPHA_NUMERIC = 4; 3175 } 3176 3177 // Required. The key used by the encryption algorithm. 3178 CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED]; 3179 3180 // The 'tweak', a context may be used for higher security since the same 3181 // identifier in two different contexts won't be given the same surrogate. If 3182 // the context is not set, a default tweak will be used. 3183 // 3184 // If the context is set but: 3185 // 3186 // 1. there is no record present when transforming a given value or 3187 // 1. the field is not present when transforming a given value, 3188 // 3189 // a default tweak will be used. 3190 // 3191 // Note that case (1) is expected when an `InfoTypeTransformation` is 3192 // applied to both structured and unstructured `ContentItem`s. 3193 // Currently, the referenced field may be of value type integer or string. 3194 // 3195 // The tweak is constructed as a sequence of bytes in big endian byte order 3196 // such that: 3197 // 3198 // - a 64 bit integer is encoded followed by a single byte of value 1 3199 // - a string is encoded in UTF-8 format followed by a single byte of value 2 3200 FieldId context = 2; 3201 3202 // Choose an alphabet which the data being transformed will be made up of. 3203 oneof alphabet { 3204 // Common alphabets. 3205 FfxCommonNativeAlphabet common_alphabet = 4; 3206 3207 // This is supported by mapping these to the alphanumeric characters 3208 // that the FFX mode natively supports. This happens before/after 3209 // encryption/decryption. 3210 // Each character listed must appear only once. 3211 // Number of characters must be in the range [2, 95]. 3212 // This must be encoded as ASCII. 3213 // The order of characters does not matter. 3214 // The full list of allowed characters is: 3215 // <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 3216 // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/</code> 3217 string custom_alphabet = 5; 3218 3219 // The native way to select the alphabet. Must be in the range [2, 95]. 3220 int32 radix = 6; 3221 } 3222 3223 // The custom infoType to annotate the surrogate with. 3224 // This annotation will be applied to the surrogate by prefixing it with 3225 // the name of the custom infoType followed by the number of 3226 // characters comprising the surrogate. The following scheme defines the 3227 // format: info_type_name(surrogate_character_count):surrogate 3228 // 3229 // For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE' and 3230 // the surrogate is 'abc', the full replacement value 3231 // will be: 'MY_TOKEN_INFO_TYPE(3):abc' 3232 // 3233 // This annotation identifies the surrogate when inspecting content using the 3234 // custom infoType 3235 // [`SurrogateType`](https://cloud.google.com/sensitive-data-protection/docs/reference/rest/v2/InspectConfig#surrogatetype). 3236 // This facilitates reversal of the surrogate when it occurs in free text. 3237 // 3238 // In order for inspection to work properly, the name of this infoType must 3239 // not occur naturally anywhere in your data; otherwise, inspection may 3240 // find a surrogate that does not correspond to an actual identifier. 3241 // Therefore, choose your custom infoType name carefully after considering 3242 // what your data looks like. One way to select a name that has a high chance 3243 // of yielding reliable detection is to include one or more unicode characters 3244 // that are highly improbable to exist in your data. 3245 // For example, assuming your data is entered from a regular ASCII keyboard, 3246 // the symbol with the hex code point 29DD might be used like so: 3247 // ⧝MY_TOKEN_TYPE 3248 InfoType surrogate_info_type = 8; 3249} 3250 3251// This is a data encryption key (DEK) (as opposed to 3252// a key encryption key (KEK) stored by Cloud Key Management Service 3253// (Cloud KMS). 3254// When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate 3255// IAM policy on the KEK to ensure an attacker cannot 3256// unwrap the DEK. 3257message CryptoKey { 3258 // Sources of crypto keys. 3259 oneof source { 3260 // Transient crypto key 3261 TransientCryptoKey transient = 1; 3262 3263 // Unwrapped crypto key 3264 UnwrappedCryptoKey unwrapped = 2; 3265 3266 // Key wrapped using Cloud KMS 3267 KmsWrappedCryptoKey kms_wrapped = 3; 3268 } 3269} 3270 3271// Use this to have a random data crypto key generated. 3272// It will be discarded after the request finishes. 3273message TransientCryptoKey { 3274 // Required. Name of the key. 3275 // This is an arbitrary string used to differentiate different keys. 3276 // A unique key is generated per name: two separate `TransientCryptoKey` 3277 // protos share the same generated key if their names are the same. 3278 // When the data crypto key is generated, this name is not used in any way 3279 // (repeating the api call will result in a different key being generated). 3280 string name = 1 [(google.api.field_behavior) = REQUIRED]; 3281} 3282 3283// Using raw keys is prone to security risks due to accidentally 3284// leaking the key. Choose another type of key if possible. 3285message UnwrappedCryptoKey { 3286 // Required. A 128/192/256 bit key. 3287 bytes key = 1 [(google.api.field_behavior) = REQUIRED]; 3288} 3289 3290// Include to use an existing data crypto key wrapped by KMS. 3291// The wrapped key must be a 128-, 192-, or 256-bit key. 3292// Authorization requires the following IAM permissions when sending a request 3293// to perform a crypto transformation using a KMS-wrapped crypto key: 3294// dlp.kms.encrypt 3295// 3296// For more information, see [Creating a wrapped key] 3297// (https://cloud.google.com/sensitive-data-protection/docs/create-wrapped-key). 3298// 3299// Note: When you use Cloud KMS for cryptographic operations, 3300// [charges apply](https://cloud.google.com/kms/pricing). 3301message KmsWrappedCryptoKey { 3302 // Required. The wrapped data crypto key. 3303 bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED]; 3304 3305 // Required. The resource name of the KMS CryptoKey to use for unwrapping. 3306 string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED]; 3307} 3308 3309// Shifts dates by random number of days, with option to be consistent for the 3310// same context. See 3311// https://cloud.google.com/sensitive-data-protection/docs/concepts-date-shifting 3312// to learn more. 3313message DateShiftConfig { 3314 // Required. Range of shift in days. Actual shift will be selected at random 3315 // within this range (inclusive ends). Negative means shift to earlier in 3316 // time. Must not be more than 365250 days (1000 years) each direction. 3317 // 3318 // For example, 3 means shift date to at most 3 days into the future. 3319 int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED]; 3320 3321 // Required. For example, -5 means shift date to at most 5 days back in the 3322 // past. 3323 int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED]; 3324 3325 // Points to the field that contains the context, for example, an entity id. 3326 // If set, must also set cryptoKey. If set, shift will be consistent for the 3327 // given context. 3328 FieldId context = 3; 3329 3330 // Method for calculating shift that takes context into consideration. If 3331 // set, must also set context. Can only be applied to table items. 3332 oneof method { 3333 // Causes the shift to be computed based on this key and the context. This 3334 // results in the same shift for the same context and crypto_key. If 3335 // set, must also set context. Can only be applied to table items. 3336 CryptoKey crypto_key = 4; 3337 } 3338} 3339 3340// A type of transformation that will scan unstructured text and 3341// apply various `PrimitiveTransformation`s to each finding, where the 3342// transformation is applied to only values that were identified as a specific 3343// info_type. 3344message InfoTypeTransformations { 3345 // A transformation to apply to text that is identified as a specific 3346 // info_type. 3347 message InfoTypeTransformation { 3348 // InfoTypes to apply the transformation to. An empty list will cause 3349 // this transformation to apply to all findings that correspond to 3350 // infoTypes that were requested in `InspectConfig`. 3351 repeated InfoType info_types = 1; 3352 3353 // Required. Primitive transformation to apply to the infoType. 3354 PrimitiveTransformation primitive_transformation = 2 3355 [(google.api.field_behavior) = REQUIRED]; 3356 } 3357 3358 // Required. Transformation for each infoType. Cannot specify more than one 3359 // for a given infoType. 3360 repeated InfoTypeTransformation transformations = 1 3361 [(google.api.field_behavior) = REQUIRED]; 3362} 3363 3364// The transformation to apply to the field. 3365message FieldTransformation { 3366 // Required. Input field(s) to apply the transformation to. 3367 // When you have columns that reference their position within a list, 3368 // omit the index from the FieldId. FieldId name matching ignores the index. 3369 // For example, instead of "contact.nums[0].type", use "contact.nums.type". 3370 repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED]; 3371 3372 // Only apply the transformation if the condition evaluates to true for the 3373 // given `RecordCondition`. The conditions are allowed to reference fields 3374 // that are not used in the actual transformation. 3375 // 3376 // Example Use Cases: 3377 // 3378 // - Apply a different bucket transformation to an age column if the zip code 3379 // column for the same record is within a specific range. 3380 // - Redact a field if the date of birth field is greater than 85. 3381 RecordCondition condition = 3; 3382 3383 // Transformation to apply. [required] 3384 oneof transformation { 3385 // Apply the transformation to the entire field. 3386 PrimitiveTransformation primitive_transformation = 4; 3387 3388 // Treat the contents of the field as free text, and selectively 3389 // transform content that matches an `InfoType`. 3390 InfoTypeTransformations info_type_transformations = 5; 3391 } 3392} 3393 3394// A type of transformation that is applied over structured data such as a 3395// table. 3396message RecordTransformations { 3397 // Transform the record by applying various field transformations. 3398 repeated FieldTransformation field_transformations = 1; 3399 3400 // Configuration defining which records get suppressed entirely. Records that 3401 // match any suppression rule are omitted from the output. 3402 repeated RecordSuppression record_suppressions = 2; 3403} 3404 3405// Configuration to suppress records whose suppression conditions evaluate to 3406// true. 3407message RecordSuppression { 3408 // A condition that when it evaluates to true will result in the record being 3409 // evaluated to be suppressed from the transformed content. 3410 RecordCondition condition = 1; 3411} 3412 3413// A condition for determining whether a transformation should be applied to 3414// a field. 3415message RecordCondition { 3416 // The field type of `value` and `field` do not need to match to be 3417 // considered equal, but not all comparisons are possible. 3418 // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, 3419 // but all other comparisons are invalid with incompatible types. 3420 // A `value` of type: 3421 // 3422 // - `string` can be compared against all other types 3423 // - `boolean` can only be compared against other booleans 3424 // - `integer` can be compared against doubles or a string if the string value 3425 // can be parsed as an integer. 3426 // - `double` can be compared against integers or a string if the string can 3427 // be parsed as a double. 3428 // - `Timestamp` can be compared against strings in RFC 3339 date string 3429 // format. 3430 // - `TimeOfDay` can be compared against timestamps and strings in the format 3431 // of 'HH:mm:ss'. 3432 // 3433 // If we fail to compare do to type mismatch, a warning will be given and 3434 // the condition will evaluate to false. 3435 message Condition { 3436 // Required. Field within the record this condition is evaluated against. 3437 FieldId field = 1 [(google.api.field_behavior) = REQUIRED]; 3438 3439 // Required. Operator used to compare the field or infoType to the value. 3440 RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED]; 3441 3442 // Value to compare against. [Mandatory, except for `EXISTS` tests.] 3443 Value value = 4; 3444 } 3445 3446 // A collection of conditions. 3447 message Conditions { 3448 // A collection of conditions. 3449 repeated Condition conditions = 1; 3450 } 3451 3452 // An expression, consisting of an operator and conditions. 3453 message Expressions { 3454 // Logical operators for conditional checks. 3455 enum LogicalOperator { 3456 // Unused 3457 LOGICAL_OPERATOR_UNSPECIFIED = 0; 3458 3459 // Conditional AND 3460 AND = 1; 3461 } 3462 3463 // The operator to apply to the result of conditions. Default and currently 3464 // only supported value is `AND`. 3465 LogicalOperator logical_operator = 1; 3466 3467 // Expression types. 3468 oneof type { 3469 // Conditions to apply to the expression. 3470 Conditions conditions = 3; 3471 } 3472 } 3473 3474 // An expression. 3475 Expressions expressions = 3; 3476} 3477 3478// Overview of the modifications that occurred. 3479message TransformationOverview { 3480 // Total size in bytes that were transformed in some way. 3481 int64 transformed_bytes = 2; 3482 3483 // Transformations applied to the dataset. 3484 repeated TransformationSummary transformation_summaries = 3; 3485} 3486 3487// Summary of a single transformation. 3488// Only one of 'transformation', 'field_transformation', or 'record_suppress' 3489// will be set. 3490message TransformationSummary { 3491 // Possible outcomes of transformations. 3492 enum TransformationResultCode { 3493 // Unused 3494 TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0; 3495 3496 // Transformation completed without an error. 3497 SUCCESS = 1; 3498 3499 // Transformation had an error. 3500 ERROR = 2; 3501 } 3502 3503 // A collection that informs the user the number of times a particular 3504 // `TransformationResultCode` and error details occurred. 3505 message SummaryResult { 3506 // Number of transformations counted by this result. 3507 int64 count = 1; 3508 3509 // Outcome of the transformation. 3510 TransformationResultCode code = 2; 3511 3512 // A place for warnings or errors to show up if a transformation didn't 3513 // work as expected. 3514 string details = 3; 3515 } 3516 3517 // Set if the transformation was limited to a specific InfoType. 3518 InfoType info_type = 1; 3519 3520 // Set if the transformation was limited to a specific FieldId. 3521 FieldId field = 2; 3522 3523 // The specific transformation these stats apply to. 3524 PrimitiveTransformation transformation = 3; 3525 3526 // The field transformation that was applied. 3527 // If multiple field transformations are requested for a single field, 3528 // this list will contain all of them; otherwise, only one is supplied. 3529 repeated FieldTransformation field_transformations = 5; 3530 3531 // The specific suppression option these stats apply to. 3532 RecordSuppression record_suppress = 6; 3533 3534 // Collection of all transformations that took place or had an error. 3535 repeated SummaryResult results = 4; 3536 3537 // Total size in bytes that were transformed in some way. 3538 int64 transformed_bytes = 7; 3539} 3540 3541// A flattened description of a `PrimitiveTransformation` or 3542// `RecordSuppression`. 3543message TransformationDescription { 3544 // The transformation type. 3545 TransformationType type = 1; 3546 3547 // A description of the transformation. This is empty for a 3548 // RECORD_SUPPRESSION, or is the output of calling toString() on the 3549 // `PrimitiveTransformation` protocol buffer message for any other type of 3550 // transformation. 3551 string description = 2; 3552 3553 // A human-readable string representation of the `RecordCondition` 3554 // corresponding to this transformation. Set if a `RecordCondition` was used 3555 // to determine whether or not to apply this transformation. 3556 // 3557 // Examples: 3558 // * (age_field > 85) 3559 // * (age_field <= 18) 3560 // * (zip_field exists) 3561 // * (zip_field == 01234) && (city_field != "Springville") 3562 // * (zip_field == 01234) && (age_field <= 18) && (city_field exists) 3563 string condition = 3; 3564 3565 // Set if the transformation was limited to a specific `InfoType`. 3566 InfoType info_type = 4; 3567} 3568 3569// Details about a single transformation. This object contains a description of 3570// the transformation, information about whether the transformation was 3571// successfully applied, and the precise location where the transformation 3572// occurred. These details are stored in a user-specified BigQuery table. 3573message TransformationDetails { 3574 // The name of the job that completed the transformation. 3575 string resource_name = 1; 3576 3577 // The top level name of the container where the transformation is located 3578 // (this will be the source file name or table name). 3579 string container_name = 2; 3580 3581 // Description of transformation. This would only contain more than one 3582 // element if there were multiple matching transformations and which one to 3583 // apply was ambiguous. Not set for states that contain no transformation, 3584 // currently only state that contains no transformation is 3585 // TransformationResultStateType.METADATA_UNRETRIEVABLE. 3586 repeated TransformationDescription transformation = 3; 3587 3588 // Status of the transformation, if transformation was not successful, this 3589 // will specify what caused it to fail, otherwise it will show that the 3590 // transformation was successful. 3591 TransformationResultStatus status_details = 4; 3592 3593 // The number of bytes that were transformed. If transformation was 3594 // unsuccessful or did not take place because there was no content to 3595 // transform, this will be zero. 3596 int64 transformed_bytes = 5; 3597 3598 // The precise location of the transformed content in the original container. 3599 TransformationLocation transformation_location = 6; 3600} 3601 3602// Specifies the location of a transformation. 3603message TransformationLocation { 3604 // Location type. 3605 oneof location_type { 3606 // For infotype transformations, link to the corresponding findings ID so 3607 // that location information does not need to be duplicated. Each findings 3608 // ID correlates to an entry in the findings output table, this table only 3609 // gets created when users specify to save findings (add the save findings 3610 // action to the request). 3611 string finding_id = 1; 3612 3613 // For record transformations, provide a field and container information. 3614 RecordTransformation record_transformation = 2; 3615 } 3616 3617 // Information about the functionality of the container where this finding 3618 // occurred, if available. 3619 TransformationContainerType container_type = 3; 3620} 3621 3622// The field in a record to transform. 3623message RecordTransformation { 3624 // For record transformations, provide a field. 3625 FieldId field_id = 1; 3626 3627 // Findings container modification timestamp, if applicable. 3628 google.protobuf.Timestamp container_timestamp = 2; 3629 3630 // Container version, if available ("generation" for Cloud Storage). 3631 string container_version = 3; 3632} 3633 3634// The outcome of a transformation. 3635message TransformationResultStatus { 3636 // Transformation result status type, this will be either SUCCESS, or it will 3637 // be the reason for why the transformation was not completely successful. 3638 TransformationResultStatusType result_status_type = 1; 3639 3640 // Detailed error codes and messages 3641 google.rpc.Status details = 2; 3642} 3643 3644// Enum of possible outcomes of transformations. SUCCESS if transformation and 3645// storing of transformation was successful, otherwise, reason for not 3646// transforming. 3647enum TransformationResultStatusType { 3648 // Unused. 3649 STATE_TYPE_UNSPECIFIED = 0; 3650 3651 // This will be set when a finding could not be transformed (i.e. outside user 3652 // set bucket range). 3653 INVALID_TRANSFORM = 1; 3654 3655 // This will be set when a BigQuery transformation was successful but could 3656 // not be stored back in BigQuery because the transformed row exceeds 3657 // BigQuery's max row size. 3658 BIGQUERY_MAX_ROW_SIZE_EXCEEDED = 2; 3659 3660 // This will be set when there is a finding in the custom metadata of a file, 3661 // but at the write time of the transformed file, this key / value pair is 3662 // unretrievable. 3663 METADATA_UNRETRIEVABLE = 3; 3664 3665 // This will be set when the transformation and storing of it is successful. 3666 SUCCESS = 4; 3667} 3668 3669// Describes functionality of a given container in its original format. 3670enum TransformationContainerType { 3671 // Unused. 3672 TRANSFORM_UNKNOWN_CONTAINER = 0; 3673 3674 // Body of a file. 3675 TRANSFORM_BODY = 1; 3676 3677 // Metadata for a file. 3678 TRANSFORM_METADATA = 2; 3679 3680 // A table. 3681 TRANSFORM_TABLE = 3; 3682} 3683 3684// An enum of rules that can be used to transform a value. Can be a 3685// record suppression, or one of the transformation rules specified under 3686// `PrimitiveTransformation`. 3687enum TransformationType { 3688 // Unused 3689 TRANSFORMATION_TYPE_UNSPECIFIED = 0; 3690 3691 // Record suppression 3692 RECORD_SUPPRESSION = 1; 3693 3694 // Replace value 3695 REPLACE_VALUE = 2; 3696 3697 // Replace value using a dictionary. 3698 REPLACE_DICTIONARY = 15; 3699 3700 // Redact 3701 REDACT = 3; 3702 3703 // Character mask 3704 CHARACTER_MASK = 4; 3705 3706 // FFX-FPE 3707 CRYPTO_REPLACE_FFX_FPE = 5; 3708 3709 // Fixed size bucketing 3710 FIXED_SIZE_BUCKETING = 6; 3711 3712 // Bucketing 3713 BUCKETING = 7; 3714 3715 // Replace with info type 3716 REPLACE_WITH_INFO_TYPE = 8; 3717 3718 // Time part 3719 TIME_PART = 9; 3720 3721 // Crypto hash 3722 CRYPTO_HASH = 10; 3723 3724 // Date shift 3725 DATE_SHIFT = 12; 3726 3727 // Deterministic crypto 3728 CRYPTO_DETERMINISTIC_CONFIG = 13; 3729 3730 // Redact image 3731 REDACT_IMAGE = 14; 3732} 3733 3734// Config for storing transformation details. 3735message TransformationDetailsStorageConfig { 3736 // Location to store the transformation summary. 3737 oneof type { 3738 // The BigQuery table in which to store the output. This may be an existing 3739 // table or in a new table in an existing dataset. 3740 // If table_id is not set a new one will be generated for you with the 3741 // following format: 3742 // dlp_googleapis_transformation_details_yyyy_mm_dd_[dlp_job_id]. Pacific 3743 // time zone will be used for generating the date details. 3744 BigQueryTable table = 1; 3745 } 3746} 3747 3748// Schedule for inspect job triggers. 3749message Schedule { 3750 // Type of schedule. 3751 oneof option { 3752 // With this option a job is started on a regular periodic basis. For 3753 // example: every day (86400 seconds). 3754 // 3755 // A scheduled start time will be skipped if the previous 3756 // execution has not ended when its scheduled time occurs. 3757 // 3758 // This value must be set to a time duration greater than or equal 3759 // to 1 day and can be no longer than 60 days. 3760 google.protobuf.Duration recurrence_period_duration = 1; 3761 } 3762} 3763 3764// Job trigger option for hybrid jobs. Jobs must be manually created 3765// and finished. 3766message Manual {} 3767 3768// The inspectTemplate contains a configuration (set of types of sensitive data 3769// to be detected) to be used anywhere you otherwise would normally specify 3770// InspectConfig. See 3771// https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to 3772// learn more. 3773message InspectTemplate { 3774 option (google.api.resource) = { 3775 type: "dlp.googleapis.com/InspectTemplate" 3776 pattern: "organizations/{organization}/inspectTemplates/{inspect_template}" 3777 pattern: "projects/{project}/inspectTemplates/{inspect_template}" 3778 pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}" 3779 pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}" 3780 }; 3781 3782 // Output only. The template name. 3783 // 3784 // The template will have one of the following formats: 3785 // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR 3786 // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`; 3787 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 3788 3789 // Display name (max 256 chars). 3790 string display_name = 2; 3791 3792 // Short description (max 256 chars). 3793 string description = 3; 3794 3795 // Output only. The creation timestamp of an inspectTemplate. 3796 google.protobuf.Timestamp create_time = 4 3797 [(google.api.field_behavior) = OUTPUT_ONLY]; 3798 3799 // Output only. The last update timestamp of an inspectTemplate. 3800 google.protobuf.Timestamp update_time = 5 3801 [(google.api.field_behavior) = OUTPUT_ONLY]; 3802 3803 // The core content of the template. Configuration of the scanning process. 3804 InspectConfig inspect_config = 6; 3805} 3806 3807// DeidentifyTemplates contains instructions on how to de-identify content. 3808// See 3809// https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to 3810// learn more. 3811message DeidentifyTemplate { 3812 option (google.api.resource) = { 3813 type: "dlp.googleapis.com/DeidentifyTemplate" 3814 pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}" 3815 pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}" 3816 pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}" 3817 pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}" 3818 }; 3819 3820 // Output only. The template name. 3821 // 3822 // The template will have one of the following formats: 3823 // `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR 3824 // `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` 3825 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 3826 3827 // Display name (max 256 chars). 3828 string display_name = 2; 3829 3830 // Short description (max 256 chars). 3831 string description = 3; 3832 3833 // Output only. The creation timestamp of an inspectTemplate. 3834 google.protobuf.Timestamp create_time = 4 3835 [(google.api.field_behavior) = OUTPUT_ONLY]; 3836 3837 // Output only. The last update timestamp of an inspectTemplate. 3838 google.protobuf.Timestamp update_time = 5 3839 [(google.api.field_behavior) = OUTPUT_ONLY]; 3840 3841 // The core content of the template. 3842 DeidentifyConfig deidentify_config = 6; 3843} 3844 3845// Details information about an error encountered during job execution or 3846// the results of an unsuccessful activation of the JobTrigger. 3847message Error { 3848 // Detailed error codes and messages. 3849 google.rpc.Status details = 1; 3850 3851 // The times the error occurred. List includes the oldest timestamp and the 3852 // last 9 timestamps. 3853 repeated google.protobuf.Timestamp timestamps = 2; 3854} 3855 3856// Contains a configuration to make dlp api calls on a repeating basis. 3857// See 3858// https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers 3859// to learn more. 3860message JobTrigger { 3861 option (google.api.resource) = { 3862 type: "dlp.googleapis.com/JobTrigger" 3863 pattern: "projects/{project}/jobTriggers/{job_trigger}" 3864 pattern: "projects/{project}/locations/{location}/jobTriggers/{job_trigger}" 3865 }; 3866 3867 // What event needs to occur for a new job to be started. 3868 message Trigger { 3869 // What event needs to occur for a new job to be started. 3870 oneof trigger { 3871 // Create a job on a repeating basis based on the elapse of time. 3872 Schedule schedule = 1; 3873 3874 // For use with hybrid jobs. Jobs must be manually created and finished. 3875 Manual manual = 2; 3876 } 3877 } 3878 3879 // Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs 3880 // will be created with this configuration. The service may automatically 3881 // pause triggers experiencing frequent errors. To restart a job, set the 3882 // status to HEALTHY after correcting user errors. 3883 enum Status { 3884 // Unused. 3885 STATUS_UNSPECIFIED = 0; 3886 3887 // Trigger is healthy. 3888 HEALTHY = 1; 3889 3890 // Trigger is temporarily paused. 3891 PAUSED = 2; 3892 3893 // Trigger is cancelled and can not be resumed. 3894 CANCELLED = 3; 3895 } 3896 3897 // Unique resource name for the triggeredJob, assigned by the service when the 3898 // triggeredJob is created, for example 3899 // `projects/dlp-test-project/jobTriggers/53234423`. 3900 string name = 1; 3901 3902 // Display name (max 100 chars) 3903 string display_name = 2; 3904 3905 // User provided description (max 256 chars) 3906 string description = 3; 3907 3908 // The configuration details for the specific type of job to run. 3909 oneof job { 3910 // For inspect jobs, a snapshot of the configuration. 3911 InspectJobConfig inspect_job = 4; 3912 } 3913 3914 // A list of triggers which will be OR'ed together. Only one in the list 3915 // needs to trigger for a job to be started. The list may contain only 3916 // a single Schedule trigger and must have at least one object. 3917 repeated Trigger triggers = 5; 3918 3919 // Output only. A stream of errors encountered when the trigger was activated. 3920 // Repeated errors may result in the JobTrigger automatically being paused. 3921 // Will return the last 100 errors. Whenever the JobTrigger is modified 3922 // this list will be cleared. 3923 repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 3924 3925 // Output only. The creation timestamp of a triggeredJob. 3926 google.protobuf.Timestamp create_time = 7 3927 [(google.api.field_behavior) = OUTPUT_ONLY]; 3928 3929 // Output only. The last update timestamp of a triggeredJob. 3930 google.protobuf.Timestamp update_time = 8 3931 [(google.api.field_behavior) = OUTPUT_ONLY]; 3932 3933 // Output only. The timestamp of the last time this trigger executed. 3934 google.protobuf.Timestamp last_run_time = 9 3935 [(google.api.field_behavior) = OUTPUT_ONLY]; 3936 3937 // Required. A status for this trigger. 3938 Status status = 10 [(google.api.field_behavior) = REQUIRED]; 3939} 3940 3941// A task to execute on the completion of a job. 3942// See https://cloud.google.com/sensitive-data-protection/docs/concepts-actions 3943// to learn more. 3944message Action { 3945 // If set, the detailed findings will be persisted to the specified 3946 // OutputStorageConfig. Only a single instance of this action can be 3947 // specified. 3948 // Compatible with: Inspect, Risk 3949 message SaveFindings { 3950 // Location to store findings outside of DLP. 3951 OutputStorageConfig output_config = 1; 3952 } 3953 3954 // Publish a message into a given Pub/Sub topic when DlpJob has completed. The 3955 // message contains a single field, `DlpJobName`, which is equal to the 3956 // finished job's 3957 // [`DlpJob.name`](https://cloud.google.com/sensitive-data-protection/docs/reference/rest/v2/projects.dlpJobs#DlpJob). 3958 // Compatible with: Inspect, Risk 3959 message PublishToPubSub { 3960 // Cloud Pub/Sub topic to send notifications to. The topic must have given 3961 // publishing access rights to the DLP API service account executing 3962 // the long running DlpJob sending the notifications. 3963 // Format is projects/{project}/topics/{topic}. 3964 string topic = 1; 3965 } 3966 3967 // Publish the result summary of a DlpJob to [Security Command 3968 // Center](https://cloud.google.com/security-command-center). This action is 3969 // available for only projects that belong to an organization. This action 3970 // publishes the count of finding instances and their infoTypes. The summary 3971 // of findings are persisted in Security Command Center and are governed by 3972 // [service-specific policies for Security Command 3973 // Center](https://cloud.google.com/terms/service-terms). Only a single 3974 // instance of this action can be specified. Compatible with: Inspect 3975 message PublishSummaryToCscc {} 3976 3977 // Publish findings of a DlpJob to Data Catalog. In Data Catalog, tag 3978 // templates are applied to the resource that Cloud DLP scanned. Data 3979 // Catalog tag templates are stored in the same project and region where the 3980 // BigQuery table exists. For Cloud DLP to create and apply the tag template, 3981 // the Cloud DLP service agent must have the 3982 // `roles/datacatalog.tagTemplateOwner` permission on the project. The tag 3983 // template contains fields summarizing the results of the DlpJob. Any field 3984 // values previously written by another DlpJob are deleted. [InfoType naming 3985 // patterns][google.privacy.dlp.v2.InfoType] are strictly enforced when using 3986 // this feature. 3987 // 3988 // Findings are persisted in Data Catalog storage and are governed by 3989 // service-specific policies for Data Catalog. For more information, see 3990 // [Service Specific Terms](https://cloud.google.com/terms/service-terms). 3991 // 3992 // Only a single instance of this action can be specified. This action is 3993 // allowed only if all resources being scanned are BigQuery tables. 3994 // Compatible with: Inspect 3995 message PublishFindingsToCloudDataCatalog {} 3996 3997 // Create a de-identified copy of the requested table or files. 3998 // 3999 // A TransformationDetail will be created for each transformation. 4000 // 4001 // If any rows in BigQuery are skipped during de-identification 4002 // (transformation errors or row size exceeds BigQuery insert API limits) they 4003 // are placed in the failure output table. If the original row exceeds 4004 // the BigQuery insert API limit it will be truncated when written to the 4005 // failure output table. The failure output table can be set in the 4006 // action.deidentify.output.big_query_output.deidentified_failure_output_table 4007 // field, if no table is set, a table will be automatically created in the 4008 // same project and dataset as the original table. 4009 // 4010 // Compatible with: Inspect 4011 message Deidentify { 4012 // User specified deidentify templates and configs for structured, 4013 // unstructured, and image files. 4014 TransformationConfig transformation_config = 7; 4015 4016 // Config for storing transformation details. This is separate from the 4017 // de-identified content, and contains metadata about the successful 4018 // transformations and/or failures that occurred while de-identifying. This 4019 // needs to be set in order for users to access information about the status 4020 // of each transformation (see 4021 // [TransformationDetails][google.privacy.dlp.v2.TransformationDetails] 4022 // message for more information about what is noted). 4023 TransformationDetailsStorageConfig transformation_details_storage_config = 4024 3; 4025 4026 // Where to store the output. 4027 oneof output { 4028 // Required. User settable Cloud Storage bucket and folders to store 4029 // de-identified files. This field must be set for cloud storage 4030 // deidentification. The output Cloud Storage bucket must be different 4031 // from the input bucket. De-identified files will overwrite files in the 4032 // output path. 4033 // 4034 // Form of: gs://bucket/folder/ or gs://bucket 4035 string cloud_storage_output = 9 [(google.api.field_behavior) = REQUIRED]; 4036 } 4037 4038 // List of user-specified file type groups to transform. If specified, only 4039 // the files with these filetypes will be transformed. If empty, all 4040 // supported files will be transformed. Supported types may be automatically 4041 // added over time. If a file type is set in this field that isn't supported 4042 // by the Deidentify action then the job will fail and will not be 4043 // successfully created/started. Currently the only filetypes supported are: 4044 // IMAGES, TEXT_FILES, CSV, TSV. 4045 repeated FileType file_types_to_transform = 8; 4046 } 4047 4048 // Sends an email when the job completes. The email goes to IAM project owners 4049 // and technical [Essential 4050 // Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts). 4051 message JobNotificationEmails {} 4052 4053 // Enable Stackdriver metric dlp.googleapis.com/finding_count. This 4054 // will publish a metric to stack driver on each infotype requested and 4055 // how many findings were found for it. CustomDetectors will be bucketed 4056 // as 'Custom' under the Stackdriver label 'info_type'. 4057 message PublishToStackdriver {} 4058 4059 // Extra events to execute after the job has finished. 4060 oneof action { 4061 // Save resulting findings in a provided location. 4062 SaveFindings save_findings = 1; 4063 4064 // Publish a notification to a Pub/Sub topic. 4065 PublishToPubSub pub_sub = 2; 4066 4067 // Publish summary to Cloud Security Command Center (Alpha). 4068 PublishSummaryToCscc publish_summary_to_cscc = 3; 4069 4070 // Publish findings to Cloud Datahub. 4071 PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 4072 5; 4073 4074 // Create a de-identified copy of the input data. 4075 Deidentify deidentify = 7; 4076 4077 // Sends an email when the job completes. The email goes to IAM project 4078 // owners and technical [Essential 4079 // Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts). 4080 JobNotificationEmails job_notification_emails = 8; 4081 4082 // Enable Stackdriver metric dlp.googleapis.com/finding_count. 4083 PublishToStackdriver publish_to_stackdriver = 9; 4084 } 4085} 4086 4087// User specified templates and configs for how to deidentify structured, 4088// unstructures, and image files. User must provide either a unstructured 4089// deidentify template or at least one redact image config. 4090message TransformationConfig { 4091 // De-identify template. 4092 // If this template is specified, it will serve as the default de-identify 4093 // template. This template cannot contain `record_transformations` since it 4094 // can be used for unstructured content such as free-form text files. If this 4095 // template is not set, a default `ReplaceWithInfoTypeConfig` will be used to 4096 // de-identify unstructured content. 4097 string deidentify_template = 1; 4098 4099 // Structured de-identify template. 4100 // If this template is specified, it will serve as the de-identify template 4101 // for structured content such as delimited files and tables. If this template 4102 // is not set but the `deidentify_template` is set, then `deidentify_template` 4103 // will also apply to the structured content. If neither template is set, a 4104 // default `ReplaceWithInfoTypeConfig` will be used to de-identify structured 4105 // content. 4106 string structured_deidentify_template = 2; 4107 4108 // Image redact template. 4109 // If this template is specified, it will serve as the de-identify template 4110 // for images. If this template is not set, all findings in the image will be 4111 // redacted with a black box. 4112 string image_redact_template = 4; 4113} 4114 4115// Request message for CreateInspectTemplate. 4116message CreateInspectTemplateRequest { 4117 // Required. Parent resource name. 4118 // 4119 // The format of this value varies depending on the scope of the request 4120 // (project or organization) and whether you have [specified a processing 4121 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 4122 // 4123 // + Projects scope, location specified:<br/> 4124 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4125 // + Projects scope, no location specified (defaults to global):<br/> 4126 // `projects/`<var>PROJECT_ID</var> 4127 // + Organizations scope, location specified:<br/> 4128 // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var> 4129 // + Organizations scope, no location specified (defaults to global):<br/> 4130 // `organizations/`<var>ORG_ID</var> 4131 // 4132 // The following example `parent` string specifies a parent project with the 4133 // identifier `example-project`, and specifies the `europe-west3` location 4134 // for processing data: 4135 // 4136 // parent=projects/example-project/locations/europe-west3 4137 string parent = 1 [ 4138 (google.api.field_behavior) = REQUIRED, 4139 (google.api.resource_reference) = { 4140 child_type: "dlp.googleapis.com/InspectTemplate" 4141 } 4142 ]; 4143 4144 // Required. The InspectTemplate to create. 4145 InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED]; 4146 4147 // The template id can contain uppercase and lowercase letters, 4148 // numbers, and hyphens; that is, it must match the regular 4149 // expression: `[a-zA-Z\d-_]+`. The maximum length is 100 4150 // characters. Can be empty to allow the system to generate one. 4151 string template_id = 3; 4152 4153 // Deprecated. This field has no effect. 4154 string location_id = 4; 4155} 4156 4157// Request message for UpdateInspectTemplate. 4158message UpdateInspectTemplateRequest { 4159 // Required. Resource name of organization and inspectTemplate to be updated, 4160 // for example `organizations/433245324/inspectTemplates/432452342` or 4161 // projects/project-id/inspectTemplates/432452342. 4162 string name = 1 [ 4163 (google.api.field_behavior) = REQUIRED, 4164 (google.api.resource_reference) = { 4165 type: "dlp.googleapis.com/InspectTemplate" 4166 } 4167 ]; 4168 4169 // New InspectTemplate value. 4170 InspectTemplate inspect_template = 2; 4171 4172 // Mask to control which fields get updated. 4173 google.protobuf.FieldMask update_mask = 3; 4174} 4175 4176// Request message for GetInspectTemplate. 4177message GetInspectTemplateRequest { 4178 // Required. Resource name of the organization and inspectTemplate to be read, 4179 // for example `organizations/433245324/inspectTemplates/432452342` or 4180 // projects/project-id/inspectTemplates/432452342. 4181 string name = 1 [ 4182 (google.api.field_behavior) = REQUIRED, 4183 (google.api.resource_reference) = { 4184 type: "dlp.googleapis.com/InspectTemplate" 4185 } 4186 ]; 4187} 4188 4189// Request message for ListInspectTemplates. 4190message ListInspectTemplatesRequest { 4191 // Required. Parent resource name. 4192 // 4193 // The format of this value varies depending on the scope of the request 4194 // (project or organization) and whether you have [specified a processing 4195 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 4196 // 4197 // + Projects scope, location specified:<br/> 4198 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4199 // + Projects scope, no location specified (defaults to global):<br/> 4200 // `projects/`<var>PROJECT_ID</var> 4201 // + Organizations scope, location specified:<br/> 4202 // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var> 4203 // + Organizations scope, no location specified (defaults to global):<br/> 4204 // `organizations/`<var>ORG_ID</var> 4205 // 4206 // The following example `parent` string specifies a parent project with the 4207 // identifier `example-project`, and specifies the `europe-west3` location 4208 // for processing data: 4209 // 4210 // parent=projects/example-project/locations/europe-west3 4211 string parent = 1 [ 4212 (google.api.field_behavior) = REQUIRED, 4213 (google.api.resource_reference) = { 4214 child_type: "dlp.googleapis.com/InspectTemplate" 4215 } 4216 ]; 4217 4218 // Page token to continue retrieval. Comes from the previous call 4219 // to `ListInspectTemplates`. 4220 string page_token = 2; 4221 4222 // Size of the page. This value can be limited by the server. If zero server 4223 // returns a page of max size 100. 4224 int32 page_size = 3; 4225 4226 // Comma separated list of fields to order by, 4227 // followed by `asc` or `desc` postfix. This list is case insensitive. The 4228 // default sorting order is ascending. Redundant space characters are 4229 // insignificant. 4230 // 4231 // Example: `name asc,update_time, create_time desc` 4232 // 4233 // Supported fields are: 4234 // 4235 // - `create_time`: corresponds to the time the template was created. 4236 // - `update_time`: corresponds to the time the template was last updated. 4237 // - `name`: corresponds to the template's name. 4238 // - `display_name`: corresponds to the template's display name. 4239 string order_by = 4; 4240 4241 // Deprecated. This field has no effect. 4242 string location_id = 5; 4243} 4244 4245// Response message for ListInspectTemplates. 4246message ListInspectTemplatesResponse { 4247 // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. 4248 repeated InspectTemplate inspect_templates = 1; 4249 4250 // If the next page is available then the next page token to be used in the 4251 // following ListInspectTemplates request. 4252 string next_page_token = 2; 4253} 4254 4255// Request message for DeleteInspectTemplate. 4256message DeleteInspectTemplateRequest { 4257 // Required. Resource name of the organization and inspectTemplate to be 4258 // deleted, for example `organizations/433245324/inspectTemplates/432452342` 4259 // or projects/project-id/inspectTemplates/432452342. 4260 string name = 1 [ 4261 (google.api.field_behavior) = REQUIRED, 4262 (google.api.resource_reference) = { 4263 type: "dlp.googleapis.com/InspectTemplate" 4264 } 4265 ]; 4266} 4267 4268// Request message for CreateJobTrigger. 4269message CreateJobTriggerRequest { 4270 // Required. Parent resource name. 4271 // 4272 // The format of this value varies depending on whether you have [specified a 4273 // processing 4274 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 4275 // 4276 // + Projects scope, location specified:<br/> 4277 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4278 // + Projects scope, no location specified (defaults to global):<br/> 4279 // `projects/`<var>PROJECT_ID</var> 4280 // 4281 // The following example `parent` string specifies a parent project with the 4282 // identifier `example-project`, and specifies the `europe-west3` location 4283 // for processing data: 4284 // 4285 // parent=projects/example-project/locations/europe-west3 4286 string parent = 1 [ 4287 (google.api.field_behavior) = REQUIRED, 4288 (google.api.resource_reference) = { 4289 child_type: "dlp.googleapis.com/JobTrigger" 4290 } 4291 ]; 4292 4293 // Required. The JobTrigger to create. 4294 JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED]; 4295 4296 // The trigger id can contain uppercase and lowercase letters, 4297 // numbers, and hyphens; that is, it must match the regular 4298 // expression: `[a-zA-Z\d-_]+`. The maximum length is 100 4299 // characters. Can be empty to allow the system to generate one. 4300 string trigger_id = 3; 4301 4302 // Deprecated. This field has no effect. 4303 string location_id = 4; 4304} 4305 4306// Request message for ActivateJobTrigger. 4307message ActivateJobTriggerRequest { 4308 // Required. Resource name of the trigger to activate, for example 4309 // `projects/dlp-test-project/jobTriggers/53234423`. 4310 string name = 1 [ 4311 (google.api.field_behavior) = REQUIRED, 4312 (google.api.resource_reference) = { type: "dlp.googleapis.com/JobTrigger" } 4313 ]; 4314} 4315 4316// Request message for UpdateJobTrigger. 4317message UpdateJobTriggerRequest { 4318 // Required. Resource name of the project and the triggeredJob, for example 4319 // `projects/dlp-test-project/jobTriggers/53234423`. 4320 string name = 1 [ 4321 (google.api.field_behavior) = REQUIRED, 4322 (google.api.resource_reference) = { type: "dlp.googleapis.com/JobTrigger" } 4323 ]; 4324 4325 // New JobTrigger value. 4326 JobTrigger job_trigger = 2; 4327 4328 // Mask to control which fields get updated. 4329 google.protobuf.FieldMask update_mask = 3; 4330} 4331 4332// Request message for GetJobTrigger. 4333message GetJobTriggerRequest { 4334 // Required. Resource name of the project and the triggeredJob, for example 4335 // `projects/dlp-test-project/jobTriggers/53234423`. 4336 string name = 1 [ 4337 (google.api.field_behavior) = REQUIRED, 4338 (google.api.resource_reference) = { type: "dlp.googleapis.com/JobTrigger" } 4339 ]; 4340} 4341 4342// Request message for CreateDiscoveryConfig. 4343message CreateDiscoveryConfigRequest { 4344 // Required. Parent resource name. 4345 // 4346 // The format of this value is as follows: 4347 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4348 // 4349 // The following example `parent` string specifies a parent project with the 4350 // identifier `example-project`, and specifies the `europe-west3` location 4351 // for processing data: 4352 // 4353 // parent=projects/example-project/locations/europe-west3 4354 string parent = 1 [ 4355 (google.api.field_behavior) = REQUIRED, 4356 (google.api.resource_reference) = { 4357 child_type: "dlp.googleapis.com/DiscoveryConfig" 4358 } 4359 ]; 4360 4361 // Required. The DiscoveryConfig to create. 4362 DiscoveryConfig discovery_config = 2 [(google.api.field_behavior) = REQUIRED]; 4363 4364 // The config ID can contain uppercase and lowercase letters, 4365 // numbers, and hyphens; that is, it must match the regular 4366 // expression: `[a-zA-Z\d-_]+`. The maximum length is 100 4367 // characters. Can be empty to allow the system to generate one. 4368 string config_id = 3; 4369} 4370 4371// Request message for UpdateDiscoveryConfig. 4372message UpdateDiscoveryConfigRequest { 4373 // Required. Resource name of the project and the configuration, for example 4374 // `projects/dlp-test-project/discoveryConfigs/53234423`. 4375 string name = 1 [ 4376 (google.api.field_behavior) = REQUIRED, 4377 (google.api.resource_reference) = { 4378 type: "dlp.googleapis.com/DiscoveryConfig" 4379 } 4380 ]; 4381 4382 // Required. New DiscoveryConfig value. 4383 DiscoveryConfig discovery_config = 2 [(google.api.field_behavior) = REQUIRED]; 4384 4385 // Mask to control which fields get updated. 4386 google.protobuf.FieldMask update_mask = 3; 4387} 4388 4389// Request message for GetDiscoveryConfig. 4390message GetDiscoveryConfigRequest { 4391 // Required. Resource name of the project and the configuration, for example 4392 // `projects/dlp-test-project/discoveryConfigs/53234423`. 4393 string name = 1 [ 4394 (google.api.field_behavior) = REQUIRED, 4395 (google.api.resource_reference) = { 4396 type: "dlp.googleapis.com/DiscoveryConfig" 4397 } 4398 ]; 4399} 4400 4401// Request message for ListDiscoveryConfigs. 4402message ListDiscoveryConfigsRequest { 4403 // Required. Parent resource name. 4404 // 4405 // The format of this value is as follows: 4406 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4407 // 4408 // The following example `parent` string specifies a parent project with the 4409 // identifier `example-project`, and specifies the `europe-west3` location 4410 // for processing data: 4411 // 4412 // parent=projects/example-project/locations/europe-west3 4413 string parent = 1 [ 4414 (google.api.field_behavior) = REQUIRED, 4415 (google.api.resource_reference) = { 4416 child_type: "dlp.googleapis.com/DiscoveryConfig" 4417 } 4418 ]; 4419 4420 // Page token to continue retrieval. Comes from the previous call 4421 // to ListDiscoveryConfigs. `order_by` field must not 4422 // change for subsequent calls. 4423 string page_token = 2; 4424 4425 // Size of the page. This value can be limited by a server. 4426 int32 page_size = 3; 4427 4428 // Comma separated list of config fields to order by, 4429 // followed by `asc` or `desc` postfix. This list is case insensitive. The 4430 // default sorting order is ascending. Redundant space characters are 4431 // insignificant. 4432 // 4433 // Example: `name asc,update_time, create_time desc` 4434 // 4435 // Supported fields are: 4436 // 4437 // - `last_run_time`: corresponds to the last time the DiscoveryConfig ran. 4438 // - `name`: corresponds to the DiscoveryConfig's name. 4439 // - `status`: corresponds to DiscoveryConfig's status. 4440 string order_by = 4; 4441} 4442 4443// Response message for ListDiscoveryConfigs. 4444message ListDiscoveryConfigsResponse { 4445 // List of configs, up to page_size in ListDiscoveryConfigsRequest. 4446 repeated DiscoveryConfig discovery_configs = 1; 4447 4448 // If the next page is available then this value is the next page token to be 4449 // used in the following ListDiscoveryConfigs request. 4450 string next_page_token = 2; 4451} 4452 4453// Request message for DeleteDiscoveryConfig. 4454message DeleteDiscoveryConfigRequest { 4455 // Required. Resource name of the project and the config, for example 4456 // `projects/dlp-test-project/discoveryConfigs/53234423`. 4457 string name = 1 [ 4458 (google.api.field_behavior) = REQUIRED, 4459 (google.api.resource_reference) = { 4460 type: "dlp.googleapis.com/DiscoveryConfig" 4461 } 4462 ]; 4463} 4464 4465// Request message for CreateDlpJobRequest. Used to initiate long running 4466// jobs such as calculating risk metrics or inspecting Google Cloud 4467// Storage. 4468message CreateDlpJobRequest { 4469 // Required. Parent resource name. 4470 // 4471 // The format of this value varies depending on whether you have [specified a 4472 // processing 4473 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 4474 // 4475 // + Projects scope, location specified:<br/> 4476 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4477 // + Projects scope, no location specified (defaults to global):<br/> 4478 // `projects/`<var>PROJECT_ID</var> 4479 // 4480 // The following example `parent` string specifies a parent project with the 4481 // identifier `example-project`, and specifies the `europe-west3` location 4482 // for processing data: 4483 // 4484 // parent=projects/example-project/locations/europe-west3 4485 string parent = 1 [ 4486 (google.api.field_behavior) = REQUIRED, 4487 (google.api.resource_reference) = { 4488 child_type: "dlp.googleapis.com/DlpJob" 4489 } 4490 ]; 4491 4492 // The configuration details for the specific type of job to run. 4493 oneof job { 4494 // An inspection job scans a storage repository for InfoTypes. 4495 InspectJobConfig inspect_job = 2; 4496 4497 // A risk analysis job calculates re-identification risk metrics for a 4498 // BigQuery table. 4499 RiskAnalysisJobConfig risk_job = 3; 4500 } 4501 4502 // The job id can contain uppercase and lowercase letters, 4503 // numbers, and hyphens; that is, it must match the regular 4504 // expression: `[a-zA-Z\d-_]+`. The maximum length is 100 4505 // characters. Can be empty to allow the system to generate one. 4506 string job_id = 4; 4507 4508 // Deprecated. This field has no effect. 4509 string location_id = 5; 4510} 4511 4512// Request message for ListJobTriggers. 4513message ListJobTriggersRequest { 4514 // Required. Parent resource name. 4515 // 4516 // The format of this value varies depending on whether you have [specified a 4517 // processing 4518 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 4519 // 4520 // + Projects scope, location specified:<br/> 4521 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 4522 // + Projects scope, no location specified (defaults to global):<br/> 4523 // `projects/`<var>PROJECT_ID</var> 4524 // 4525 // The following example `parent` string specifies a parent project with the 4526 // identifier `example-project`, and specifies the `europe-west3` location 4527 // for processing data: 4528 // 4529 // parent=projects/example-project/locations/europe-west3 4530 string parent = 1 [ 4531 (google.api.field_behavior) = REQUIRED, 4532 (google.api.resource_reference) = { 4533 child_type: "dlp.googleapis.com/JobTrigger" 4534 } 4535 ]; 4536 4537 // Page token to continue retrieval. Comes from the previous call 4538 // to ListJobTriggers. `order_by` field must not 4539 // change for subsequent calls. 4540 string page_token = 2; 4541 4542 // Size of the page. This value can be limited by a server. 4543 int32 page_size = 3; 4544 4545 // Comma separated list of triggeredJob fields to order by, 4546 // followed by `asc` or `desc` postfix. This list is case insensitive. The 4547 // default sorting order is ascending. Redundant space characters are 4548 // insignificant. 4549 // 4550 // Example: `name asc,update_time, create_time desc` 4551 // 4552 // Supported fields are: 4553 // 4554 // - `create_time`: corresponds to the time the JobTrigger was created. 4555 // - `update_time`: corresponds to the time the JobTrigger was last updated. 4556 // - `last_run_time`: corresponds to the last time the JobTrigger ran. 4557 // - `name`: corresponds to the JobTrigger's name. 4558 // - `display_name`: corresponds to the JobTrigger's display name. 4559 // - `status`: corresponds to JobTrigger's status. 4560 string order_by = 4; 4561 4562 // Allows filtering. 4563 // 4564 // Supported syntax: 4565 // 4566 // * Filter expressions are made up of one or more restrictions. 4567 // * Restrictions can be combined by `AND` or `OR` logical operators. A 4568 // sequence of restrictions implicitly uses `AND`. 4569 // * A restriction has the form of `{field} {operator} {value}`. 4570 // * Supported fields/values for inspect triggers: 4571 // - `status` - HEALTHY|PAUSED|CANCELLED 4572 // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY 4573 // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by 4574 // quotation marks. Nanoseconds are ignored. 4575 // - 'error_count' - Number of errors that have occurred while running. 4576 // * The operator must be `=` or `!=` for status and inspected_storage. 4577 // 4578 // Examples: 4579 // 4580 // * inspected_storage = cloud_storage AND status = HEALTHY 4581 // * inspected_storage = cloud_storage OR inspected_storage = bigquery 4582 // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) 4583 // * last_run_time > \"2017-12-12T00:00:00+00:00\" 4584 // 4585 // The length of this field should be no more than 500 characters. 4586 string filter = 5; 4587 4588 // The type of jobs. Will use `DlpJobType.INSPECT` if not set. 4589 DlpJobType type = 6; 4590 4591 // Deprecated. This field has no effect. 4592 string location_id = 7; 4593} 4594 4595// Response message for ListJobTriggers. 4596message ListJobTriggersResponse { 4597 // List of triggeredJobs, up to page_size in ListJobTriggersRequest. 4598 repeated JobTrigger job_triggers = 1; 4599 4600 // If the next page is available then this value is the next page token to be 4601 // used in the following ListJobTriggers request. 4602 string next_page_token = 2; 4603} 4604 4605// Request message for DeleteJobTrigger. 4606message DeleteJobTriggerRequest { 4607 // Required. Resource name of the project and the triggeredJob, for example 4608 // `projects/dlp-test-project/jobTriggers/53234423`. 4609 string name = 1 [ 4610 (google.api.field_behavior) = REQUIRED, 4611 (google.api.resource_reference) = { type: "dlp.googleapis.com/JobTrigger" } 4612 ]; 4613} 4614 4615// Controls what and how to inspect for findings. 4616message InspectJobConfig { 4617 // The data to scan. 4618 StorageConfig storage_config = 1; 4619 4620 // How and what to scan for. 4621 InspectConfig inspect_config = 2; 4622 4623 // If provided, will be used as the default for all values in InspectConfig. 4624 // `inspect_config` will be merged into the values persisted as part of the 4625 // template. 4626 string inspect_template_name = 3; 4627 4628 // Actions to execute at the completion of the job. 4629 repeated Action actions = 4; 4630} 4631 4632// A task to execute when a data profile has been generated. 4633message DataProfileAction { 4634 // If set, the detailed data profiles will be persisted to the location 4635 // of your choice whenever updated. 4636 message Export { 4637 // Store all table and column profiles in an existing table or a new table 4638 // in an existing dataset. Each re-generation will result in a new row in 4639 // BigQuery. 4640 BigQueryTable profile_table = 1; 4641 } 4642 4643 // Send a Pub/Sub message into the given Pub/Sub topic to connect other 4644 // systems to data profile generation. The message payload data will 4645 // be the byte serialization of `DataProfilePubSubMessage`. 4646 message PubSubNotification { 4647 // The levels of detail that can be included in the Pub/Sub message. 4648 enum DetailLevel { 4649 // Unused. 4650 DETAIL_LEVEL_UNSPECIFIED = 0; 4651 4652 // The full table data profile. 4653 TABLE_PROFILE = 1; 4654 4655 // The resource name of the table. 4656 RESOURCE_NAME = 2; 4657 } 4658 4659 // Cloud Pub/Sub topic to send notifications to. 4660 // Format is projects/{project}/topics/{topic}. 4661 string topic = 1; 4662 4663 // The type of event that triggers a Pub/Sub. At most one 4664 // `PubSubNotification` per EventType is permitted. 4665 EventType event = 2; 4666 4667 // Conditions (e.g., data risk or sensitivity level) for triggering a 4668 // Pub/Sub. 4669 DataProfilePubSubCondition pubsub_condition = 3; 4670 4671 // How much data to include in the Pub/Sub message. If the user wishes to 4672 // limit the size of the message, they can use resource_name and fetch the 4673 // profile fields they wish to. Per table profile (not per column). 4674 DetailLevel detail_of_message = 4; 4675 } 4676 4677 // Types of event that can trigger an action. 4678 enum EventType { 4679 // Unused. 4680 EVENT_TYPE_UNSPECIFIED = 0; 4681 4682 // New profile (not a re-profile). 4683 NEW_PROFILE = 1; 4684 4685 // Changed one of the following profile metrics: 4686 // * Table data risk score 4687 // * Table sensitivity score 4688 // * Table resource visibility 4689 // * Table encryption type 4690 // * Table predicted infoTypes 4691 // * Table other infoTypes 4692 CHANGED_PROFILE = 2; 4693 4694 // Table data risk score or sensitivity score increased. 4695 SCORE_INCREASED = 3; 4696 4697 // A user (non-internal) error occurred. 4698 ERROR_CHANGED = 4; 4699 } 4700 4701 // Type of action to execute when a profile is generated. 4702 oneof action { 4703 // Export data profiles into a provided location. 4704 Export export_data = 1; 4705 4706 // Publish a message into the Pub/Sub topic. 4707 PubSubNotification pub_sub_notification = 2; 4708 } 4709} 4710 4711// Configuration for setting up a job to scan resources for profile generation. 4712// Only one data profile configuration may exist per organization, folder, 4713// or project. 4714// 4715// The generated data profiles are retained according to the 4716// [data retention policy] 4717// (https://cloud.google.com/sensitive-data-protection/docs/data-profiles#retention). 4718message DataProfileJobConfig { 4719 // The data to scan. 4720 DataProfileLocation location = 1; 4721 4722 // The project that will run the scan. The DLP service 4723 // account that exists within this project must have access to all resources 4724 // that are profiled, and the Cloud DLP API must be enabled. 4725 string project_id = 5; 4726 4727 // Detection logic for profile generation. 4728 // 4729 // Not all template features are used by profiles. FindingLimits, 4730 // include_quote and exclude_info_types have no impact on 4731 // data profiling. 4732 // 4733 // Multiple templates may be provided if there is data in multiple regions. 4734 // At most one template must be specified per-region (including "global"). 4735 // Each region is scanned using the applicable template. If no region-specific 4736 // template is specified, but a "global" template is specified, it will be 4737 // copied to that region and used instead. If no global or region-specific 4738 // template is provided for a region with data, that region's data will not be 4739 // scanned. 4740 // 4741 // For more information, see 4742 // https://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency. 4743 repeated string inspect_templates = 7; 4744 4745 // Actions to execute at the completion of the job. 4746 repeated DataProfileAction data_profile_actions = 6; 4747} 4748 4749// A pattern to match against one or more tables, datasets, or projects that 4750// contain BigQuery tables. At least one pattern must be specified. 4751// Regular expressions use RE2 4752// [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found 4753// under the google/re2 repository on GitHub. 4754message BigQueryRegex { 4755 // For organizations, if unset, will match all projects. Has no effect 4756 // for data profile configurations created within a project. 4757 string project_id_regex = 1; 4758 4759 // If unset, this property matches all datasets. 4760 string dataset_id_regex = 2; 4761 4762 // If unset, this property matches all tables. 4763 string table_id_regex = 3; 4764} 4765 4766// A collection of regular expressions to determine what tables to match 4767// against. 4768message BigQueryRegexes { 4769 // A single BigQuery regular expression pattern to match against one or more 4770 // tables, datasets, or projects that contain BigQuery tables. 4771 repeated BigQueryRegex patterns = 1; 4772} 4773 4774// The types of BigQuery tables supported by Cloud DLP. 4775message BigQueryTableTypes { 4776 // A set of BigQuery table types. 4777 repeated BigQueryTableType types = 1; 4778} 4779 4780// Over time new types may be added. Currently VIEW, MATERIALIZED_VIEW, 4781// and SNAPSHOT are not supported. 4782enum BigQueryTableTypeCollection { 4783 // Unused. 4784 BIG_QUERY_COLLECTION_UNSPECIFIED = 0; 4785 4786 // Automatically generate profiles for all tables, even if the table type is 4787 // not yet fully supported for analysis. Profiles for unsupported tables will 4788 // be generated with errors to indicate their partial support. When full 4789 // support is added, the tables will automatically be profiled during the next 4790 // scheduled run. 4791 BIG_QUERY_COLLECTION_ALL_TYPES = 1; 4792 4793 // Only those types fully supported will be profiled. Will expand 4794 // automatically as Cloud DLP adds support for new table types. Unsupported 4795 // table types will not have partial profiles generated. 4796 BIG_QUERY_COLLECTION_ONLY_SUPPORTED_TYPES = 2; 4797} 4798 4799// Over time new types may be added. Currently VIEW, MATERIALIZED_VIEW, 4800// SNAPSHOT, and non-BigLake external tables are not supported. 4801enum BigQueryTableType { 4802 // Unused. 4803 BIG_QUERY_TABLE_TYPE_UNSPECIFIED = 0; 4804 4805 // A normal BigQuery table. 4806 BIG_QUERY_TABLE_TYPE_TABLE = 1; 4807 4808 // A table that references data stored in Cloud Storage. 4809 BIG_QUERY_TABLE_TYPE_EXTERNAL_BIG_LAKE = 2; 4810} 4811 4812// How frequently data profiles can be updated. New options can be added at a 4813// later time. 4814enum DataProfileUpdateFrequency { 4815 // Unspecified. 4816 UPDATE_FREQUENCY_UNSPECIFIED = 0; 4817 4818 // After the data profile is created, it will never be updated. 4819 UPDATE_FREQUENCY_NEVER = 1; 4820 4821 // The data profile can be updated up to once every 24 hours. 4822 UPDATE_FREQUENCY_DAILY = 2; 4823 4824 // The data profile can be updated up to once every 30 days. Default. 4825 UPDATE_FREQUENCY_MONTHLY = 4; 4826} 4827 4828// Do not profile the tables. 4829message Disabled {} 4830 4831// The data that will be profiled. 4832message DataProfileLocation { 4833 // The location to be scanned. 4834 oneof location { 4835 // The ID of an organization to scan. 4836 int64 organization_id = 1; 4837 4838 // The ID of the Folder within an organization to scan. 4839 int64 folder_id = 2; 4840 } 4841} 4842 4843// Configuration for discovery to scan resources for profile generation. 4844// Only one discovery configuration may exist per organization, folder, 4845// or project. 4846// 4847// The generated data profiles are retained according to the 4848// [data retention policy] 4849// (https://cloud.google.com/sensitive-data-protection/docs/data-profiles#retention). 4850message DiscoveryConfig { 4851 option (google.api.resource) = { 4852 type: "dlp.googleapis.com/DiscoveryConfig" 4853 pattern: "projects/{project}/locations/{location}/discoveryConfigs/{discovery_config}" 4854 }; 4855 4856 // Project and scan location information. Only set when the parent is an org. 4857 message OrgConfig { 4858 // The data to scan: folder, org, or project 4859 DiscoveryStartingLocation location = 1; 4860 4861 // The project that will run the scan. The DLP service 4862 // account that exists within this project must have access to all resources 4863 // that are profiled, and the Cloud DLP API must be enabled. 4864 string project_id = 2; 4865 } 4866 4867 // Whether the discovery config is currently active. New options may be added 4868 // at a later time. 4869 enum Status { 4870 // Unused 4871 STATUS_UNSPECIFIED = 0; 4872 4873 // The discovery config is currently active. 4874 RUNNING = 1; 4875 4876 // The discovery config is paused temporarily. 4877 PAUSED = 2; 4878 } 4879 4880 // Unique resource name for the DiscoveryConfig, assigned by the service when 4881 // the DiscoveryConfig is created, for example 4882 // `projects/dlp-test-project/locations/global/discoveryConfigs/53234423`. 4883 string name = 1; 4884 4885 // Display name (max 100 chars) 4886 string display_name = 11; 4887 4888 // Only set when the parent is an org. 4889 OrgConfig org_config = 2; 4890 4891 // Detection logic for profile generation. 4892 // 4893 // Not all template features are used by Discovery. FindingLimits, 4894 // include_quote and exclude_info_types have no impact on 4895 // Discovery. 4896 // 4897 // Multiple templates may be provided if there is data in multiple regions. 4898 // At most one template must be specified per-region (including "global"). 4899 // Each region is scanned using the applicable template. If no region-specific 4900 // template is specified, but a "global" template is specified, it will be 4901 // copied to that region and used instead. If no global or region-specific 4902 // template is provided for a region with data, that region's data will not be 4903 // scanned. 4904 // 4905 // For more information, see 4906 // https://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency. 4907 repeated string inspect_templates = 3; 4908 4909 // Actions to execute at the completion of scanning. 4910 repeated DataProfileAction actions = 4; 4911 4912 // Target to match against for determining what to scan and how frequently. 4913 repeated DiscoveryTarget targets = 5; 4914 4915 // Output only. A stream of errors encountered when the config was activated. 4916 // Repeated errors may result in the config automatically being paused. Output 4917 // only field. Will return the last 100 errors. Whenever the config is 4918 // modified this list will be cleared. 4919 repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 4920 4921 // Output only. The creation timestamp of a DiscoveryConfig. 4922 google.protobuf.Timestamp create_time = 7 4923 [(google.api.field_behavior) = OUTPUT_ONLY]; 4924 4925 // Output only. The last update timestamp of a DiscoveryConfig. 4926 google.protobuf.Timestamp update_time = 8 4927 [(google.api.field_behavior) = OUTPUT_ONLY]; 4928 4929 // Output only. The timestamp of the last time this config was executed. 4930 google.protobuf.Timestamp last_run_time = 9 4931 [(google.api.field_behavior) = OUTPUT_ONLY]; 4932 4933 // Required. A status for this configuration. 4934 Status status = 10 [(google.api.field_behavior) = REQUIRED]; 4935} 4936 4937// Target used to match against for Discovery. 4938message DiscoveryTarget { 4939 // A target to match against for Discovery. 4940 oneof target { 4941 // BigQuery target for Discovery. The first target to match a table will be 4942 // the one applied. 4943 BigQueryDiscoveryTarget big_query_target = 1; 4944 } 4945} 4946 4947// Target used to match against for discovery with BigQuery tables 4948message BigQueryDiscoveryTarget { 4949 // Required. The tables the discovery cadence applies to. The first target 4950 // with a matching filter will be the one to apply to a table. 4951 DiscoveryBigQueryFilter filter = 1 [(google.api.field_behavior) = REQUIRED]; 4952 4953 // In addition to matching the filter, these conditions must be true 4954 // before a profile is generated. 4955 DiscoveryBigQueryConditions conditions = 2; 4956 4957 // The generation rule includes the logic on how frequently 4958 // to update the data profiles. If not specified, discovery will re-run and 4959 // update no more than once a month if new columns appear in the table. 4960 oneof frequency { 4961 // How often and when to update profiles. New tables that match both the 4962 // filter and conditions are scanned as quickly as possible depending on 4963 // system capacity. 4964 DiscoveryGenerationCadence cadence = 3; 4965 4966 // Tables that match this filter will not have profiles created. 4967 Disabled disabled = 4; 4968 } 4969} 4970 4971// Determines what tables will have profiles generated within an organization 4972// or project. Includes the ability to filter by regular expression patterns 4973// on project ID, dataset ID, and table ID. 4974message DiscoveryBigQueryFilter { 4975 // Catch-all for all other tables not specified by other filters. Should 4976 // always be last, except for single-table configurations, which will only 4977 // have a TableReference target. 4978 message AllOtherBigQueryTables {} 4979 4980 // Whether the filter applies to a specific set of tables or all other tables 4981 // within the location being profiled. The first filter to match will be 4982 // applied, regardless of the condition. If none is set, will default to 4983 // `other_tables`. 4984 oneof filter { 4985 // A specific set of tables for this filter to apply to. A table collection 4986 // must be specified in only one filter per config. 4987 // If a table id or dataset is empty, Cloud DLP assumes all tables in that 4988 // collection must be profiled. Must specify a project ID. 4989 BigQueryTableCollection tables = 1; 4990 4991 // Catch-all. This should always be the last filter in the list because 4992 // anything above it will apply first. Should only appear once in a 4993 // configuration. If none is specified, a default one will be added 4994 // automatically. 4995 AllOtherBigQueryTables other_tables = 2; 4996 } 4997} 4998 4999// Specifies a collection of BigQuery tables. Used for Discovery. 5000message BigQueryTableCollection { 5001 // Maximum of 100 entries. 5002 // The first filter containing a pattern that matches a table will be used. 5003 oneof pattern { 5004 // A collection of regular expressions to match a BigQuery table against. 5005 BigQueryRegexes include_regexes = 1; 5006 } 5007} 5008 5009// Requirements that must be true before a table is scanned in discovery for the 5010// first time. There is an AND relationship between the top-level attributes. 5011// Additionally, minimum conditions with an OR relationship that must be met 5012// before Cloud DLP scans a table can be set (like a minimum row count or a 5013// minimum table age). 5014message DiscoveryBigQueryConditions { 5015 // There is an OR relationship between these attributes. They are used to 5016 // determine if a table should be scanned or not in Discovery. 5017 message OrConditions { 5018 // Minimum number of rows that should be present before Cloud DLP 5019 // profiles a table 5020 int32 min_row_count = 1; 5021 5022 // Minimum age a table must have before Cloud DLP can profile it. Value must 5023 // be 1 hour or greater. 5024 google.protobuf.Duration min_age = 2; 5025 } 5026 5027 // BigQuery table must have been created after this date. Used to avoid 5028 // backfilling. 5029 google.protobuf.Timestamp created_after = 1; 5030 5031 // The type of BigQuery tables to scan. If nothing is set the default 5032 // behavior is to scan only tables of type TABLE and to give errors 5033 // for all unsupported tables. 5034 oneof included_types { 5035 // Restrict discovery to specific table types. 5036 BigQueryTableTypes types = 2; 5037 5038 // Restrict discovery to categories of table types. 5039 BigQueryTableTypeCollection type_collection = 3; 5040 } 5041 5042 // At least one of the conditions must be true for a table to be scanned. 5043 OrConditions or_conditions = 4; 5044} 5045 5046// What must take place for a profile to be updated and how 5047// frequently it should occur. 5048// New tables are scanned as quickly as possible depending on system 5049// capacity. 5050message DiscoveryGenerationCadence { 5051 // Governs when to update data profiles when a schema is modified. 5052 DiscoverySchemaModifiedCadence schema_modified_cadence = 1; 5053 5054 // Governs when to update data profiles when a table is modified. 5055 DiscoveryTableModifiedCadence table_modified_cadence = 2; 5056} 5057 5058// The cadence at which to update data profiles when a table is modified. 5059message DiscoveryTableModifiedCadence { 5060 // The type of events to consider when deciding if the table has been 5061 // modified and should have the profile updated. Defaults to 5062 // MODIFIED_TIMESTAMP. 5063 repeated BigQueryTableModification types = 1; 5064 5065 // How frequently data profiles can be updated when tables are modified. 5066 // Defaults to never. 5067 DataProfileUpdateFrequency frequency = 2; 5068} 5069 5070// Attributes evaluated to determine if a table has been modified. New values 5071// may be added at a later time. 5072enum BigQueryTableModification { 5073 // Unused. 5074 TABLE_MODIFICATION_UNSPECIFIED = 0; 5075 5076 // A table will be considered modified when the last_modified_time from 5077 // BigQuery has been updated. 5078 TABLE_MODIFIED_TIMESTAMP = 1; 5079} 5080 5081// The cadence at which to update data profiles when a schema is modified. 5082message DiscoverySchemaModifiedCadence { 5083 // The type of events to consider when deciding if the table's schema 5084 // has been modified and should have the profile updated. Defaults to 5085 // NEW_COLUMNS. 5086 repeated BigQuerySchemaModification types = 1; 5087 5088 // How frequently profiles may be updated when schemas are 5089 // modified. Defaults to monthly. 5090 DataProfileUpdateFrequency frequency = 2; 5091} 5092 5093// Attributes evaluated to determine if a schema has been modified. New values 5094// may be added at a later time. 5095enum BigQuerySchemaModification { 5096 // Unused 5097 SCHEMA_MODIFICATION_UNSPECIFIED = 0; 5098 5099 // Profiles should be regenerated when new columns are added to the table. 5100 // Default. 5101 SCHEMA_NEW_COLUMNS = 1; 5102 5103 // Profiles should be regenerated when columns are removed from the table. 5104 SCHEMA_REMOVED_COLUMNS = 2; 5105} 5106 5107// The location to begin a discovery scan. Denotes an organization ID or folder 5108// ID within an organization. 5109message DiscoveryStartingLocation { 5110 // The location to be scanned. 5111 oneof location { 5112 // The ID of an organization to scan. 5113 int64 organization_id = 1; 5114 5115 // The ID of the Folder within an organization to scan. 5116 int64 folder_id = 2; 5117 } 5118} 5119 5120// Combines all of the information about a DLP job. 5121message DlpJob { 5122 option (google.api.resource) = { 5123 type: "dlp.googleapis.com/DlpJob" 5124 pattern: "projects/{project}/dlpJobs/{dlp_job}" 5125 pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}" 5126 }; 5127 5128 // Possible states of a job. New items may be added. 5129 enum JobState { 5130 // Unused. 5131 JOB_STATE_UNSPECIFIED = 0; 5132 5133 // The job has not yet started. 5134 PENDING = 1; 5135 5136 // The job is currently running. Once a job has finished it will transition 5137 // to FAILED or DONE. 5138 RUNNING = 2; 5139 5140 // The job is no longer running. 5141 DONE = 3; 5142 5143 // The job was canceled before it could be completed. 5144 CANCELED = 4; 5145 5146 // The job had an error and did not complete. 5147 FAILED = 5; 5148 5149 // The job is currently accepting findings via hybridInspect. 5150 // A hybrid job in ACTIVE state may continue to have findings added to it 5151 // through the calling of hybridInspect. After the job has finished no more 5152 // calls to hybridInspect may be made. ACTIVE jobs can transition to DONE. 5153 ACTIVE = 6; 5154 } 5155 5156 // The server-assigned name. 5157 string name = 1; 5158 5159 // The type of job. 5160 DlpJobType type = 2; 5161 5162 // State of a job. 5163 JobState state = 3; 5164 5165 // Job details. 5166 oneof details { 5167 // Results from analyzing risk of a data source. 5168 AnalyzeDataSourceRiskDetails risk_details = 4; 5169 5170 // Results from inspecting a data source. 5171 InspectDataSourceDetails inspect_details = 5; 5172 } 5173 5174 // Time when the job was created. 5175 google.protobuf.Timestamp create_time = 6; 5176 5177 // Time when the job started. 5178 google.protobuf.Timestamp start_time = 7; 5179 5180 // Time when the job finished. 5181 google.protobuf.Timestamp end_time = 8; 5182 5183 // Time when the job was last modified by the system. 5184 google.protobuf.Timestamp last_modified = 15; 5185 5186 // If created by a job trigger, the resource name of the trigger that 5187 // instantiated the job. 5188 string job_trigger_name = 10; 5189 5190 // A stream of errors encountered running the job. 5191 repeated Error errors = 11; 5192 5193 // Events that should occur after the job has completed. 5194 repeated ActionDetails action_details = 12; 5195} 5196 5197// The request message for [DlpJobs.GetDlpJob][]. 5198message GetDlpJobRequest { 5199 // Required. The name of the DlpJob resource. 5200 string name = 1 [ 5201 (google.api.field_behavior) = REQUIRED, 5202 (google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" } 5203 ]; 5204} 5205 5206// The request message for listing DLP jobs. 5207message ListDlpJobsRequest { 5208 // Required. Parent resource name. 5209 // 5210 // The format of this value varies depending on whether you have [specified a 5211 // processing 5212 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 5213 // 5214 // + Projects scope, location specified:<br/> 5215 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 5216 // + Projects scope, no location specified (defaults to global):<br/> 5217 // `projects/`<var>PROJECT_ID</var> 5218 // 5219 // The following example `parent` string specifies a parent project with the 5220 // identifier `example-project`, and specifies the `europe-west3` location 5221 // for processing data: 5222 // 5223 // parent=projects/example-project/locations/europe-west3 5224 string parent = 4 [ 5225 (google.api.field_behavior) = REQUIRED, 5226 (google.api.resource_reference) = { 5227 child_type: "dlp.googleapis.com/DlpJob" 5228 } 5229 ]; 5230 5231 // Allows filtering. 5232 // 5233 // Supported syntax: 5234 // 5235 // * Filter expressions are made up of one or more restrictions. 5236 // * Restrictions can be combined by `AND` or `OR` logical operators. A 5237 // sequence of restrictions implicitly uses `AND`. 5238 // * A restriction has the form of `{field} {operator} {value}`. 5239 // * Supported fields/values for inspect jobs: 5240 // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED 5241 // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY 5242 // - `trigger_name` - The name of the trigger that created the job. 5243 // - 'end_time` - Corresponds to the time the job finished. 5244 // - 'start_time` - Corresponds to the time the job finished. 5245 // * Supported fields for risk analysis jobs: 5246 // - `state` - RUNNING|CANCELED|FINISHED|FAILED 5247 // - 'end_time` - Corresponds to the time the job finished. 5248 // - 'start_time` - Corresponds to the time the job finished. 5249 // * The operator must be `=` or `!=`. 5250 // 5251 // Examples: 5252 // 5253 // * inspected_storage = cloud_storage AND state = done 5254 // * inspected_storage = cloud_storage OR inspected_storage = bigquery 5255 // * inspected_storage = cloud_storage AND (state = done OR state = canceled) 5256 // * end_time > \"2017-12-12T00:00:00+00:00\" 5257 // 5258 // The length of this field should be no more than 500 characters. 5259 string filter = 1; 5260 5261 // The standard list page size. 5262 int32 page_size = 2; 5263 5264 // The standard list page token. 5265 string page_token = 3; 5266 5267 // The type of job. Defaults to `DlpJobType.INSPECT` 5268 DlpJobType type = 5; 5269 5270 // Comma separated list of fields to order by, 5271 // followed by `asc` or `desc` postfix. This list is case insensitive. The 5272 // default sorting order is ascending. Redundant space characters are 5273 // insignificant. 5274 // 5275 // Example: `name asc, end_time asc, create_time desc` 5276 // 5277 // Supported fields are: 5278 // 5279 // - `create_time`: corresponds to the time the job was created. 5280 // - `end_time`: corresponds to the time the job ended. 5281 // - `name`: corresponds to the job's name. 5282 // - `state`: corresponds to `state` 5283 string order_by = 6; 5284 5285 // Deprecated. This field has no effect. 5286 string location_id = 7; 5287} 5288 5289// The response message for listing DLP jobs. 5290message ListDlpJobsResponse { 5291 // A list of DlpJobs that matches the specified filter in the request. 5292 repeated DlpJob jobs = 1; 5293 5294 // The standard List next-page token. 5295 string next_page_token = 2; 5296} 5297 5298// The request message for canceling a DLP job. 5299message CancelDlpJobRequest { 5300 // Required. The name of the DlpJob resource to be cancelled. 5301 string name = 1 [ 5302 (google.api.field_behavior) = REQUIRED, 5303 (google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" } 5304 ]; 5305} 5306 5307// The request message for finishing a DLP hybrid job. 5308message FinishDlpJobRequest { 5309 // Required. The name of the DlpJob resource to be finished. 5310 string name = 1 [ 5311 (google.api.field_behavior) = REQUIRED, 5312 (google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" } 5313 ]; 5314} 5315 5316// The request message for deleting a DLP job. 5317message DeleteDlpJobRequest { 5318 // Required. The name of the DlpJob resource to be deleted. 5319 string name = 1 [ 5320 (google.api.field_behavior) = REQUIRED, 5321 (google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" } 5322 ]; 5323} 5324 5325// Request message for CreateDeidentifyTemplate. 5326message CreateDeidentifyTemplateRequest { 5327 // Required. Parent resource name. 5328 // 5329 // The format of this value varies depending on the scope of the request 5330 // (project or organization) and whether you have [specified a processing 5331 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 5332 // 5333 // + Projects scope, location specified:<br/> 5334 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 5335 // + Projects scope, no location specified (defaults to global):<br/> 5336 // `projects/`<var>PROJECT_ID</var> 5337 // + Organizations scope, location specified:<br/> 5338 // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var> 5339 // + Organizations scope, no location specified (defaults to global):<br/> 5340 // `organizations/`<var>ORG_ID</var> 5341 // 5342 // The following example `parent` string specifies a parent project with the 5343 // identifier `example-project`, and specifies the `europe-west3` location 5344 // for processing data: 5345 // 5346 // parent=projects/example-project/locations/europe-west3 5347 string parent = 1 [ 5348 (google.api.field_behavior) = REQUIRED, 5349 (google.api.resource_reference) = { 5350 child_type: "dlp.googleapis.com/DeidentifyTemplate" 5351 } 5352 ]; 5353 5354 // Required. The DeidentifyTemplate to create. 5355 DeidentifyTemplate deidentify_template = 2 5356 [(google.api.field_behavior) = REQUIRED]; 5357 5358 // The template id can contain uppercase and lowercase letters, 5359 // numbers, and hyphens; that is, it must match the regular 5360 // expression: `[a-zA-Z\d-_]+`. The maximum length is 100 5361 // characters. Can be empty to allow the system to generate one. 5362 string template_id = 3; 5363 5364 // Deprecated. This field has no effect. 5365 string location_id = 4; 5366} 5367 5368// Request message for UpdateDeidentifyTemplate. 5369message UpdateDeidentifyTemplateRequest { 5370 // Required. Resource name of organization and deidentify template to be 5371 // updated, for example 5372 // `organizations/433245324/deidentifyTemplates/432452342` or 5373 // projects/project-id/deidentifyTemplates/432452342. 5374 string name = 1 [ 5375 (google.api.field_behavior) = REQUIRED, 5376 (google.api.resource_reference) = { 5377 type: "dlp.googleapis.com/DeidentifyTemplate" 5378 } 5379 ]; 5380 5381 // New DeidentifyTemplate value. 5382 DeidentifyTemplate deidentify_template = 2; 5383 5384 // Mask to control which fields get updated. 5385 google.protobuf.FieldMask update_mask = 3; 5386} 5387 5388// Request message for GetDeidentifyTemplate. 5389message GetDeidentifyTemplateRequest { 5390 // Required. Resource name of the organization and deidentify template to be 5391 // read, for example `organizations/433245324/deidentifyTemplates/432452342` 5392 // or projects/project-id/deidentifyTemplates/432452342. 5393 string name = 1 [ 5394 (google.api.field_behavior) = REQUIRED, 5395 (google.api.resource_reference) = { 5396 type: "dlp.googleapis.com/DeidentifyTemplate" 5397 } 5398 ]; 5399} 5400 5401// Request message for ListDeidentifyTemplates. 5402message ListDeidentifyTemplatesRequest { 5403 // Required. Parent resource name. 5404 // 5405 // The format of this value varies depending on the scope of the request 5406 // (project or organization) and whether you have [specified a processing 5407 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 5408 // 5409 // + Projects scope, location specified:<br/> 5410 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 5411 // + Projects scope, no location specified (defaults to global):<br/> 5412 // `projects/`<var>PROJECT_ID</var> 5413 // + Organizations scope, location specified:<br/> 5414 // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var> 5415 // + Organizations scope, no location specified (defaults to global):<br/> 5416 // `organizations/`<var>ORG_ID</var> 5417 // 5418 // The following example `parent` string specifies a parent project with the 5419 // identifier `example-project`, and specifies the `europe-west3` location 5420 // for processing data: 5421 // 5422 // parent=projects/example-project/locations/europe-west3 5423 string parent = 1 [ 5424 (google.api.field_behavior) = REQUIRED, 5425 (google.api.resource_reference) = { 5426 child_type: "dlp.googleapis.com/DeidentifyTemplate" 5427 } 5428 ]; 5429 5430 // Page token to continue retrieval. Comes from the previous call 5431 // to `ListDeidentifyTemplates`. 5432 string page_token = 2; 5433 5434 // Size of the page. This value can be limited by the server. If zero server 5435 // returns a page of max size 100. 5436 int32 page_size = 3; 5437 5438 // Comma separated list of fields to order by, 5439 // followed by `asc` or `desc` postfix. This list is case insensitive. The 5440 // default sorting order is ascending. Redundant space characters are 5441 // insignificant. 5442 // 5443 // Example: `name asc,update_time, create_time desc` 5444 // 5445 // Supported fields are: 5446 // 5447 // - `create_time`: corresponds to the time the template was created. 5448 // - `update_time`: corresponds to the time the template was last updated. 5449 // - `name`: corresponds to the template's name. 5450 // - `display_name`: corresponds to the template's display name. 5451 string order_by = 4; 5452 5453 // Deprecated. This field has no effect. 5454 string location_id = 5; 5455} 5456 5457// Response message for ListDeidentifyTemplates. 5458message ListDeidentifyTemplatesResponse { 5459 // List of deidentify templates, up to page_size in 5460 // ListDeidentifyTemplatesRequest. 5461 repeated DeidentifyTemplate deidentify_templates = 1; 5462 5463 // If the next page is available then the next page token to be used in the 5464 // following ListDeidentifyTemplates request. 5465 string next_page_token = 2; 5466} 5467 5468// Request message for DeleteDeidentifyTemplate. 5469message DeleteDeidentifyTemplateRequest { 5470 // Required. Resource name of the organization and deidentify template to be 5471 // deleted, for example 5472 // `organizations/433245324/deidentifyTemplates/432452342` or 5473 // projects/project-id/deidentifyTemplates/432452342. 5474 string name = 1 [ 5475 (google.api.field_behavior) = REQUIRED, 5476 (google.api.resource_reference) = { 5477 type: "dlp.googleapis.com/DeidentifyTemplate" 5478 } 5479 ]; 5480} 5481 5482// Configuration for a custom dictionary created from a data source of any size 5483// up to the maximum size defined in the 5484// [limits](https://cloud.google.com/sensitive-data-protection/limits) page. The 5485// artifacts of dictionary creation are stored in the specified Cloud Storage 5486// location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries 5487// that satisfy the size requirements. 5488message LargeCustomDictionaryConfig { 5489 // Location to store dictionary artifacts in Cloud Storage. These files 5490 // will only be accessible by project owners and the DLP API. If any of these 5491 // artifacts are modified, the dictionary is considered invalid and can no 5492 // longer be used. 5493 CloudStoragePath output_path = 1; 5494 5495 // Source of the dictionary. 5496 oneof source { 5497 // Set of files containing newline-delimited lists of dictionary phrases. 5498 CloudStorageFileSet cloud_storage_file_set = 2; 5499 5500 // Field in a BigQuery table where each cell represents a dictionary phrase. 5501 BigQueryField big_query_field = 3; 5502 } 5503} 5504 5505// Summary statistics of a custom dictionary. 5506message LargeCustomDictionaryStats { 5507 // Approximate number of distinct phrases in the dictionary. 5508 int64 approx_num_phrases = 1; 5509} 5510 5511// Configuration for stored infoTypes. All fields and subfield are provided 5512// by the user. For more information, see 5513// https://cloud.google.com/sensitive-data-protection/docs/creating-custom-infotypes. 5514message StoredInfoTypeConfig { 5515 // Display name of the StoredInfoType (max 256 characters). 5516 string display_name = 1; 5517 5518 // Description of the StoredInfoType (max 256 characters). 5519 string description = 2; 5520 5521 // Stored infotype types. 5522 oneof type { 5523 // StoredInfoType where findings are defined by a dictionary of phrases. 5524 LargeCustomDictionaryConfig large_custom_dictionary = 3; 5525 5526 // Store dictionary-based CustomInfoType. 5527 CustomInfoType.Dictionary dictionary = 4; 5528 5529 // Store regular expression-based StoredInfoType. 5530 CustomInfoType.Regex regex = 5; 5531 } 5532} 5533 5534// Statistics for a StoredInfoType. 5535message StoredInfoTypeStats { 5536 // Stat types 5537 oneof type { 5538 // StoredInfoType where findings are defined by a dictionary of phrases. 5539 LargeCustomDictionaryStats large_custom_dictionary = 1; 5540 } 5541} 5542 5543// Version of a StoredInfoType, including the configuration used to build it, 5544// create timestamp, and current state. 5545message StoredInfoTypeVersion { 5546 // StoredInfoType configuration. 5547 StoredInfoTypeConfig config = 1; 5548 5549 // Create timestamp of the version. Read-only, determined by the system 5550 // when the version is created. 5551 google.protobuf.Timestamp create_time = 2; 5552 5553 // Stored info type version state. Read-only, updated by the system 5554 // during dictionary creation. 5555 StoredInfoTypeState state = 3; 5556 5557 // Errors that occurred when creating this storedInfoType version, or 5558 // anomalies detected in the storedInfoType data that render it unusable. Only 5559 // the five most recent errors will be displayed, with the most recent error 5560 // appearing first. 5561 // 5562 // For example, some of the data for stored custom dictionaries is put in 5563 // the user's Cloud Storage bucket, and if this data is modified or 5564 // deleted by the user or another system, the dictionary becomes invalid. 5565 // 5566 // If any errors occur, fix the problem indicated by the error message and 5567 // use the UpdateStoredInfoType API method to create another version of the 5568 // storedInfoType to continue using it, reusing the same `config` if it was 5569 // not the source of the error. 5570 repeated Error errors = 4; 5571 5572 // Statistics about this storedInfoType version. 5573 StoredInfoTypeStats stats = 5; 5574} 5575 5576// StoredInfoType resource message that contains information about the current 5577// version and any pending updates. 5578message StoredInfoType { 5579 option (google.api.resource) = { 5580 type: "dlp.googleapis.com/StoredInfoType" 5581 pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}" 5582 pattern: "projects/{project}/storedInfoTypes/{stored_info_type}" 5583 pattern: "organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}" 5584 pattern: "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}" 5585 }; 5586 5587 // Resource name. 5588 string name = 1; 5589 5590 // Current version of the stored info type. 5591 StoredInfoTypeVersion current_version = 2; 5592 5593 // Pending versions of the stored info type. Empty if no versions are 5594 // pending. 5595 repeated StoredInfoTypeVersion pending_versions = 3; 5596} 5597 5598// Request message for CreateStoredInfoType. 5599message CreateStoredInfoTypeRequest { 5600 // Required. Parent resource name. 5601 // 5602 // The format of this value varies depending on the scope of the request 5603 // (project or organization) and whether you have [specified a processing 5604 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 5605 // 5606 // + Projects scope, location specified:<br/> 5607 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 5608 // + Projects scope, no location specified (defaults to global):<br/> 5609 // `projects/`<var>PROJECT_ID</var> 5610 // + Organizations scope, location specified:<br/> 5611 // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var> 5612 // + Organizations scope, no location specified (defaults to global):<br/> 5613 // `organizations/`<var>ORG_ID</var> 5614 // 5615 // The following example `parent` string specifies a parent project with the 5616 // identifier `example-project`, and specifies the `europe-west3` location 5617 // for processing data: 5618 // 5619 // parent=projects/example-project/locations/europe-west3 5620 string parent = 1 [ 5621 (google.api.field_behavior) = REQUIRED, 5622 (google.api.resource_reference) = { 5623 child_type: "dlp.googleapis.com/StoredInfoType" 5624 } 5625 ]; 5626 5627 // Required. Configuration of the storedInfoType to create. 5628 StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED]; 5629 5630 // The storedInfoType ID can contain uppercase and lowercase letters, 5631 // numbers, and hyphens; that is, it must match the regular 5632 // expression: `[a-zA-Z\d-_]+`. The maximum length is 100 5633 // characters. Can be empty to allow the system to generate one. 5634 string stored_info_type_id = 3; 5635 5636 // Deprecated. This field has no effect. 5637 string location_id = 4; 5638} 5639 5640// Request message for UpdateStoredInfoType. 5641message UpdateStoredInfoTypeRequest { 5642 // Required. Resource name of organization and storedInfoType to be updated, 5643 // for example `organizations/433245324/storedInfoTypes/432452342` or 5644 // projects/project-id/storedInfoTypes/432452342. 5645 string name = 1 [ 5646 (google.api.field_behavior) = REQUIRED, 5647 (google.api.resource_reference) = { 5648 type: "dlp.googleapis.com/StoredInfoType" 5649 } 5650 ]; 5651 5652 // Updated configuration for the storedInfoType. If not provided, a new 5653 // version of the storedInfoType will be created with the existing 5654 // configuration. 5655 StoredInfoTypeConfig config = 2; 5656 5657 // Mask to control which fields get updated. 5658 google.protobuf.FieldMask update_mask = 3; 5659} 5660 5661// Request message for GetStoredInfoType. 5662message GetStoredInfoTypeRequest { 5663 // Required. Resource name of the organization and storedInfoType to be read, 5664 // for example `organizations/433245324/storedInfoTypes/432452342` or 5665 // projects/project-id/storedInfoTypes/432452342. 5666 string name = 1 [ 5667 (google.api.field_behavior) = REQUIRED, 5668 (google.api.resource_reference) = { 5669 type: "dlp.googleapis.com/StoredInfoType" 5670 } 5671 ]; 5672} 5673 5674// Request message for ListStoredInfoTypes. 5675message ListStoredInfoTypesRequest { 5676 // Required. Parent resource name. 5677 // 5678 // The format of this value varies depending on the scope of the request 5679 // (project or organization) and whether you have [specified a processing 5680 // location](https://cloud.google.com/sensitive-data-protection/docs/specifying-location): 5681 // 5682 // + Projects scope, location specified:<br/> 5683 // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var> 5684 // + Projects scope, no location specified (defaults to global):<br/> 5685 // `projects/`<var>PROJECT_ID</var> 5686 // 5687 // The following example `parent` string specifies a parent project with the 5688 // identifier `example-project`, and specifies the `europe-west3` location 5689 // for processing data: 5690 // 5691 // parent=projects/example-project/locations/europe-west3 5692 string parent = 1 [ 5693 (google.api.field_behavior) = REQUIRED, 5694 (google.api.resource_reference) = { 5695 child_type: "dlp.googleapis.com/StoredInfoType" 5696 } 5697 ]; 5698 5699 // Page token to continue retrieval. Comes from the previous call 5700 // to `ListStoredInfoTypes`. 5701 string page_token = 2; 5702 5703 // Size of the page. This value can be limited by the server. If zero server 5704 // returns a page of max size 100. 5705 int32 page_size = 3; 5706 5707 // Comma separated list of fields to order by, 5708 // followed by `asc` or `desc` postfix. This list is case insensitive. The 5709 // default sorting order is ascending. Redundant space characters are 5710 // insignificant. 5711 // 5712 // Example: `name asc, display_name, create_time desc` 5713 // 5714 // Supported fields are: 5715 // 5716 // - `create_time`: corresponds to the time the most recent version of the 5717 // resource was created. 5718 // - `state`: corresponds to the state of the resource. 5719 // - `name`: corresponds to resource name. 5720 // - `display_name`: corresponds to info type's display name. 5721 string order_by = 4; 5722 5723 // Deprecated. This field has no effect. 5724 string location_id = 5; 5725} 5726 5727// Response message for ListStoredInfoTypes. 5728message ListStoredInfoTypesResponse { 5729 // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. 5730 repeated StoredInfoType stored_info_types = 1; 5731 5732 // If the next page is available then the next page token to be used 5733 // in the following ListStoredInfoTypes request. 5734 string next_page_token = 2; 5735} 5736 5737// Request message for DeleteStoredInfoType. 5738message DeleteStoredInfoTypeRequest { 5739 // Required. Resource name of the organization and storedInfoType to be 5740 // deleted, for example `organizations/433245324/storedInfoTypes/432452342` or 5741 // projects/project-id/storedInfoTypes/432452342. 5742 string name = 1 [ 5743 (google.api.field_behavior) = REQUIRED, 5744 (google.api.resource_reference) = { 5745 type: "dlp.googleapis.com/StoredInfoType" 5746 } 5747 ]; 5748} 5749 5750// Request to search for potentially sensitive info in a custom location. 5751message HybridInspectJobTriggerRequest { 5752 // Required. Resource name of the trigger to execute a hybrid inspect on, for 5753 // example `projects/dlp-test-project/jobTriggers/53234423`. 5754 string name = 1 [ 5755 (google.api.field_behavior) = REQUIRED, 5756 (google.api.resource_reference) = { type: "dlp.googleapis.com/JobTrigger" } 5757 ]; 5758 5759 // The item to inspect. 5760 HybridContentItem hybrid_item = 3; 5761} 5762 5763// Request to search for potentially sensitive info in a custom location. 5764message HybridInspectDlpJobRequest { 5765 // Required. Resource name of the job to execute a hybrid inspect on, for 5766 // example `projects/dlp-test-project/dlpJob/53234423`. 5767 string name = 1 [ 5768 (google.api.field_behavior) = REQUIRED, 5769 (google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" } 5770 ]; 5771 5772 // The item to inspect. 5773 HybridContentItem hybrid_item = 3; 5774} 5775 5776// An individual hybrid item to inspect. Will be stored temporarily during 5777// processing. 5778message HybridContentItem { 5779 // The item to inspect. 5780 ContentItem item = 1; 5781 5782 // Supplementary information that will be added to each finding. 5783 HybridFindingDetails finding_details = 2; 5784} 5785 5786// Populate to associate additional data with each finding. 5787message HybridFindingDetails { 5788 // Details about the container where the content being inspected is from. 5789 Container container_details = 1; 5790 5791 // Offset in bytes of the line, from the beginning of the file, where the 5792 // finding is located. Populate if the item being scanned is only part of a 5793 // bigger item, such as a shard of a file and you want to track the absolute 5794 // position of the finding. 5795 int64 file_offset = 2; 5796 5797 // Offset of the row for tables. Populate if the row(s) being scanned are 5798 // part of a bigger dataset and you want to keep track of their absolute 5799 // position. 5800 int64 row_offset = 3; 5801 5802 // If the container is a table, additional information to make findings 5803 // meaningful such as the columns that are primary keys. If not known ahead 5804 // of time, can also be set within each inspect hybrid call and the two 5805 // will be merged. Note that identifying_fields will only be stored to 5806 // BigQuery, and only if the BigQuery action has been included. 5807 TableOptions table_options = 4; 5808 5809 // Labels to represent user provided metadata about the data being inspected. 5810 // If configured by the job, some key values may be required. 5811 // The labels associated with `Finding`'s produced by hybrid 5812 // inspection. 5813 // 5814 // Label keys must be between 1 and 63 characters long and must conform 5815 // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. 5816 // 5817 // Label values must be between 0 and 63 characters long and must conform 5818 // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. 5819 // 5820 // No more than 10 labels can be associated with a given finding. 5821 // 5822 // Examples: 5823 // * `"environment" : "production"` 5824 // * `"pipeline" : "etl"` 5825 map<string, string> labels = 5; 5826} 5827 5828// Quota exceeded errors will be thrown once quota has been met. 5829message HybridInspectResponse {} 5830 5831// Operators available for comparing the value of fields. 5832enum RelationalOperator { 5833 // Unused 5834 RELATIONAL_OPERATOR_UNSPECIFIED = 0; 5835 5836 // Equal. Attempts to match even with incompatible types. 5837 EQUAL_TO = 1; 5838 5839 // Not equal to. Attempts to match even with incompatible types. 5840 NOT_EQUAL_TO = 2; 5841 5842 // Greater than. 5843 GREATER_THAN = 3; 5844 5845 // Less than. 5846 LESS_THAN = 4; 5847 5848 // Greater than or equals. 5849 GREATER_THAN_OR_EQUALS = 5; 5850 5851 // Less than or equals. 5852 LESS_THAN_OR_EQUALS = 6; 5853 5854 // Exists 5855 EXISTS = 7; 5856} 5857 5858// Type of the match which can be applied to different ways of matching, like 5859// Dictionary, regular expression and intersecting with findings of another 5860// info type. 5861enum MatchingType { 5862 // Invalid. 5863 MATCHING_TYPE_UNSPECIFIED = 0; 5864 5865 // Full match. 5866 // 5867 // - Dictionary: join of Dictionary results matched complete finding quote 5868 // - Regex: all regex matches fill a finding quote start to end 5869 // - Exclude info type: completely inside affecting info types findings 5870 MATCHING_TYPE_FULL_MATCH = 1; 5871 5872 // Partial match. 5873 // 5874 // - Dictionary: at least one of the tokens in the finding matches 5875 // - Regex: substring of the finding matches 5876 // - Exclude info type: intersects with affecting info types findings 5877 MATCHING_TYPE_PARTIAL_MATCH = 2; 5878 5879 // Inverse match. 5880 // 5881 // - Dictionary: no tokens in the finding match the dictionary 5882 // - Regex: finding doesn't match the regex 5883 // - Exclude info type: no intersection with affecting info types findings 5884 MATCHING_TYPE_INVERSE_MATCH = 3; 5885} 5886 5887// Deprecated and unused. 5888enum ContentOption { 5889 // Includes entire content of a file or a data stream. 5890 CONTENT_UNSPECIFIED = 0; 5891 5892 // Text content within the data, excluding any metadata. 5893 CONTENT_TEXT = 1; 5894 5895 // Images found in the data. 5896 CONTENT_IMAGE = 2; 5897} 5898 5899// Type of metadata containing the finding. 5900enum MetadataType { 5901 // Unused 5902 METADATATYPE_UNSPECIFIED = 0; 5903 5904 // General file metadata provided by Cloud Storage. 5905 STORAGE_METADATA = 2; 5906} 5907 5908// Parts of the APIs which use certain infoTypes. 5909enum InfoTypeSupportedBy { 5910 // Unused. 5911 ENUM_TYPE_UNSPECIFIED = 0; 5912 5913 // Supported by the inspect operations. 5914 INSPECT = 1; 5915 5916 // Supported by the risk analysis operations. 5917 RISK_ANALYSIS = 2; 5918} 5919 5920// An enum to represent the various types of DLP jobs. 5921enum DlpJobType { 5922 // Defaults to INSPECT_JOB. 5923 DLP_JOB_TYPE_UNSPECIFIED = 0; 5924 5925 // The job inspected Google Cloud for sensitive data. 5926 INSPECT_JOB = 1; 5927 5928 // The job executed a Risk Analysis computation. 5929 RISK_ANALYSIS_JOB = 2; 5930} 5931 5932// State of a StoredInfoType version. 5933enum StoredInfoTypeState { 5934 // Unused 5935 STORED_INFO_TYPE_STATE_UNSPECIFIED = 0; 5936 5937 // StoredInfoType version is being created. 5938 PENDING = 1; 5939 5940 // StoredInfoType version is ready for use. 5941 READY = 2; 5942 5943 // StoredInfoType creation failed. All relevant error messages are returned in 5944 // the `StoredInfoTypeVersion` message. 5945 FAILED = 3; 5946 5947 // StoredInfoType is no longer valid because artifacts stored in 5948 // user-controlled storage were modified. To fix an invalid StoredInfoType, 5949 // use the `UpdateStoredInfoType` method to create a new version. 5950 INVALID = 4; 5951} 5952 5953// Request to list the profiles generated for a given organization or project. 5954message ListProjectDataProfilesRequest { 5955 // Required. organizations/{org_id}/locations/{loc_id} 5956 string parent = 1 [ 5957 (google.api.field_behavior) = REQUIRED, 5958 (google.api.resource_reference) = { 5959 child_type: "dlp.googleapis.com/ProjectDataProfile" 5960 } 5961 ]; 5962 5963 // Page token to continue retrieval. 5964 string page_token = 2; 5965 5966 // Size of the page. This value can be limited by the server. If zero, server 5967 // returns a page of max size 100. 5968 int32 page_size = 3; 5969 5970 // Comma separated list of fields to order by, followed by `asc` or `desc` 5971 // postfix. This list is case insensitive. The default sorting order is 5972 // ascending. Redundant space characters are insignificant. Only one order 5973 // field at a time is allowed. 5974 // 5975 // Examples: 5976 // * `project_id` 5977 // * `sensitivity_level desc` 5978 // 5979 // Supported fields are: 5980 // 5981 // - `project_id`: GCP project ID 5982 // - `sensitivity_level`: How sensitive the data in a project is, at most. 5983 // - `data_risk_level`: How much risk is associated with this data. 5984 // - `profile_last_generated`: When the profile was last updated in epoch 5985 // seconds. 5986 string order_by = 4; 5987 5988 // Allows filtering. 5989 // 5990 // Supported syntax: 5991 // 5992 // * Filter expressions are made up of one or more restrictions. 5993 // * Restrictions can be combined by `AND` or `OR` logical operators. A 5994 // sequence of restrictions implicitly uses `AND`. 5995 // * A restriction has the form of `{field} {operator} {value}`. 5996 // * Supported fields/values: 5997 // - `sensitivity_level` - HIGH|MODERATE|LOW 5998 // - `data_risk_level` - HIGH|MODERATE|LOW 5999 // - `status_code` - an RPC status code as defined in 6000 // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto 6001 // * The operator must be `=` or `!=`. 6002 // 6003 // Examples: 6004 // 6005 // * `project_id = 12345 AND status_code = 1` 6006 // * `project_id = 12345 AND sensitivity_level = HIGH` 6007 // 6008 // The length of this field should be no more than 500 characters. 6009 string filter = 5; 6010} 6011 6012// List of profiles generated for a given organization or project. 6013message ListProjectDataProfilesResponse { 6014 // List of data profiles. 6015 repeated ProjectDataProfile project_data_profiles = 1; 6016 6017 // The next page token. 6018 string next_page_token = 2; 6019} 6020 6021// Request to list the profiles generated for a given organization or project. 6022message ListTableDataProfilesRequest { 6023 // Required. Resource name of the organization or project, for 6024 // example `organizations/433245324/locations/europe` or 6025 // `projects/project-id/locations/asia`. 6026 string parent = 1 [ 6027 (google.api.field_behavior) = REQUIRED, 6028 (google.api.resource_reference) = { 6029 child_type: "dlp.googleapis.com/TableDataProfile" 6030 } 6031 ]; 6032 6033 // Page token to continue retrieval. 6034 string page_token = 2; 6035 6036 // Size of the page. This value can be limited by the server. If zero, server 6037 // returns a page of max size 100. 6038 int32 page_size = 3; 6039 6040 // Comma separated list of fields to order by, followed by `asc` or `desc` 6041 // postfix. This list is case insensitive. The default sorting order is 6042 // ascending. Redundant space characters are insignificant. Only one order 6043 // field at a time is allowed. 6044 // 6045 // Examples: 6046 // * `project_id asc` 6047 // * `table_id` 6048 // * `sensitivity_level desc` 6049 // 6050 // Supported fields are: 6051 // 6052 // - `project_id`: The GCP project ID. 6053 // - `dataset_id`: The ID of a BigQuery dataset. 6054 // - `table_id`: The ID of a BigQuery table. 6055 // - `sensitivity_level`: How sensitive the data in a table is, at most. 6056 // - `data_risk_level`: How much risk is associated with this data. 6057 // - `profile_last_generated`: When the profile was last updated in epoch 6058 // seconds. 6059 // - `last_modified`: The last time the resource was modified. 6060 // - `resource_visibility`: Visibility restriction for this resource. 6061 // - `row_count`: Number of rows in this resource. 6062 string order_by = 4; 6063 6064 // Allows filtering. 6065 // 6066 // Supported syntax: 6067 // 6068 // * Filter expressions are made up of one or more restrictions. 6069 // * Restrictions can be combined by `AND` or `OR` logical operators. A 6070 // sequence of restrictions implicitly uses `AND`. 6071 // * A restriction has the form of `{field} {operator} {value}`. 6072 // * Supported fields/values: 6073 // - `project_id` - The GCP project ID. 6074 // - `dataset_id` - The BigQuery dataset ID. 6075 // - `table_id` - The ID of the BigQuery table. 6076 // - `sensitivity_level` - HIGH|MODERATE|LOW 6077 // - `data_risk_level` - HIGH|MODERATE|LOW 6078 // - `resource_visibility`: PUBLIC|RESTRICTED 6079 // - `status_code` - an RPC status code as defined in 6080 // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto 6081 // * The operator must be `=` or `!=`. 6082 // 6083 // Examples: 6084 // 6085 // * `project_id = 12345 AND status_code = 1` 6086 // * `project_id = 12345 AND sensitivity_level = HIGH` 6087 // * `project_id = 12345 AND resource_visibility = PUBLIC` 6088 // 6089 // The length of this field should be no more than 500 characters. 6090 string filter = 5; 6091} 6092 6093// List of profiles generated for a given organization or project. 6094message ListTableDataProfilesResponse { 6095 // List of data profiles. 6096 repeated TableDataProfile table_data_profiles = 1; 6097 6098 // The next page token. 6099 string next_page_token = 2; 6100} 6101 6102// Request to list the profiles generated for a given organization or project. 6103message ListColumnDataProfilesRequest { 6104 // Required. Resource name of the organization or project, for 6105 // example `organizations/433245324/locations/europe` or 6106 // `projects/project-id/locations/asia`. 6107 string parent = 1 [ 6108 (google.api.field_behavior) = REQUIRED, 6109 (google.api.resource_reference) = { 6110 child_type: "dlp.googleapis.com/ColumnDataProfile" 6111 } 6112 ]; 6113 6114 // Page token to continue retrieval. 6115 string page_token = 2; 6116 6117 // Size of the page. This value can be limited by the server. If zero, server 6118 // returns a page of max size 100. 6119 int32 page_size = 3; 6120 6121 // Comma separated list of fields to order by, followed by `asc` or `desc` 6122 // postfix. This list is case insensitive. The default sorting order is 6123 // ascending. Redundant space characters are insignificant. Only one order 6124 // field at a time is allowed. 6125 // 6126 // Examples: 6127 // * `project_id asc` 6128 // * `table_id` 6129 // * `sensitivity_level desc` 6130 // 6131 // Supported fields are: 6132 // 6133 // - `project_id`: The Google Cloud project ID. 6134 // - `dataset_id`: The ID of a BigQuery dataset. 6135 // - `table_id`: The ID of a BigQuery table. 6136 // - `sensitivity_level`: How sensitive the data in a column is, at most. 6137 // - `data_risk_level`: How much risk is associated with this data. 6138 // - `profile_last_generated`: When the profile was last updated in epoch 6139 // seconds. 6140 string order_by = 4; 6141 6142 // Allows filtering. 6143 // 6144 // Supported syntax: 6145 // 6146 // * Filter expressions are made up of one or more restrictions. 6147 // * Restrictions can be combined by `AND` or `OR` logical operators. A 6148 // sequence of restrictions implicitly uses `AND`. 6149 // * A restriction has the form of `{field} {operator} {value}`. 6150 // * Supported fields/values: 6151 // - `table_data_profile_name` - The name of the related table data 6152 // profile. 6153 // - `project_id` - The Google Cloud project ID. (REQUIRED) 6154 // - `dataset_id` - The BigQuery dataset ID. (REQUIRED) 6155 // - `table_id` - The BigQuery table ID. (REQUIRED) 6156 // - `field_id` - The ID of the BigQuery field. 6157 // - `info_type` - The infotype detected in the resource. 6158 // - `sensitivity_level` - HIGH|MEDIUM|LOW 6159 // - `data_risk_level`: How much risk is associated with this data. 6160 // - `status_code` - an RPC status code as defined in 6161 // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto 6162 // * The operator must be `=` for project_id, dataset_id, and table_id. Other 6163 // filters also support `!=`. 6164 // 6165 // Examples: 6166 // 6167 // * project_id = 12345 AND status_code = 1 6168 // * project_id = 12345 AND sensitivity_level = HIGH 6169 // * project_id = 12345 AND info_type = STREET_ADDRESS 6170 // 6171 // The length of this field should be no more than 500 characters. 6172 string filter = 5; 6173} 6174 6175// List of profiles generated for a given organization or project. 6176message ListColumnDataProfilesResponse { 6177 // List of data profiles. 6178 repeated ColumnDataProfile column_data_profiles = 1; 6179 6180 // The next page token. 6181 string next_page_token = 2; 6182} 6183 6184// Score is a summary of all elements in the data profile. 6185// A higher number means more risk. 6186message DataRiskLevel { 6187 // Various score levels for resources. 6188 enum DataRiskLevelScore { 6189 // Unused. 6190 RISK_SCORE_UNSPECIFIED = 0; 6191 6192 // Low risk - Lower indication of sensitive data that appears to have 6193 // additional access restrictions in place or no indication of sensitive 6194 // data found. 6195 RISK_LOW = 10; 6196 6197 // Medium risk - Sensitive data may be present but additional access or fine 6198 // grain access restrictions appear to be present. Consider limiting 6199 // access even further or transform data to mask. 6200 RISK_MODERATE = 20; 6201 6202 // High risk – SPII may be present. Access controls may include public 6203 // ACLs. Exfiltration of data may lead to user data loss. Re-identification 6204 // of users may be possible. Consider limiting usage and or removing SPII. 6205 RISK_HIGH = 30; 6206 } 6207 6208 // The score applied to the resource. 6209 DataRiskLevelScore score = 1; 6210} 6211 6212// An aggregated profile for this project, based on the resources profiled 6213// within it. 6214message ProjectDataProfile { 6215 option (google.api.resource) = { 6216 type: "dlp.googleapis.com/ProjectDataProfile" 6217 pattern: "organizations/{organization}/locations/{location}/projectDataProfiles/{project_data_profile}" 6218 pattern: "projects/{project}/locations/{location}/projectDataProfiles/{project_data_profile}" 6219 }; 6220 // The resource name of the profile. 6221 string name = 1; 6222 6223 // Project ID that was profiled. 6224 string project_id = 2; 6225 6226 // The last time the profile was generated. 6227 google.protobuf.Timestamp profile_last_generated = 3; 6228 6229 // The sensitivity score of this project. 6230 SensitivityScore sensitivity_score = 4; 6231 6232 // The data risk level of this project. 6233 DataRiskLevel data_risk_level = 5; 6234 6235 // Success or error status of the last attempt to profile the project. 6236 ProfileStatus profile_status = 7; 6237} 6238 6239// How broadly the data in the resource has been shared. New items may be added 6240// over time. A higher number means more restricted. 6241enum ResourceVisibility { 6242 // Unused. 6243 RESOURCE_VISIBILITY_UNSPECIFIED = 0; 6244 6245 // Visible to any user. 6246 RESOURCE_VISIBILITY_PUBLIC = 10; 6247 6248 // Visible only to specific users. 6249 RESOURCE_VISIBILITY_RESTRICTED = 20; 6250} 6251 6252// Snapshot of the configurations used to generate the profile. 6253message DataProfileConfigSnapshot { 6254 // A copy of the inspection config used to generate this profile. This 6255 // is a copy of the inspect_template specified in `DataProfileJobConfig`. 6256 InspectConfig inspect_config = 2; 6257 6258 // A copy of the configuration used to generate this profile. This is 6259 // deprecated, and the DiscoveryConfig field is preferred moving forward. 6260 // DataProfileJobConfig will still be written here for Discovery in BigQuery 6261 // for backwards compatibility, but will not be updated with new fields, while 6262 // DiscoveryConfig will. 6263 DataProfileJobConfig data_profile_job = 3 [deprecated = true]; 6264 6265 // A copy of the configuration used to generate this profile. 6266 DiscoveryConfig discovery_config = 4; 6267 6268 // Name of the inspection template used to generate this profile 6269 string inspect_template_name = 5; 6270 6271 // Timestamp when the template was modified 6272 google.protobuf.Timestamp inspect_template_modified_time = 6; 6273} 6274 6275// The profile for a scanned table. 6276message TableDataProfile { 6277 option (google.api.resource) = { 6278 type: "dlp.googleapis.com/TableDataProfile" 6279 pattern: "organizations/{organization}/locations/{location}/tableDataProfiles/{table_data_profile}" 6280 pattern: "projects/{project}/locations/{location}/tableDataProfiles/{table_data_profile}" 6281 }; 6282 // Possible states of a profile. New items may be added. 6283 enum State { 6284 // Unused. 6285 STATE_UNSPECIFIED = 0; 6286 6287 // The profile is currently running. Once a profile has finished it will 6288 // transition to DONE. 6289 RUNNING = 1; 6290 6291 // The profile is no longer generating. 6292 // If profile_status.status.code is 0, the profile succeeded, otherwise, it 6293 // failed. 6294 DONE = 2; 6295 } 6296 6297 // The name of the profile. 6298 string name = 1; 6299 6300 // The resource type that was profiled. 6301 DataSourceType data_source_type = 36; 6302 6303 // The resource name to the project data profile for this table. 6304 string project_data_profile = 2; 6305 6306 // The Google Cloud project ID that owns the resource. 6307 string dataset_project_id = 24; 6308 6309 // If supported, the location where the dataset's data is stored. 6310 // See https://cloud.google.com/bigquery/docs/locations for supported 6311 // locations. 6312 string dataset_location = 29; 6313 6314 // If the resource is BigQuery, the dataset ID. 6315 string dataset_id = 25; 6316 6317 // If the resource is BigQuery, the BigQuery table ID. 6318 string table_id = 26; 6319 6320 // The resource name of the resource profiled. 6321 // https://cloud.google.com/apis/design/resource_names#full_resource_name 6322 string full_resource = 3; 6323 6324 // Success or error status from the most recent profile generation attempt. 6325 // May be empty if the profile is still being generated. 6326 ProfileStatus profile_status = 21; 6327 6328 // State of a profile. 6329 State state = 22; 6330 6331 // The sensitivity score of this table. 6332 SensitivityScore sensitivity_score = 5; 6333 6334 // The data risk level of this table. 6335 DataRiskLevel data_risk_level = 6; 6336 6337 // The infoTypes predicted from this table's data. 6338 repeated InfoTypeSummary predicted_info_types = 27; 6339 6340 // Other infoTypes found in this table's data. 6341 repeated OtherInfoTypeSummary other_info_types = 28; 6342 6343 // The snapshot of the configurations used to generate the profile. 6344 DataProfileConfigSnapshot config_snapshot = 7; 6345 6346 // The time when this table was last modified 6347 google.protobuf.Timestamp last_modified_time = 8; 6348 6349 // Optional. The time when this table expires. 6350 google.protobuf.Timestamp expiration_time = 9; 6351 6352 // The number of columns profiled in the table. 6353 int64 scanned_column_count = 10; 6354 6355 // The number of columns skipped in the table because of an error. 6356 int64 failed_column_count = 11; 6357 6358 // The size of the table when the profile was generated. 6359 int64 table_size_bytes = 12; 6360 6361 // Number of rows in the table when the profile was generated. 6362 // This will not be populated for BigLake tables. 6363 int64 row_count = 13; 6364 6365 // How the table is encrypted. 6366 EncryptionStatus encryption_status = 14; 6367 6368 // How broadly a resource has been shared. 6369 ResourceVisibility resource_visibility = 15; 6370 6371 // The last time the profile was generated. 6372 google.protobuf.Timestamp profile_last_generated = 16; 6373 6374 // The labels applied to the resource at the time the profile was generated. 6375 map<string, string> resource_labels = 17; 6376 6377 // The time at which the table was created. 6378 google.protobuf.Timestamp create_time = 23; 6379} 6380 6381// Success or errors for the profile generation. 6382message ProfileStatus { 6383 // Profiling status code and optional message. The `status.code` value is 0 6384 // (default value) for OK. 6385 google.rpc.Status status = 1; 6386 6387 // Time when the profile generation status was updated 6388 google.protobuf.Timestamp timestamp = 3; 6389} 6390 6391// How a resource is encrypted. 6392enum EncryptionStatus { 6393 // Unused. 6394 ENCRYPTION_STATUS_UNSPECIFIED = 0; 6395 6396 // Google manages server-side encryption keys on your behalf. 6397 ENCRYPTION_GOOGLE_MANAGED = 1; 6398 6399 // Customer provides the key. 6400 ENCRYPTION_CUSTOMER_MANAGED = 2; 6401} 6402 6403// The infoType details for this column. 6404message InfoTypeSummary { 6405 // The infoType. 6406 InfoType info_type = 1; 6407 6408 // Not populated for predicted infotypes. 6409 int32 estimated_prevalence = 2 [deprecated = true]; 6410} 6411 6412// Infotype details for other infoTypes found within a column. 6413message OtherInfoTypeSummary { 6414 // The other infoType. 6415 InfoType info_type = 1; 6416 6417 // Approximate percentage of non-null rows that contained data detected by 6418 // this infotype. 6419 int32 estimated_prevalence = 2; 6420 6421 // Whether this infoType was excluded from sensitivity and risk analysis due 6422 // to factors such as low prevalence (subject to change). 6423 bool excluded_from_analysis = 3; 6424} 6425 6426// Bucketized nullness percentage levels. A higher level means a higher 6427// percentage of the column is null. 6428enum NullPercentageLevel { 6429 // Unused. 6430 NULL_PERCENTAGE_LEVEL_UNSPECIFIED = 0; 6431 6432 // Very few null entries. 6433 NULL_PERCENTAGE_VERY_LOW = 1; 6434 6435 // Some null entries. 6436 NULL_PERCENTAGE_LOW = 2; 6437 6438 // A few null entries. 6439 NULL_PERCENTAGE_MEDIUM = 3; 6440 6441 // A lot of null entries. 6442 NULL_PERCENTAGE_HIGH = 4; 6443} 6444 6445// Bucketized uniqueness score levels. A higher uniqueness score is a strong 6446// signal that the column may contain a unique identifier like user id. A low 6447// value indicates that the column contains few unique values like booleans or 6448// other classifiers. 6449enum UniquenessScoreLevel { 6450 // Some columns do not have estimated uniqueness. Possible reasons include 6451 // having too few values. 6452 UNIQUENESS_SCORE_LEVEL_UNSPECIFIED = 0; 6453 6454 // Low uniqueness, possibly a boolean, enum or similiarly typed column. 6455 UNIQUENESS_SCORE_LOW = 1; 6456 6457 // Medium uniqueness. 6458 UNIQUENESS_SCORE_MEDIUM = 2; 6459 6460 // High uniqueness, possibly a column of free text or unique identifiers. 6461 UNIQUENESS_SCORE_HIGH = 3; 6462} 6463 6464// The profile for a scanned column within a table. 6465message ColumnDataProfile { 6466 option (google.api.resource) = { 6467 type: "dlp.googleapis.com/ColumnDataProfile" 6468 pattern: "organizations/{organization}/locations/{location}/columnDataProfiles/{column_data_profile}" 6469 pattern: "projects/{project}/locations/{location}/columnDataProfiles/{column_data_profile}" 6470 }; 6471 // Possible states of a profile. New items may be added. 6472 enum State { 6473 // Unused. 6474 STATE_UNSPECIFIED = 0; 6475 6476 // The profile is currently running. Once a profile has finished it will 6477 // transition to DONE. 6478 RUNNING = 1; 6479 6480 // The profile is no longer generating. 6481 // If profile_status.status.code is 0, the profile succeeded, otherwise, it 6482 // failed. 6483 DONE = 2; 6484 } 6485 6486 // Data types of the data in a column. Types may be added over time. 6487 enum ColumnDataType { 6488 // Invalid type. 6489 COLUMN_DATA_TYPE_UNSPECIFIED = 0; 6490 6491 // Encoded as a string in decimal format. 6492 TYPE_INT64 = 1; 6493 6494 // Encoded as a boolean "false" or "true". 6495 TYPE_BOOL = 2; 6496 6497 // Encoded as a number, or string "NaN", "Infinity" or "-Infinity". 6498 TYPE_FLOAT64 = 3; 6499 6500 // Encoded as a string value. 6501 TYPE_STRING = 4; 6502 6503 // Encoded as a base64 string per RFC 4648, section 4. 6504 TYPE_BYTES = 5; 6505 6506 // Encoded as an RFC 3339 timestamp with mandatory "Z" time zone string: 6507 // 1985-04-12T23:20:50.52Z 6508 TYPE_TIMESTAMP = 6; 6509 6510 // Encoded as RFC 3339 full-date format string: 1985-04-12 6511 TYPE_DATE = 7; 6512 6513 // Encoded as RFC 3339 partial-time format string: 23:20:50.52 6514 TYPE_TIME = 8; 6515 6516 // Encoded as RFC 3339 full-date "T" partial-time: 1985-04-12T23:20:50.52 6517 TYPE_DATETIME = 9; 6518 6519 // Encoded as WKT 6520 TYPE_GEOGRAPHY = 10; 6521 6522 // Encoded as a decimal string. 6523 TYPE_NUMERIC = 11; 6524 6525 // Container of ordered fields, each with a type and field name. 6526 TYPE_RECORD = 12; 6527 6528 // Decimal type. 6529 TYPE_BIGNUMERIC = 13; 6530 6531 // Json type. 6532 TYPE_JSON = 14; 6533 } 6534 6535 // The possible policy states for a column. 6536 enum ColumnPolicyState { 6537 // No policy tags. 6538 COLUMN_POLICY_STATE_UNSPECIFIED = 0; 6539 6540 // Column has policy tag applied. 6541 COLUMN_POLICY_TAGGED = 1; 6542 } 6543 6544 // The name of the profile. 6545 string name = 1; 6546 6547 // Success or error status from the most recent profile generation attempt. 6548 // May be empty if the profile is still being generated. 6549 ProfileStatus profile_status = 17; 6550 6551 // State of a profile. 6552 State state = 18; 6553 6554 // The last time the profile was generated. 6555 google.protobuf.Timestamp profile_last_generated = 3; 6556 6557 // The resource name of the table data profile. 6558 string table_data_profile = 4; 6559 6560 // The resource name of the resource this column is within. 6561 string table_full_resource = 5; 6562 6563 // The Google Cloud project ID that owns the profiled resource. 6564 string dataset_project_id = 19; 6565 6566 // The BigQuery location where the dataset's data is stored. 6567 // See https://cloud.google.com/bigquery/docs/locations for supported 6568 // locations. 6569 string dataset_location = 20; 6570 6571 // The BigQuery dataset ID. 6572 string dataset_id = 21; 6573 6574 // The BigQuery table ID. 6575 string table_id = 22; 6576 6577 // The name of the column. 6578 string column = 6; 6579 6580 // The sensitivity of this column. 6581 SensitivityScore sensitivity_score = 7; 6582 6583 // The data risk level for this column. 6584 DataRiskLevel data_risk_level = 8; 6585 6586 // If it's been determined this column can be identified as a single type, 6587 // this will be set. Otherwise the column either has unidentifiable content 6588 // or mixed types. 6589 InfoTypeSummary column_info_type = 9; 6590 6591 // Other types found within this column. List will be unordered. 6592 repeated OtherInfoTypeSummary other_matches = 10; 6593 6594 // Approximate percentage of entries being null in the column. 6595 NullPercentageLevel estimated_null_percentage = 23; 6596 6597 // Approximate uniqueness of the column. 6598 UniquenessScoreLevel estimated_uniqueness_score = 24; 6599 6600 // The likelihood that this column contains free-form text. 6601 // A value close to 1 may indicate the column is likely to contain 6602 // free-form or natural language text. 6603 // Range in 0-1. 6604 double free_text_score = 13; 6605 6606 // The data type of a given column. 6607 ColumnDataType column_type = 14; 6608 6609 // Indicates if a policy tag has been applied to the column. 6610 ColumnPolicyState policy_state = 15; 6611} 6612 6613// Request to get a project data profile. 6614message GetProjectDataProfileRequest { 6615 // Required. Resource name, for example 6616 // `organizations/12345/locations/us/projectDataProfiles/53234423`. 6617 string name = 1 [ 6618 (google.api.field_behavior) = REQUIRED, 6619 (google.api.resource_reference) = { 6620 type: "dlp.googleapis.com/ProjectDataProfile" 6621 } 6622 ]; 6623} 6624 6625// Request to get a table data profile. 6626message GetTableDataProfileRequest { 6627 // Required. Resource name, for example 6628 // `organizations/12345/locations/us/tableDataProfiles/53234423`. 6629 string name = 1 [ 6630 (google.api.field_behavior) = REQUIRED, 6631 (google.api.resource_reference) = { 6632 type: "dlp.googleapis.com/TableDataProfile" 6633 } 6634 ]; 6635} 6636 6637// Request to get a column data profile. 6638message GetColumnDataProfileRequest { 6639 // Required. Resource name, for example 6640 // `organizations/12345/locations/us/columnDataProfiles/53234423`. 6641 string name = 1 [ 6642 (google.api.field_behavior) = REQUIRED, 6643 (google.api.resource_reference) = { 6644 type: "dlp.googleapis.com/ColumnDataProfile" 6645 } 6646 ]; 6647} 6648 6649// A condition for determining whether a Pub/Sub should be triggered. 6650message DataProfilePubSubCondition { 6651 // Various score levels for resources. 6652 enum ProfileScoreBucket { 6653 // Unused. 6654 PROFILE_SCORE_BUCKET_UNSPECIFIED = 0; 6655 6656 // High risk/sensitivity detected. 6657 HIGH = 1; 6658 6659 // Medium or high risk/sensitivity detected. 6660 MEDIUM_OR_HIGH = 2; 6661 } 6662 6663 // A condition consisting of a value. 6664 message PubSubCondition { 6665 // The value for the condition to trigger. 6666 oneof value { 6667 // The minimum data risk score that triggers the condition. 6668 ProfileScoreBucket minimum_risk_score = 1; 6669 6670 // The minimum sensitivity level that triggers the condition. 6671 ProfileScoreBucket minimum_sensitivity_score = 2; 6672 } 6673 } 6674 6675 // An expression, consisting of an operator and conditions. 6676 message PubSubExpressions { 6677 // Logical operators for conditional checks. 6678 enum PubSubLogicalOperator { 6679 // Unused. 6680 LOGICAL_OPERATOR_UNSPECIFIED = 0; 6681 6682 // Conditional OR. 6683 OR = 1; 6684 6685 // Conditional AND. 6686 AND = 2; 6687 } 6688 6689 // The operator to apply to the collection of conditions. 6690 PubSubLogicalOperator logical_operator = 1; 6691 6692 // Conditions to apply to the expression. 6693 repeated PubSubCondition conditions = 2; 6694 } 6695 6696 // An expression. 6697 PubSubExpressions expressions = 1; 6698} 6699 6700// Pub/Sub topic message for a DataProfileAction.PubSubNotification event. 6701// To receive a message of protocol buffer schema type, convert the message data 6702// to an object of this proto class. 6703message DataProfilePubSubMessage { 6704 // If `DetailLevel` is `TABLE_PROFILE` this will be fully populated. 6705 // Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and 6706 // `full_resource` will be populated. 6707 TableDataProfile profile = 1; 6708 6709 // The event that caused the Pub/Sub message to be sent. 6710 DataProfileAction.EventType event = 2; 6711} 6712 6713// Message used to identify the type of resource being profiled. 6714message DataSourceType { 6715 // Output only. An identifying string to the type of resource being profiled. 6716 // Current values: google/bigquery/table, google/project 6717 string data_source = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 6718} 6719