dlp.proto 190 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.privacy.dlp.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/privacy/dlp/v2/storage.proto";
  21. import "google/protobuf/duration.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/field_mask.proto";
  24. import "google/protobuf/timestamp.proto";
  25. import "google/rpc/status.proto";
  26. import "google/type/date.proto";
  27. import "google/type/dayofweek.proto";
  28. import "google/type/timeofday.proto";
  29. option csharp_namespace = "Google.Cloud.Dlp.V2";
  30. option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp";
  31. option java_multiple_files = true;
  32. option java_outer_classname = "DlpProto";
  33. option java_package = "com.google.privacy.dlp.v2";
  34. option php_namespace = "Google\\Cloud\\Dlp\\V2";
  35. option ruby_package = "Google::Cloud::Dlp::V2";
  36. option (google.api.resource_definition) = {
  37. type: "dlp.googleapis.com/DlpContent"
  38. pattern: "projects/{project}/dlpContent"
  39. pattern: "projects/{project}/locations/{location}/dlpContent"
  40. };
  41. option (google.api.resource_definition) = {
  42. type: "dlp.googleapis.com/OrganizationLocation"
  43. pattern: "organizations/{organization}/locations/{location}"
  44. };
  45. // The Cloud Data Loss Prevention (DLP) API is a service that allows clients
  46. // to detect the presence of Personally Identifiable Information (PII) and other
  47. // privacy-sensitive data in user-supplied, unstructured data streams, like text
  48. // blocks or images.
  49. // The service also includes methods for sensitive data redaction and
  50. // scheduling of data scans on Google Cloud Platform based data sets.
  51. //
  52. // To learn more about concepts and find how-to guides see
  53. // https://cloud.google.com/dlp/docs/.
  54. service DlpService {
  55. option (google.api.default_host) = "dlp.googleapis.com";
  56. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  57. // Finds potentially sensitive info in content.
  58. // This method has limits on input size, processing time, and output size.
  59. //
  60. // When no InfoTypes or CustomInfoTypes are specified in this request, the
  61. // system will automatically choose what detectors to run. By default this may
  62. // be all types, but may change over time as detectors are updated.
  63. //
  64. // For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
  65. // and https://cloud.google.com/dlp/docs/inspecting-text,
  66. rpc InspectContent(InspectContentRequest) returns (InspectContentResponse) {
  67. option (google.api.http) = {
  68. post: "/v2/{parent=projects/*}/content:inspect"
  69. body: "*"
  70. additional_bindings {
  71. post: "/v2/{parent=projects/*/locations/*}/content:inspect"
  72. body: "*"
  73. }
  74. };
  75. }
  76. // Redacts potentially sensitive info from an image.
  77. // This method has limits on input size, processing time, and output size.
  78. // See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
  79. // learn more.
  80. //
  81. // When no InfoTypes or CustomInfoTypes are specified in this request, the
  82. // system will automatically choose what detectors to run. By default this may
  83. // be all types, but may change over time as detectors are updated.
  84. rpc RedactImage(RedactImageRequest) returns (RedactImageResponse) {
  85. option (google.api.http) = {
  86. post: "/v2/{parent=projects/*}/image:redact"
  87. body: "*"
  88. additional_bindings {
  89. post: "/v2/{parent=projects/*/locations/*}/image:redact"
  90. body: "*"
  91. }
  92. };
  93. }
  94. // De-identifies potentially sensitive info from a ContentItem.
  95. // This method has limits on input size and output size.
  96. // See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
  97. // learn more.
  98. //
  99. // When no InfoTypes or CustomInfoTypes are specified in this request, the
  100. // system will automatically choose what detectors to run. By default this may
  101. // be all types, but may change over time as detectors are updated.
  102. rpc DeidentifyContent(DeidentifyContentRequest) returns (DeidentifyContentResponse) {
  103. option (google.api.http) = {
  104. post: "/v2/{parent=projects/*}/content:deidentify"
  105. body: "*"
  106. additional_bindings {
  107. post: "/v2/{parent=projects/*/locations/*}/content:deidentify"
  108. body: "*"
  109. }
  110. };
  111. }
  112. // Re-identifies content that has been de-identified.
  113. // See
  114. // https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
  115. // to learn more.
  116. rpc ReidentifyContent(ReidentifyContentRequest) returns (ReidentifyContentResponse) {
  117. option (google.api.http) = {
  118. post: "/v2/{parent=projects/*}/content:reidentify"
  119. body: "*"
  120. additional_bindings {
  121. post: "/v2/{parent=projects/*/locations/*}/content:reidentify"
  122. body: "*"
  123. }
  124. };
  125. }
  126. // Returns a list of the sensitive information types that DLP API
  127. // supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
  128. // learn more.
  129. rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) {
  130. option (google.api.http) = {
  131. get: "/v2/infoTypes"
  132. additional_bindings {
  133. get: "/v2/{parent=locations/*}/infoTypes"
  134. }
  135. };
  136. option (google.api.method_signature) = "parent";
  137. }
  138. // Creates an InspectTemplate for reusing frequently used configuration
  139. // for inspecting content, images, and storage.
  140. // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
  141. rpc CreateInspectTemplate(CreateInspectTemplateRequest) returns (InspectTemplate) {
  142. option (google.api.http) = {
  143. post: "/v2/{parent=organizations/*}/inspectTemplates"
  144. body: "*"
  145. additional_bindings {
  146. post: "/v2/{parent=organizations/*/locations/*}/inspectTemplates"
  147. body: "*"
  148. }
  149. additional_bindings {
  150. post: "/v2/{parent=projects/*}/inspectTemplates"
  151. body: "*"
  152. }
  153. additional_bindings {
  154. post: "/v2/{parent=projects/*/locations/*}/inspectTemplates"
  155. body: "*"
  156. }
  157. };
  158. option (google.api.method_signature) = "parent,inspect_template";
  159. }
  160. // Updates the InspectTemplate.
  161. // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
  162. rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) returns (InspectTemplate) {
  163. option (google.api.http) = {
  164. patch: "/v2/{name=organizations/*/inspectTemplates/*}"
  165. body: "*"
  166. additional_bindings {
  167. patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}"
  168. body: "*"
  169. }
  170. additional_bindings {
  171. patch: "/v2/{name=projects/*/inspectTemplates/*}"
  172. body: "*"
  173. }
  174. additional_bindings {
  175. patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}"
  176. body: "*"
  177. }
  178. };
  179. option (google.api.method_signature) = "name,inspect_template,update_mask";
  180. }
  181. // Gets an InspectTemplate.
  182. // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
  183. rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) {
  184. option (google.api.http) = {
  185. get: "/v2/{name=organizations/*/inspectTemplates/*}"
  186. additional_bindings {
  187. get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}"
  188. }
  189. additional_bindings {
  190. get: "/v2/{name=projects/*/inspectTemplates/*}"
  191. }
  192. additional_bindings {
  193. get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}"
  194. }
  195. };
  196. option (google.api.method_signature) = "name";
  197. }
  198. // Lists InspectTemplates.
  199. // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
  200. rpc ListInspectTemplates(ListInspectTemplatesRequest) returns (ListInspectTemplatesResponse) {
  201. option (google.api.http) = {
  202. get: "/v2/{parent=organizations/*}/inspectTemplates"
  203. additional_bindings {
  204. get: "/v2/{parent=organizations/*/locations/*}/inspectTemplates"
  205. }
  206. additional_bindings {
  207. get: "/v2/{parent=projects/*}/inspectTemplates"
  208. }
  209. additional_bindings {
  210. get: "/v2/{parent=projects/*/locations/*}/inspectTemplates"
  211. }
  212. };
  213. option (google.api.method_signature) = "parent";
  214. }
  215. // Deletes an InspectTemplate.
  216. // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
  217. rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) {
  218. option (google.api.http) = {
  219. delete: "/v2/{name=organizations/*/inspectTemplates/*}"
  220. additional_bindings {
  221. delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}"
  222. }
  223. additional_bindings {
  224. delete: "/v2/{name=projects/*/inspectTemplates/*}"
  225. }
  226. additional_bindings {
  227. delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}"
  228. }
  229. };
  230. option (google.api.method_signature) = "name";
  231. }
  232. // Creates a DeidentifyTemplate for reusing frequently used configuration
  233. // for de-identifying content, images, and storage.
  234. // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
  235. // more.
  236. rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
  237. option (google.api.http) = {
  238. post: "/v2/{parent=organizations/*}/deidentifyTemplates"
  239. body: "*"
  240. additional_bindings {
  241. post: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates"
  242. body: "*"
  243. }
  244. additional_bindings {
  245. post: "/v2/{parent=projects/*}/deidentifyTemplates"
  246. body: "*"
  247. }
  248. additional_bindings {
  249. post: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates"
  250. body: "*"
  251. }
  252. };
  253. option (google.api.method_signature) = "parent,deidentify_template";
  254. }
  255. // Updates the DeidentifyTemplate.
  256. // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
  257. // more.
  258. rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
  259. option (google.api.http) = {
  260. patch: "/v2/{name=organizations/*/deidentifyTemplates/*}"
  261. body: "*"
  262. additional_bindings {
  263. patch: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}"
  264. body: "*"
  265. }
  266. additional_bindings {
  267. patch: "/v2/{name=projects/*/deidentifyTemplates/*}"
  268. body: "*"
  269. }
  270. additional_bindings {
  271. patch: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}"
  272. body: "*"
  273. }
  274. };
  275. option (google.api.method_signature) = "name,deidentify_template,update_mask";
  276. }
  277. // Gets a DeidentifyTemplate.
  278. // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
  279. // more.
  280. rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
  281. option (google.api.http) = {
  282. get: "/v2/{name=organizations/*/deidentifyTemplates/*}"
  283. additional_bindings {
  284. get: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}"
  285. }
  286. additional_bindings {
  287. get: "/v2/{name=projects/*/deidentifyTemplates/*}"
  288. }
  289. additional_bindings {
  290. get: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}"
  291. }
  292. };
  293. option (google.api.method_signature) = "name";
  294. }
  295. // Lists DeidentifyTemplates.
  296. // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
  297. // more.
  298. rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) returns (ListDeidentifyTemplatesResponse) {
  299. option (google.api.http) = {
  300. get: "/v2/{parent=organizations/*}/deidentifyTemplates"
  301. additional_bindings {
  302. get: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates"
  303. }
  304. additional_bindings {
  305. get: "/v2/{parent=projects/*}/deidentifyTemplates"
  306. }
  307. additional_bindings {
  308. get: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates"
  309. }
  310. };
  311. option (google.api.method_signature) = "parent";
  312. }
  313. // Deletes a DeidentifyTemplate.
  314. // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
  315. // more.
  316. rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) returns (google.protobuf.Empty) {
  317. option (google.api.http) = {
  318. delete: "/v2/{name=organizations/*/deidentifyTemplates/*}"
  319. additional_bindings {
  320. delete: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}"
  321. }
  322. additional_bindings {
  323. delete: "/v2/{name=projects/*/deidentifyTemplates/*}"
  324. }
  325. additional_bindings {
  326. delete: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}"
  327. }
  328. };
  329. option (google.api.method_signature) = "name";
  330. }
  331. // Creates a job trigger to run DLP actions such as scanning storage for
  332. // sensitive information on a set schedule.
  333. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  334. rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) {
  335. option (google.api.http) = {
  336. post: "/v2/{parent=projects/*}/jobTriggers"
  337. body: "*"
  338. additional_bindings {
  339. post: "/v2/{parent=projects/*/locations/*}/jobTriggers"
  340. body: "*"
  341. }
  342. additional_bindings {
  343. post: "/v2/{parent=organizations/*/locations/*}/jobTriggers"
  344. body: "*"
  345. }
  346. };
  347. option (google.api.method_signature) = "parent,job_trigger";
  348. }
  349. // Updates a job trigger.
  350. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  351. rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) {
  352. option (google.api.http) = {
  353. patch: "/v2/{name=projects/*/jobTriggers/*}"
  354. body: "*"
  355. additional_bindings {
  356. patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
  357. body: "*"
  358. }
  359. additional_bindings {
  360. patch: "/v2/{name=organizations/*/locations/*/jobTriggers/*}"
  361. body: "*"
  362. }
  363. };
  364. option (google.api.method_signature) = "name,job_trigger,update_mask";
  365. }
  366. // Inspect hybrid content and store findings to a trigger. The inspection
  367. // will be processed asynchronously. To review the findings monitor the
  368. // jobs within the trigger.
  369. rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) {
  370. option (google.api.http) = {
  371. post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect"
  372. body: "*"
  373. };
  374. option (google.api.method_signature) = "name";
  375. }
  376. // Gets a job trigger.
  377. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  378. rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) {
  379. option (google.api.http) = {
  380. get: "/v2/{name=projects/*/jobTriggers/*}"
  381. additional_bindings {
  382. get: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
  383. }
  384. additional_bindings {
  385. get: "/v2/{name=organizations/*/locations/*/jobTriggers/*}"
  386. }
  387. };
  388. option (google.api.method_signature) = "name";
  389. }
  390. // Lists job triggers.
  391. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  392. rpc ListJobTriggers(ListJobTriggersRequest) returns (ListJobTriggersResponse) {
  393. option (google.api.http) = {
  394. get: "/v2/{parent=projects/*}/jobTriggers"
  395. additional_bindings {
  396. get: "/v2/{parent=projects/*/locations/*}/jobTriggers"
  397. }
  398. additional_bindings {
  399. get: "/v2/{parent=organizations/*/locations/*}/jobTriggers"
  400. }
  401. };
  402. option (google.api.method_signature) = "parent";
  403. }
  404. // Deletes a job trigger.
  405. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  406. rpc DeleteJobTrigger(DeleteJobTriggerRequest) returns (google.protobuf.Empty) {
  407. option (google.api.http) = {
  408. delete: "/v2/{name=projects/*/jobTriggers/*}"
  409. additional_bindings {
  410. delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
  411. }
  412. additional_bindings {
  413. delete: "/v2/{name=organizations/*/locations/*/jobTriggers/*}"
  414. }
  415. };
  416. option (google.api.method_signature) = "name";
  417. }
  418. // Activate a job trigger. Causes the immediate execute of a trigger
  419. // instead of waiting on the trigger event to occur.
  420. rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) {
  421. option (google.api.http) = {
  422. post: "/v2/{name=projects/*/jobTriggers/*}:activate"
  423. body: "*"
  424. additional_bindings {
  425. post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate"
  426. body: "*"
  427. }
  428. };
  429. }
  430. // Creates a new job to inspect storage or calculate risk metrics.
  431. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  432. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  433. //
  434. // When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
  435. // system will automatically choose what detectors to run. By default this may
  436. // be all types, but may change over time as detectors are updated.
  437. rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) {
  438. option (google.api.http) = {
  439. post: "/v2/{parent=projects/*}/dlpJobs"
  440. body: "*"
  441. additional_bindings {
  442. post: "/v2/{parent=projects/*/locations/*}/dlpJobs"
  443. body: "*"
  444. }
  445. };
  446. option (google.api.method_signature) = "parent,inspect_job";
  447. option (google.api.method_signature) = "parent,risk_job";
  448. }
  449. // Lists DlpJobs that match the specified filter in the request.
  450. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  451. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  452. rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) {
  453. option (google.api.http) = {
  454. get: "/v2/{parent=projects/*}/dlpJobs"
  455. additional_bindings {
  456. get: "/v2/{parent=projects/*/locations/*}/dlpJobs"
  457. }
  458. additional_bindings {
  459. get: "/v2/{parent=organizations/*/locations/*}/dlpJobs"
  460. }
  461. };
  462. option (google.api.method_signature) = "parent";
  463. }
  464. // Gets the latest state of a long-running DlpJob.
  465. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  466. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  467. rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) {
  468. option (google.api.http) = {
  469. get: "/v2/{name=projects/*/dlpJobs/*}"
  470. additional_bindings {
  471. get: "/v2/{name=projects/*/locations/*/dlpJobs/*}"
  472. }
  473. };
  474. option (google.api.method_signature) = "name";
  475. }
  476. // Deletes a long-running DlpJob. This method indicates that the client is
  477. // no longer interested in the DlpJob result. The job will be canceled if
  478. // possible.
  479. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  480. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  481. rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) {
  482. option (google.api.http) = {
  483. delete: "/v2/{name=projects/*/dlpJobs/*}"
  484. additional_bindings {
  485. delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}"
  486. }
  487. };
  488. option (google.api.method_signature) = "name";
  489. }
  490. // Starts asynchronous cancellation on a long-running DlpJob. The server
  491. // makes a best effort to cancel the DlpJob, but success is not
  492. // guaranteed.
  493. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  494. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  495. rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) {
  496. option (google.api.http) = {
  497. post: "/v2/{name=projects/*/dlpJobs/*}:cancel"
  498. body: "*"
  499. additional_bindings {
  500. post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel"
  501. body: "*"
  502. }
  503. };
  504. }
  505. // Creates a pre-built stored infoType to be used for inspection.
  506. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  507. // learn more.
  508. rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) {
  509. option (google.api.http) = {
  510. post: "/v2/{parent=organizations/*}/storedInfoTypes"
  511. body: "*"
  512. additional_bindings {
  513. post: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes"
  514. body: "*"
  515. }
  516. additional_bindings {
  517. post: "/v2/{parent=projects/*}/storedInfoTypes"
  518. body: "*"
  519. }
  520. additional_bindings {
  521. post: "/v2/{parent=projects/*/locations/*}/storedInfoTypes"
  522. body: "*"
  523. }
  524. };
  525. option (google.api.method_signature) = "parent,config";
  526. }
  527. // Updates the stored infoType by creating a new version. The existing version
  528. // will continue to be used until the new version is ready.
  529. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  530. // learn more.
  531. rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) {
  532. option (google.api.http) = {
  533. patch: "/v2/{name=organizations/*/storedInfoTypes/*}"
  534. body: "*"
  535. additional_bindings {
  536. patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
  537. body: "*"
  538. }
  539. additional_bindings {
  540. patch: "/v2/{name=projects/*/storedInfoTypes/*}"
  541. body: "*"
  542. }
  543. additional_bindings {
  544. patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
  545. body: "*"
  546. }
  547. };
  548. option (google.api.method_signature) = "name,config,update_mask";
  549. }
  550. // Gets a stored infoType.
  551. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  552. // learn more.
  553. rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) {
  554. option (google.api.http) = {
  555. get: "/v2/{name=organizations/*/storedInfoTypes/*}"
  556. additional_bindings {
  557. get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
  558. }
  559. additional_bindings {
  560. get: "/v2/{name=projects/*/storedInfoTypes/*}"
  561. }
  562. additional_bindings {
  563. get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
  564. }
  565. };
  566. option (google.api.method_signature) = "name";
  567. }
  568. // Lists stored infoTypes.
  569. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  570. // learn more.
  571. rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) {
  572. option (google.api.http) = {
  573. get: "/v2/{parent=organizations/*}/storedInfoTypes"
  574. additional_bindings {
  575. get: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes"
  576. }
  577. additional_bindings {
  578. get: "/v2/{parent=projects/*}/storedInfoTypes"
  579. }
  580. additional_bindings {
  581. get: "/v2/{parent=projects/*/locations/*}/storedInfoTypes"
  582. }
  583. };
  584. option (google.api.method_signature) = "parent";
  585. }
  586. // Deletes a stored infoType.
  587. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  588. // learn more.
  589. rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) {
  590. option (google.api.http) = {
  591. delete: "/v2/{name=organizations/*/storedInfoTypes/*}"
  592. additional_bindings {
  593. delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
  594. }
  595. additional_bindings {
  596. delete: "/v2/{name=projects/*/storedInfoTypes/*}"
  597. }
  598. additional_bindings {
  599. delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
  600. }
  601. };
  602. option (google.api.method_signature) = "name";
  603. }
  604. // Inspect hybrid content and store findings to a job.
  605. // To review the findings, inspect the job. Inspection will occur
  606. // asynchronously.
  607. rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) {
  608. option (google.api.http) = {
  609. post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect"
  610. body: "*"
  611. };
  612. option (google.api.method_signature) = "name";
  613. }
  614. // Finish a running hybrid DlpJob. Triggers the finalization steps and running
  615. // of any enabled actions that have not yet run.
  616. rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) {
  617. option (google.api.http) = {
  618. post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish"
  619. body: "*"
  620. };
  621. }
  622. }
  623. // List of excluded infoTypes.
  624. message ExcludeInfoTypes {
  625. // InfoType list in ExclusionRule rule drops a finding when it overlaps or
  626. // contained within with a finding of an infoType from this list. For
  627. // example, for `InspectionRuleSet.info_types` containing "PHONE_NUMBER"` and
  628. // `exclusion_rule` containing `exclude_info_types.info_types` with
  629. // "EMAIL_ADDRESS" the phone number findings are dropped if they overlap
  630. // with EMAIL_ADDRESS finding.
  631. // That leads to "555-222-2222@example.org" to generate only a single
  632. // finding, namely email address.
  633. repeated InfoType info_types = 1;
  634. }
  635. // The rule to exclude findings based on a hotword. For record inspection of
  636. // tables, column names are considered hotwords. An example of this is to
  637. // exclude a finding if a BigQuery column matches a specific pattern.
  638. message ExcludeByHotword {
  639. // Regular expression pattern defining what qualifies as a hotword.
  640. CustomInfoType.Regex hotword_regex = 1;
  641. // Range of characters within which the entire hotword must reside.
  642. // The total length of the window cannot exceed 1000 characters.
  643. // The windowBefore property in proximity should be set to 1 if the hotword
  644. // needs to be included in a column header.
  645. CustomInfoType.DetectionRule.Proximity proximity = 2;
  646. }
  647. // The rule that specifies conditions when findings of infoTypes specified in
  648. // `InspectionRuleSet` are removed from results.
  649. message ExclusionRule {
  650. // Exclusion rule types.
  651. oneof type {
  652. // Dictionary which defines the rule.
  653. CustomInfoType.Dictionary dictionary = 1;
  654. // Regular expression which defines the rule.
  655. CustomInfoType.Regex regex = 2;
  656. // Set of infoTypes for which findings would affect this rule.
  657. ExcludeInfoTypes exclude_info_types = 3;
  658. // Drop if the hotword rule is contained in the proximate context. For
  659. // tabular data, the context includes the column name.
  660. ExcludeByHotword exclude_by_hotword = 5;
  661. }
  662. // How the rule is applied, see MatchingType documentation for details.
  663. MatchingType matching_type = 4;
  664. }
  665. // A single inspection rule to be applied to infoTypes, specified in
  666. // `InspectionRuleSet`.
  667. message InspectionRule {
  668. // Inspection rule types.
  669. oneof type {
  670. // Hotword-based detection rule.
  671. CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;
  672. // Exclusion rule.
  673. ExclusionRule exclusion_rule = 2;
  674. }
  675. }
  676. // Rule set for modifying a set of infoTypes to alter behavior under certain
  677. // circumstances, depending on the specific details of the rules within the set.
  678. message InspectionRuleSet {
  679. // List of infoTypes this rule set is applied to.
  680. repeated InfoType info_types = 1;
  681. // Set of rules to be applied to infoTypes. The rules are applied in order.
  682. repeated InspectionRule rules = 2;
  683. }
  684. // Configuration description of the scanning process.
  685. // When used with redactContent only info_types and min_likelihood are currently
  686. // used.
  687. message InspectConfig {
  688. // Configuration to control the number of findings returned for inspection.
  689. // This is not used for de-identification or data profiling.
  690. //
  691. // When redacting sensitive data from images, finding limits don't apply. They
  692. // can cause unexpected or inconsistent results, where only some data is
  693. // redacted. Don't include finding limits in
  694. // [RedactImage][google.privacy.dlp.v2.DlpService.RedactImage]
  695. // requests. Otherwise, Cloud DLP returns an error.
  696. message FindingLimits {
  697. // Max findings configuration per infoType, per content item or long
  698. // running DlpJob.
  699. message InfoTypeLimit {
  700. // Type of information the findings limit applies to. Only one limit per
  701. // info_type should be provided. If InfoTypeLimit does not have an
  702. // info_type, the DLP API applies the limit against all info_types that
  703. // are found but not specified in another InfoTypeLimit.
  704. InfoType info_type = 1;
  705. // Max findings limit for the given infoType.
  706. int32 max_findings = 2;
  707. }
  708. // Max number of findings that will be returned for each item scanned.
  709. // When set within `InspectJobConfig`,
  710. // the maximum returned is 2000 regardless if this is set higher.
  711. // When set within `InspectContentRequest`, this field is ignored.
  712. int32 max_findings_per_item = 1;
  713. // Max number of findings that will be returned per request/job.
  714. // When set within `InspectContentRequest`, the maximum returned is 2000
  715. // regardless if this is set higher.
  716. int32 max_findings_per_request = 2;
  717. // Configuration of findings limit given for specified infoTypes.
  718. repeated InfoTypeLimit max_findings_per_info_type = 3;
  719. }
  720. // Restricts what info_types to look for. The values must correspond to
  721. // InfoType values returned by ListInfoTypes or listed at
  722. // https://cloud.google.com/dlp/docs/infotypes-reference.
  723. //
  724. // When no InfoTypes or CustomInfoTypes are specified in a request, the
  725. // system may automatically choose what detectors to run. By default this may
  726. // be all types, but may change over time as detectors are updated.
  727. //
  728. // If you need precise control and predictability as to what detectors are
  729. // run you should specify specific InfoTypes listed in the reference,
  730. // otherwise a default list will be used, which may change over time.
  731. repeated InfoType info_types = 1;
  732. // Only returns findings equal or above this threshold. The default is
  733. // POSSIBLE.
  734. // See https://cloud.google.com/dlp/docs/likelihood to learn more.
  735. Likelihood min_likelihood = 2;
  736. // Configuration to control the number of findings returned.
  737. // This is not used for data profiling.
  738. //
  739. // When redacting sensitive data from images, finding limits don't apply. They
  740. // can cause unexpected or inconsistent results, where only some data is
  741. // redacted. Don't include finding limits in
  742. // [RedactImage][google.privacy.dlp.v2.DlpService.RedactImage]
  743. // requests. Otherwise, Cloud DLP returns an error.
  744. FindingLimits limits = 3;
  745. // When true, a contextual quote from the data that triggered a finding is
  746. // included in the response; see [Finding.quote][google.privacy.dlp.v2.Finding.quote].
  747. // This is not used for data profiling.
  748. bool include_quote = 4;
  749. // When true, excludes type information of the findings.
  750. // This is not used for data profiling.
  751. bool exclude_info_types = 5;
  752. // CustomInfoTypes provided by the user. See
  753. // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more.
  754. repeated CustomInfoType custom_info_types = 6;
  755. // Deprecated and unused.
  756. repeated ContentOption content_options = 8;
  757. // Set of rules to apply to the findings for this InspectConfig.
  758. // Exclusion rules, contained in the set are executed in the end, other
  759. // rules are executed in the order they are specified for each info type.
  760. repeated InspectionRuleSet rule_set = 10;
  761. }
  762. // Container for bytes to inspect or redact.
  763. message ByteContentItem {
  764. // The type of data being sent for inspection. To learn more, see
  765. // [Supported file
  766. // types](https://cloud.google.com/dlp/docs/supported-file-types).
  767. enum BytesType {
  768. // Unused
  769. BYTES_TYPE_UNSPECIFIED = 0;
  770. // Any image type.
  771. IMAGE = 6;
  772. // jpeg
  773. IMAGE_JPEG = 1;
  774. // bmp
  775. IMAGE_BMP = 2;
  776. // png
  777. IMAGE_PNG = 3;
  778. // svg
  779. IMAGE_SVG = 4;
  780. // plain text
  781. TEXT_UTF8 = 5;
  782. // docx, docm, dotx, dotm
  783. WORD_DOCUMENT = 7;
  784. // pdf
  785. PDF = 8;
  786. // pptx, pptm, potx, potm, pot
  787. POWERPOINT_DOCUMENT = 9;
  788. // xlsx, xlsm, xltx, xltm
  789. EXCEL_DOCUMENT = 10;
  790. // avro
  791. AVRO = 11;
  792. // csv
  793. CSV = 12;
  794. // tsv
  795. TSV = 13;
  796. }
  797. // The type of data stored in the bytes string. Default will be TEXT_UTF8.
  798. BytesType type = 1;
  799. // Content data to inspect or redact.
  800. bytes data = 2;
  801. }
  802. message ContentItem {
  803. // Data of the item either in the byte array or UTF-8 string form, or table.
  804. oneof data_item {
  805. // String data to inspect or redact.
  806. string value = 3;
  807. // Structured content for inspection. See
  808. // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
  809. // learn more.
  810. Table table = 4;
  811. // Content data to inspect or redact. Replaces `type` and `data`.
  812. ByteContentItem byte_item = 5;
  813. }
  814. }
  815. // Structured content to inspect. Up to 50,000 `Value`s per request allowed. See
  816. // https://cloud.google.com/dlp/docs/inspecting-structured-text#inspecting_a_table
  817. // to learn more.
  818. message Table {
  819. // Values of the row.
  820. message Row {
  821. // Individual cells.
  822. repeated Value values = 1;
  823. }
  824. // Headers of the table.
  825. repeated FieldId headers = 1;
  826. // Rows of the table.
  827. repeated Row rows = 2;
  828. }
  829. // All the findings for a single scanned item.
  830. message InspectResult {
  831. // List of findings for an item.
  832. repeated Finding findings = 1;
  833. // If true, then this item might have more findings than were returned,
  834. // and the findings returned are an arbitrary subset of all findings.
  835. // The findings list might be truncated because the input items were too
  836. // large, or because the server reached the maximum amount of resources
  837. // allowed for a single API call. For best results, divide the input into
  838. // smaller batches.
  839. bool findings_truncated = 2;
  840. }
  841. // Represents a piece of potentially sensitive content.
  842. message Finding {
  843. option (google.api.resource) = {
  844. type: "dlp.googleapis.com/Finding"
  845. pattern: "projects/{project}/locations/{location}/findings/{finding}"
  846. };
  847. // Resource name in format
  848. // projects/{project}/locations/{location}/findings/{finding} Populated only
  849. // when viewing persisted findings.
  850. string name = 14;
  851. // The content that was found. Even if the content is not textual, it
  852. // may be converted to a textual representation here.
  853. // Provided if `include_quote` is true and the finding is
  854. // less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes
  855. // in length, the quote may be omitted.
  856. string quote = 1;
  857. // The type of content that might have been found.
  858. // Provided if `excluded_types` is false.
  859. InfoType info_type = 2;
  860. // Confidence of how likely it is that the `info_type` is correct.
  861. Likelihood likelihood = 3;
  862. // Where the content was found.
  863. Location location = 4;
  864. // Timestamp when finding was detected.
  865. google.protobuf.Timestamp create_time = 6;
  866. // Contains data parsed from quotes. Only populated if include_quote was set
  867. // to true and a supported infoType was requested. Currently supported
  868. // infoTypes: DATE, DATE_OF_BIRTH and TIME.
  869. QuoteInfo quote_info = 7;
  870. // The job that stored the finding.
  871. string resource_name = 8 [(google.api.resource_reference) = {
  872. type: "dlp.googleapis.com/DlpJob"
  873. }];
  874. // Job trigger name, if applicable, for this finding.
  875. string trigger_name = 9 [(google.api.resource_reference) = {
  876. type: "dlp.googleapis.com/JobTrigger"
  877. }];
  878. // The labels associated with this `Finding`.
  879. //
  880. // Label keys must be between 1 and 63 characters long and must conform
  881. // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
  882. //
  883. // Label values must be between 0 and 63 characters long and must conform
  884. // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
  885. //
  886. // No more than 10 labels can be associated with a given finding.
  887. //
  888. // Examples:
  889. // * `"environment" : "production"`
  890. // * `"pipeline" : "etl"`
  891. map<string, string> labels = 10;
  892. // Time the job started that produced this finding.
  893. google.protobuf.Timestamp job_create_time = 11;
  894. // The job that stored the finding.
  895. string job_name = 13 [(google.api.resource_reference) = {
  896. type: "dlp.googleapis.com/DlpJob"
  897. }];
  898. // The unique finding id.
  899. string finding_id = 15;
  900. }
  901. // Specifies the location of the finding.
  902. message Location {
  903. // Zero-based byte offsets delimiting the finding.
  904. // These are relative to the finding's containing element.
  905. // Note that when the content is not textual, this references
  906. // the UTF-8 encoded textual representation of the content.
  907. // Omitted if content is an image.
  908. Range byte_range = 1;
  909. // Unicode character offsets delimiting the finding.
  910. // These are relative to the finding's containing element.
  911. // Provided when the content is text.
  912. Range codepoint_range = 2;
  913. // List of nested objects pointing to the precise location of the finding
  914. // within the file or record.
  915. repeated ContentLocation content_locations = 7;
  916. // Information about the container where this finding occurred, if available.
  917. Container container = 8;
  918. }
  919. // Precise location of the finding within a document, record, image, or metadata
  920. // container.
  921. message ContentLocation {
  922. // Name of the container where the finding is located.
  923. // The top level name is the source file name or table name. Names of some
  924. // common storage containers are formatted as follows:
  925. //
  926. // * BigQuery tables: `{project_id}:{dataset_id}.{table_id}`
  927. // * Cloud Storage files: `gs://{bucket}/{path}`
  928. // * Datastore namespace: {namespace}
  929. //
  930. // Nested names could be absent if the embedded object has no string
  931. // identifier (for example, an image contained within a document).
  932. string container_name = 1;
  933. // Type of the container within the file with location of the finding.
  934. oneof location {
  935. // Location within a row or record of a database table.
  936. RecordLocation record_location = 2;
  937. // Location within an image's pixels.
  938. ImageLocation image_location = 3;
  939. // Location data for document files.
  940. DocumentLocation document_location = 5;
  941. // Location within the metadata for inspected content.
  942. MetadataLocation metadata_location = 8;
  943. }
  944. // Finding container modification timestamp, if applicable. For Cloud Storage,
  945. // this field contains the last file modification timestamp. For a BigQuery
  946. // table, this field contains the last_modified_time property. For Datastore,
  947. // this field isn't populated.
  948. google.protobuf.Timestamp container_timestamp = 6;
  949. // Finding container version, if available
  950. // ("generation" for Cloud Storage).
  951. string container_version = 7;
  952. }
  953. // Metadata Location
  954. message MetadataLocation {
  955. // Type of metadata containing the finding.
  956. MetadataType type = 1;
  957. // Label of the piece of metadata containing the finding, for example -
  958. // latitude, author, caption.
  959. oneof label {
  960. // Storage metadata.
  961. StorageMetadataLabel storage_label = 3;
  962. }
  963. }
  964. // Storage metadata label to indicate which metadata entry contains findings.
  965. message StorageMetadataLabel {
  966. string key = 1;
  967. }
  968. // Location of a finding within a document.
  969. message DocumentLocation {
  970. // Offset of the line, from the beginning of the file, where the finding
  971. // is located.
  972. int64 file_offset = 1;
  973. }
  974. // Location of a finding within a row or record.
  975. message RecordLocation {
  976. // Key of the finding.
  977. RecordKey record_key = 1;
  978. // Field id of the field containing the finding.
  979. FieldId field_id = 2;
  980. // Location within a `ContentItem.Table`.
  981. TableLocation table_location = 3;
  982. }
  983. // Location of a finding within a table.
  984. message TableLocation {
  985. // The zero-based index of the row where the finding is located. Only
  986. // populated for resources that have a natural ordering, not BigQuery. In
  987. // BigQuery, to identify the row a finding came from, populate
  988. // BigQueryOptions.identifying_fields with your primary key column names and
  989. // when you store the findings the value of those columns will be stored
  990. // inside of Finding.
  991. int64 row_index = 1;
  992. }
  993. // Represents a container that may contain DLP findings.
  994. // Examples of a container include a file, table, or database record.
  995. message Container {
  996. // Container type, for example BigQuery or Cloud Storage.
  997. string type = 1;
  998. // Project where the finding was found.
  999. // Can be different from the project that owns the finding.
  1000. string project_id = 2;
  1001. // A string representation of the full container name.
  1002. // Examples:
  1003. // - BigQuery: 'Project:DataSetId.TableId'
  1004. // - Cloud Storage: 'gs://Bucket/folders/filename.txt'
  1005. string full_path = 3;
  1006. // The root of the container.
  1007. // Examples:
  1008. //
  1009. // - For BigQuery table `project_id:dataset_id.table_id`, the root is
  1010. // `dataset_id`
  1011. // - For Cloud Storage file `gs://bucket/folder/filename.txt`, the root
  1012. // is `gs://bucket`
  1013. string root_path = 4;
  1014. // The rest of the path after the root.
  1015. // Examples:
  1016. //
  1017. // - For BigQuery table `project_id:dataset_id.table_id`, the relative path is
  1018. // `table_id`
  1019. // - For Cloud Storage file `gs://bucket/folder/filename.txt`, the relative
  1020. // path is `folder/filename.txt`
  1021. string relative_path = 5;
  1022. // Findings container modification timestamp, if applicable. For Cloud
  1023. // Storage, this field contains the last file modification timestamp. For a
  1024. // BigQuery table, this field contains the last_modified_time property. For
  1025. // Datastore, this field isn't populated.
  1026. google.protobuf.Timestamp update_time = 6;
  1027. // Findings container version, if available
  1028. // ("generation" for Cloud Storage).
  1029. string version = 7;
  1030. }
  1031. // Generic half-open interval [start, end)
  1032. message Range {
  1033. // Index of the first character of the range (inclusive).
  1034. int64 start = 1;
  1035. // Index of the last character of the range (exclusive).
  1036. int64 end = 2;
  1037. }
  1038. // Location of the finding within an image.
  1039. message ImageLocation {
  1040. // Bounding boxes locating the pixels within the image containing the finding.
  1041. repeated BoundingBox bounding_boxes = 1;
  1042. }
  1043. // Bounding box encompassing detected text within an image.
  1044. message BoundingBox {
  1045. // Top coordinate of the bounding box. (0,0) is upper left.
  1046. int32 top = 1;
  1047. // Left coordinate of the bounding box. (0,0) is upper left.
  1048. int32 left = 2;
  1049. // Width of the bounding box in pixels.
  1050. int32 width = 3;
  1051. // Height of the bounding box in pixels.
  1052. int32 height = 4;
  1053. }
  1054. // Request to search for potentially sensitive info in an image and redact it
  1055. // by covering it with a colored rectangle.
  1056. message RedactImageRequest {
  1057. // Configuration for determining how redaction of images should occur.
  1058. message ImageRedactionConfig {
  1059. // Type of information to redact from images.
  1060. oneof target {
  1061. // Only one per info_type should be provided per request. If not
  1062. // specified, and redact_all_text is false, the DLP API will redact all
  1063. // text that it matches against all info_types that are found, but not
  1064. // specified in another ImageRedactionConfig.
  1065. InfoType info_type = 1;
  1066. // If true, all text found in the image, regardless whether it matches an
  1067. // info_type, is redacted. Only one should be provided.
  1068. bool redact_all_text = 2;
  1069. }
  1070. // The color to use when redacting content from an image. If not specified,
  1071. // the default is black.
  1072. Color redaction_color = 3;
  1073. }
  1074. // Parent resource name.
  1075. //
  1076. // The format of this value varies depending on whether you have [specified a
  1077. // processing
  1078. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1079. //
  1080. // + Projects scope, location specified:<br/>
  1081. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1082. // + Projects scope, no location specified (defaults to global):<br/>
  1083. // `projects/`<var>PROJECT_ID</var>
  1084. //
  1085. // The following example `parent` string specifies a parent project with the
  1086. // identifier `example-project`, and specifies the `europe-west3` location
  1087. // for processing data:
  1088. //
  1089. // parent=projects/example-project/locations/europe-west3
  1090. string parent = 1 [(google.api.resource_reference) = {
  1091. child_type: "dlp.googleapis.com/DlpContent"
  1092. }];
  1093. // Deprecated. This field has no effect.
  1094. string location_id = 8;
  1095. // Configuration for the inspector.
  1096. InspectConfig inspect_config = 2;
  1097. // The configuration for specifying what content to redact from images.
  1098. repeated ImageRedactionConfig image_redaction_configs = 5;
  1099. // Whether the response should include findings along with the redacted
  1100. // image.
  1101. bool include_findings = 6;
  1102. // The content must be PNG, JPEG, SVG or BMP.
  1103. ByteContentItem byte_item = 7;
  1104. }
  1105. // Represents a color in the RGB color space.
  1106. message Color {
  1107. // The amount of red in the color as a value in the interval [0, 1].
  1108. float red = 1;
  1109. // The amount of green in the color as a value in the interval [0, 1].
  1110. float green = 2;
  1111. // The amount of blue in the color as a value in the interval [0, 1].
  1112. float blue = 3;
  1113. }
  1114. // Results of redacting an image.
  1115. message RedactImageResponse {
  1116. // The redacted image. The type will be the same as the original image.
  1117. bytes redacted_image = 1;
  1118. // If an image was being inspected and the InspectConfig's include_quote was
  1119. // set to true, then this field will include all text, if any, that was found
  1120. // in the image.
  1121. string extracted_text = 2;
  1122. // The findings. Populated when include_findings in the request is true.
  1123. InspectResult inspect_result = 3;
  1124. }
  1125. // Request to de-identify a ContentItem.
  1126. message DeidentifyContentRequest {
  1127. // Parent resource name.
  1128. //
  1129. // The format of this value varies depending on whether you have [specified a
  1130. // processing
  1131. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1132. //
  1133. // + Projects scope, location specified:<br/>
  1134. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1135. // + Projects scope, no location specified (defaults to global):<br/>
  1136. // `projects/`<var>PROJECT_ID</var>
  1137. //
  1138. // The following example `parent` string specifies a parent project with the
  1139. // identifier `example-project`, and specifies the `europe-west3` location
  1140. // for processing data:
  1141. //
  1142. // parent=projects/example-project/locations/europe-west3
  1143. string parent = 1 [(google.api.resource_reference) = {
  1144. child_type: "dlp.googleapis.com/DlpContent"
  1145. }];
  1146. // Configuration for the de-identification of the content item.
  1147. // Items specified here will override the template referenced by the
  1148. // deidentify_template_name argument.
  1149. DeidentifyConfig deidentify_config = 2;
  1150. // Configuration for the inspector.
  1151. // Items specified here will override the template referenced by the
  1152. // inspect_template_name argument.
  1153. InspectConfig inspect_config = 3;
  1154. // The item to de-identify. Will be treated as text.
  1155. //
  1156. // This value must be of type
  1157. // [Table][google.privacy.dlp.v2.Table] if your
  1158. // [deidentify_config][google.privacy.dlp.v2.DeidentifyContentRequest.deidentify_config]
  1159. // is a
  1160. // [RecordTransformations][google.privacy.dlp.v2.RecordTransformations]
  1161. // object.
  1162. ContentItem item = 4;
  1163. // Template to use. Any configuration directly specified in
  1164. // inspect_config will override those set in the template. Singular fields
  1165. // that are set in this request will replace their corresponding fields in the
  1166. // template. Repeated fields are appended. Singular sub-messages and groups
  1167. // are recursively merged.
  1168. string inspect_template_name = 5;
  1169. // Template to use. Any configuration directly specified in
  1170. // deidentify_config will override those set in the template. Singular fields
  1171. // that are set in this request will replace their corresponding fields in the
  1172. // template. Repeated fields are appended. Singular sub-messages and groups
  1173. // are recursively merged.
  1174. string deidentify_template_name = 6;
  1175. // Deprecated. This field has no effect.
  1176. string location_id = 7;
  1177. }
  1178. // Results of de-identifying a ContentItem.
  1179. message DeidentifyContentResponse {
  1180. // The de-identified item.
  1181. ContentItem item = 1;
  1182. // An overview of the changes that were made on the `item`.
  1183. TransformationOverview overview = 2;
  1184. }
  1185. // Request to re-identify an item.
  1186. message ReidentifyContentRequest {
  1187. // Required. Parent resource name.
  1188. //
  1189. // The format of this value varies depending on whether you have [specified a
  1190. // processing
  1191. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1192. //
  1193. // + Projects scope, location specified:<br/>
  1194. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1195. // + Projects scope, no location specified (defaults to global):<br/>
  1196. // `projects/`<var>PROJECT_ID</var>
  1197. //
  1198. // The following example `parent` string specifies a parent project with the
  1199. // identifier `example-project`, and specifies the `europe-west3` location
  1200. // for processing data:
  1201. //
  1202. // parent=projects/example-project/locations/europe-west3
  1203. string parent = 1 [
  1204. (google.api.field_behavior) = REQUIRED,
  1205. (google.api.resource_reference) = {
  1206. child_type: "dlp.googleapis.com/DlpContent"
  1207. }
  1208. ];
  1209. // Configuration for the re-identification of the content item.
  1210. // This field shares the same proto message type that is used for
  1211. // de-identification, however its usage here is for the reversal of the
  1212. // previous de-identification. Re-identification is performed by examining
  1213. // the transformations used to de-identify the items and executing the
  1214. // reverse. This requires that only reversible transformations
  1215. // be provided here. The reversible transformations are:
  1216. //
  1217. // - `CryptoDeterministicConfig`
  1218. // - `CryptoReplaceFfxFpeConfig`
  1219. DeidentifyConfig reidentify_config = 2;
  1220. // Configuration for the inspector.
  1221. InspectConfig inspect_config = 3;
  1222. // The item to re-identify. Will be treated as text.
  1223. ContentItem item = 4;
  1224. // Template to use. Any configuration directly specified in
  1225. // `inspect_config` will override those set in the template. Singular fields
  1226. // that are set in this request will replace their corresponding fields in the
  1227. // template. Repeated fields are appended. Singular sub-messages and groups
  1228. // are recursively merged.
  1229. string inspect_template_name = 5;
  1230. // Template to use. References an instance of `DeidentifyTemplate`.
  1231. // Any configuration directly specified in `reidentify_config` or
  1232. // `inspect_config` will override those set in the template. The
  1233. // `DeidentifyTemplate` used must include only reversible transformations.
  1234. // Singular fields that are set in this request will replace their
  1235. // corresponding fields in the template. Repeated fields are appended.
  1236. // Singular sub-messages and groups are recursively merged.
  1237. string reidentify_template_name = 6;
  1238. // Deprecated. This field has no effect.
  1239. string location_id = 7;
  1240. }
  1241. // Results of re-identifying an item.
  1242. message ReidentifyContentResponse {
  1243. // The re-identified item.
  1244. ContentItem item = 1;
  1245. // An overview of the changes that were made to the `item`.
  1246. TransformationOverview overview = 2;
  1247. }
  1248. // Request to search for potentially sensitive info in a ContentItem.
  1249. message InspectContentRequest {
  1250. // Parent resource name.
  1251. //
  1252. // The format of this value varies depending on whether you have [specified a
  1253. // processing
  1254. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1255. //
  1256. // + Projects scope, location specified:<br/>
  1257. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1258. // + Projects scope, no location specified (defaults to global):<br/>
  1259. // `projects/`<var>PROJECT_ID</var>
  1260. //
  1261. // The following example `parent` string specifies a parent project with the
  1262. // identifier `example-project`, and specifies the `europe-west3` location
  1263. // for processing data:
  1264. //
  1265. // parent=projects/example-project/locations/europe-west3
  1266. string parent = 1 [(google.api.resource_reference) = {
  1267. child_type: "dlp.googleapis.com/DlpContent"
  1268. }];
  1269. // Configuration for the inspector. What specified here will override
  1270. // the template referenced by the inspect_template_name argument.
  1271. InspectConfig inspect_config = 2;
  1272. // The item to inspect.
  1273. ContentItem item = 3;
  1274. // Template to use. Any configuration directly specified in
  1275. // inspect_config will override those set in the template. Singular fields
  1276. // that are set in this request will replace their corresponding fields in the
  1277. // template. Repeated fields are appended. Singular sub-messages and groups
  1278. // are recursively merged.
  1279. string inspect_template_name = 4;
  1280. // Deprecated. This field has no effect.
  1281. string location_id = 5;
  1282. }
  1283. // Results of inspecting an item.
  1284. message InspectContentResponse {
  1285. // The findings.
  1286. InspectResult result = 1;
  1287. }
  1288. // Cloud repository for storing output.
  1289. message OutputStorageConfig {
  1290. // Predefined schemas for storing findings.
  1291. // Only for use with external storage.
  1292. enum OutputSchema {
  1293. // Unused.
  1294. OUTPUT_SCHEMA_UNSPECIFIED = 0;
  1295. // Basic schema including only `info_type`, `quote`, `certainty`, and
  1296. // `timestamp`.
  1297. BASIC_COLUMNS = 1;
  1298. // Schema tailored to findings from scanning Cloud Storage.
  1299. GCS_COLUMNS = 2;
  1300. // Schema tailored to findings from scanning Google Datastore.
  1301. DATASTORE_COLUMNS = 3;
  1302. // Schema tailored to findings from scanning Google BigQuery.
  1303. BIG_QUERY_COLUMNS = 4;
  1304. // Schema containing all columns.
  1305. ALL_COLUMNS = 5;
  1306. }
  1307. // Output storage types.
  1308. oneof type {
  1309. // Store findings in an existing table or a new table in an existing
  1310. // dataset. If table_id is not set a new one will be generated
  1311. // for you with the following format:
  1312. // dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific time zone will be used
  1313. // for generating the date details.
  1314. //
  1315. // For Inspect, each column in an existing output table must have the same
  1316. // name, type, and mode of a field in the `Finding` object.
  1317. //
  1318. // For Risk, an existing output table should be the output of a previous
  1319. // Risk analysis job run on the same source table, with the same privacy
  1320. // metric and quasi-identifiers. Risk jobs that analyze the same table but
  1321. // compute a different privacy metric, or use different sets of
  1322. // quasi-identifiers, cannot store their results in the same table.
  1323. BigQueryTable table = 1;
  1324. }
  1325. // Schema used for writing the findings for Inspect jobs. This field is only
  1326. // used for Inspect and must be unspecified for Risk jobs. Columns are derived
  1327. // from the `Finding` object. If appending to an existing table, any columns
  1328. // from the predefined schema that are missing will be added. No columns in
  1329. // the existing table will be deleted.
  1330. //
  1331. // If unspecified, then all available columns will be used for a new table or
  1332. // an (existing) table with no schema, and no changes will be made to an
  1333. // existing table that has a schema.
  1334. // Only for use with external storage.
  1335. OutputSchema output_schema = 3;
  1336. }
  1337. // Statistics regarding a specific InfoType.
  1338. message InfoTypeStats {
  1339. // The type of finding this stat is for.
  1340. InfoType info_type = 1;
  1341. // Number of findings for this infoType.
  1342. int64 count = 2;
  1343. }
  1344. // The results of an inspect DataSource job.
  1345. message InspectDataSourceDetails {
  1346. // Snapshot of the inspection configuration.
  1347. message RequestedOptions {
  1348. // If run with an InspectTemplate, a snapshot of its state at the time of
  1349. // this run.
  1350. InspectTemplate snapshot_inspect_template = 1;
  1351. // Inspect config.
  1352. InspectJobConfig job_config = 3;
  1353. }
  1354. // All result fields mentioned below are updated while the job is processing.
  1355. message Result {
  1356. // Total size in bytes that were processed.
  1357. int64 processed_bytes = 1;
  1358. // Estimate of the number of bytes to process.
  1359. int64 total_estimated_bytes = 2;
  1360. // Statistics of how many instances of each info type were found during
  1361. // inspect job.
  1362. repeated InfoTypeStats info_type_stats = 3;
  1363. // Statistics related to the processing of hybrid inspect.
  1364. HybridInspectStatistics hybrid_stats = 7;
  1365. }
  1366. // The configuration used for this job.
  1367. RequestedOptions requested_options = 2;
  1368. // A summary of the outcome of this inspection job.
  1369. Result result = 3;
  1370. }
  1371. // Statistics related to processing hybrid inspect requests.
  1372. message HybridInspectStatistics {
  1373. // The number of hybrid inspection requests processed within this job.
  1374. int64 processed_count = 1;
  1375. // The number of hybrid inspection requests aborted because the job ran
  1376. // out of quota or was ended before they could be processed.
  1377. int64 aborted_count = 2;
  1378. // The number of hybrid requests currently being processed. Only populated
  1379. // when called via method `getDlpJob`.
  1380. // A burst of traffic may cause hybrid inspect requests to be enqueued.
  1381. // Processing will take place as quickly as possible, but resource limitations
  1382. // may impact how long a request is enqueued for.
  1383. int64 pending_count = 3;
  1384. }
  1385. // InfoType description.
  1386. message InfoTypeDescription {
  1387. // Internal name of the infoType.
  1388. string name = 1;
  1389. // Human readable form of the infoType name.
  1390. string display_name = 2;
  1391. // Which parts of the API supports this InfoType.
  1392. repeated InfoTypeSupportedBy supported_by = 3;
  1393. // Description of the infotype. Translated when language is provided in the
  1394. // request.
  1395. string description = 4;
  1396. // A list of available versions for the infotype.
  1397. repeated VersionDescription versions = 9;
  1398. // The category of the infoType.
  1399. repeated InfoTypeCategory categories = 10;
  1400. }
  1401. // Classification of infoTypes to organize them according to geographic
  1402. // location, industry, and data type.
  1403. message InfoTypeCategory {
  1404. // Enum of the current locations.
  1405. // We might add more locations in the future.
  1406. enum LocationCategory {
  1407. // Unused location
  1408. LOCATION_UNSPECIFIED = 0;
  1409. // The infoType is not issued by or tied to a specific region, but is used
  1410. // almost everywhere.
  1411. GLOBAL = 1;
  1412. // The infoType is typically used in Argentina.
  1413. ARGENTINA = 2;
  1414. // The infoType is typically used in Australia.
  1415. AUSTRALIA = 3;
  1416. // The infoType is typically used in Belgium.
  1417. BELGIUM = 4;
  1418. // The infoType is typically used in Brazil.
  1419. BRAZIL = 5;
  1420. // The infoType is typically used in Canada.
  1421. CANADA = 6;
  1422. // The infoType is typically used in Chile.
  1423. CHILE = 7;
  1424. // The infoType is typically used in China.
  1425. CHINA = 8;
  1426. // The infoType is typically used in Colombia.
  1427. COLOMBIA = 9;
  1428. // The infoType is typically used in Denmark.
  1429. DENMARK = 10;
  1430. // The infoType is typically used in France.
  1431. FRANCE = 11;
  1432. // The infoType is typically used in Finland.
  1433. FINLAND = 12;
  1434. // The infoType is typically used in Germany.
  1435. GERMANY = 13;
  1436. // The infoType is typically used in Hong Kong.
  1437. HONG_KONG = 14;
  1438. // The infoType is typically used in India.
  1439. INDIA = 15;
  1440. // The infoType is typically used in Indonesia.
  1441. INDONESIA = 16;
  1442. // The infoType is typically used in Ireland.
  1443. IRELAND = 17;
  1444. // The infoType is typically used in Israel.
  1445. ISRAEL = 18;
  1446. // The infoType is typically used in Italy.
  1447. ITALY = 19;
  1448. // The infoType is typically used in Japan.
  1449. JAPAN = 20;
  1450. // The infoType is typically used in Korea.
  1451. KOREA = 21;
  1452. // The infoType is typically used in Mexico.
  1453. MEXICO = 22;
  1454. // The infoType is typically used in the Netherlands.
  1455. THE_NETHERLANDS = 23;
  1456. // The infoType is typically used in Norway.
  1457. NORWAY = 24;
  1458. // The infoType is typically used in Paraguay.
  1459. PARAGUAY = 25;
  1460. // The infoType is typically used in Peru.
  1461. PERU = 26;
  1462. // The infoType is typically used in Poland.
  1463. POLAND = 27;
  1464. // The infoType is typically used in Portugal.
  1465. PORTUGAL = 28;
  1466. // The infoType is typically used in Singapore.
  1467. SINGAPORE = 29;
  1468. // The infoType is typically used in South Africa.
  1469. SOUTH_AFRICA = 30;
  1470. // The infoType is typically used in Spain.
  1471. SPAIN = 31;
  1472. // The infoType is typically used in Sweden.
  1473. SWEDEN = 32;
  1474. // The infoType is typically used in Taiwan.
  1475. TAIWAN = 33;
  1476. // The infoType is typically used in Thailand.
  1477. THAILAND = 34;
  1478. // The infoType is typically used in Turkey.
  1479. TURKEY = 35;
  1480. // The infoType is typically used in the United Kingdom.
  1481. UNITED_KINGDOM = 36;
  1482. // The infoType is typically used in the United States.
  1483. UNITED_STATES = 37;
  1484. // The infoType is typically used in Uruguay.
  1485. URUGUAY = 38;
  1486. // The infoType is typically used in Venezuela.
  1487. VENEZUELA = 39;
  1488. // The infoType is typically used in Google internally.
  1489. INTERNAL = 40;
  1490. // The infoType is typically used in New Zealand.
  1491. NEW_ZEALAND = 41;
  1492. }
  1493. // Enum of the current industries in the category.
  1494. // We might add more industries in the future.
  1495. enum IndustryCategory {
  1496. // Unused industry
  1497. INDUSTRY_UNSPECIFIED = 0;
  1498. // The infoType is typically used in the finance industry.
  1499. FINANCE = 1;
  1500. // The infoType is typically used in the health industry.
  1501. HEALTH = 2;
  1502. // The infoType is typically used in the telecommunications industry.
  1503. TELECOMMUNICATIONS = 3;
  1504. }
  1505. // Enum of the current types in the category.
  1506. // We might add more types in the future.
  1507. enum TypeCategory {
  1508. // Unused type
  1509. TYPE_UNSPECIFIED = 0;
  1510. // Personally identifiable information, for example, a
  1511. // name or phone number
  1512. PII = 1;
  1513. // Personally identifiable information that is especially sensitive, for
  1514. // example, a passport number.
  1515. SPII = 2;
  1516. // Attributes that can partially identify someone, especially in
  1517. // combination with other attributes, like age, height, and gender.
  1518. DEMOGRAPHIC = 3;
  1519. // Confidential or secret information, for example, a password.
  1520. CREDENTIAL = 4;
  1521. // An identification document issued by a government.
  1522. GOVERNMENT_ID = 5;
  1523. // A document, for example, a resume or source code.
  1524. DOCUMENT = 6;
  1525. // Information that is not sensitive on its own, but provides details about
  1526. // the circumstances surrounding an entity or an event.
  1527. CONTEXTUAL_INFORMATION = 7;
  1528. }
  1529. oneof category {
  1530. // The region or country that issued the ID or document represented by the
  1531. // infoType.
  1532. LocationCategory location_category = 1;
  1533. // The group of relevant businesses where this infoType is commonly used
  1534. IndustryCategory industry_category = 2;
  1535. // The class of identifiers where this infoType belongs
  1536. TypeCategory type_category = 3;
  1537. }
  1538. }
  1539. // Details about each available version for an infotype.
  1540. message VersionDescription {
  1541. // Name of the version
  1542. string version = 1;
  1543. // Description of the version.
  1544. string description = 2;
  1545. }
  1546. // Request for the list of infoTypes.
  1547. message ListInfoTypesRequest {
  1548. // The parent resource name.
  1549. //
  1550. // The format of this value is as follows:
  1551. //
  1552. // locations/<var>LOCATION_ID</var>
  1553. string parent = 4;
  1554. // BCP-47 language code for localized infoType friendly
  1555. // names. If omitted, or if localized strings are not available,
  1556. // en-US strings will be returned.
  1557. string language_code = 1;
  1558. // filter to only return infoTypes supported by certain parts of the
  1559. // API. Defaults to supported_by=INSPECT.
  1560. string filter = 2;
  1561. // Deprecated. This field has no effect.
  1562. string location_id = 3;
  1563. }
  1564. // Response to the ListInfoTypes request.
  1565. message ListInfoTypesResponse {
  1566. // Set of sensitive infoTypes.
  1567. repeated InfoTypeDescription info_types = 1;
  1568. }
  1569. // Configuration for a risk analysis job. See
  1570. // https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more.
  1571. message RiskAnalysisJobConfig {
  1572. // Privacy metric to compute.
  1573. PrivacyMetric privacy_metric = 1;
  1574. // Input dataset to compute metrics over.
  1575. BigQueryTable source_table = 2;
  1576. // Actions to execute at the completion of the job. Are executed in the order
  1577. // provided.
  1578. repeated Action actions = 3;
  1579. }
  1580. // A column with a semantic tag attached.
  1581. message QuasiId {
  1582. // Required. Identifies the column.
  1583. FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  1584. // Semantic tag that identifies what a column contains, to determine which
  1585. // statistical model to use to estimate the reidentifiability of each
  1586. // value. [required]
  1587. oneof tag {
  1588. // A column can be tagged with a InfoType to use the relevant public
  1589. // dataset as a statistical model of population, if available. We
  1590. // currently support US ZIP codes, region codes, ages and genders.
  1591. // To programmatically obtain the list of supported InfoTypes, use
  1592. // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  1593. InfoType info_type = 2;
  1594. // A column can be tagged with a custom tag. In this case, the user must
  1595. // indicate an auxiliary table that contains statistical information on
  1596. // the possible values of this column (below).
  1597. string custom_tag = 3;
  1598. // If no semantic tag is indicated, we infer the statistical model from
  1599. // the distribution of values in the input data
  1600. google.protobuf.Empty inferred = 4;
  1601. }
  1602. }
  1603. // An auxiliary table containing statistical information on the relative
  1604. // frequency of different quasi-identifiers values. It has one or several
  1605. // quasi-identifiers columns, and one column that indicates the relative
  1606. // frequency of each quasi-identifier tuple.
  1607. // If a tuple is present in the data but not in the auxiliary table, the
  1608. // corresponding relative frequency is assumed to be zero (and thus, the
  1609. // tuple is highly reidentifiable).
  1610. message StatisticalTable {
  1611. // A quasi-identifier column has a custom_tag, used to know which column
  1612. // in the data corresponds to which column in the statistical model.
  1613. message QuasiIdentifierField {
  1614. // Identifies the column.
  1615. FieldId field = 1;
  1616. // A column can be tagged with a custom tag. In this case, the user must
  1617. // indicate an auxiliary table that contains statistical information on
  1618. // the possible values of this column (below).
  1619. string custom_tag = 2;
  1620. }
  1621. // Required. Auxiliary table location.
  1622. BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED];
  1623. // Required. Quasi-identifier columns.
  1624. repeated QuasiIdentifierField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1625. // Required. The relative frequency column must contain a floating-point number
  1626. // between 0 and 1 (inclusive). Null values are assumed to be zero.
  1627. FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED];
  1628. }
  1629. // Privacy metric to compute for reidentification risk analysis.
  1630. message PrivacyMetric {
  1631. // Compute numerical stats over an individual column, including
  1632. // min, max, and quantiles.
  1633. message NumericalStatsConfig {
  1634. // Field to compute numerical stats on. Supported types are
  1635. // integer, float, date, datetime, timestamp, time.
  1636. FieldId field = 1;
  1637. }
  1638. // Compute numerical stats over an individual column, including
  1639. // number of distinct values and value count distribution.
  1640. message CategoricalStatsConfig {
  1641. // Field to compute categorical stats on. All column types are
  1642. // supported except for arrays and structs. However, it may be more
  1643. // informative to use NumericalStats when the field type is supported,
  1644. // depending on the data.
  1645. FieldId field = 1;
  1646. }
  1647. // k-anonymity metric, used for analysis of reidentification risk.
  1648. message KAnonymityConfig {
  1649. // Set of fields to compute k-anonymity over. When multiple fields are
  1650. // specified, they are considered a single composite key. Structs and
  1651. // repeated data types are not supported; however, nested fields are
  1652. // supported so long as they are not structs themselves or nested within
  1653. // a repeated field.
  1654. repeated FieldId quasi_ids = 1;
  1655. // Message indicating that multiple rows might be associated to a
  1656. // single individual. If the same entity_id is associated to multiple
  1657. // quasi-identifier tuples over distinct rows, we consider the entire
  1658. // collection of tuples as the composite quasi-identifier. This collection
  1659. // is a multiset: the order in which the different tuples appear in the
  1660. // dataset is ignored, but their frequency is taken into account.
  1661. //
  1662. // Important note: a maximum of 1000 rows can be associated to a single
  1663. // entity ID. If more rows are associated with the same entity ID, some
  1664. // might be ignored.
  1665. EntityId entity_id = 2;
  1666. }
  1667. // l-diversity metric, used for analysis of reidentification risk.
  1668. message LDiversityConfig {
  1669. // Set of quasi-identifiers indicating how equivalence classes are
  1670. // defined for the l-diversity computation. When multiple fields are
  1671. // specified, they are considered a single composite key.
  1672. repeated FieldId quasi_ids = 1;
  1673. // Sensitive field for computing the l-value.
  1674. FieldId sensitive_attribute = 2;
  1675. }
  1676. // Reidentifiability metric. This corresponds to a risk model similar to what
  1677. // is called "journalist risk" in the literature, except the attack dataset is
  1678. // statistically modeled instead of being perfectly known. This can be done
  1679. // using publicly available data (like the US Census), or using a custom
  1680. // statistical model (indicated as one or several BigQuery tables), or by
  1681. // extrapolating from the distribution of values in the input dataset.
  1682. message KMapEstimationConfig {
  1683. // A column with a semantic tag attached.
  1684. message TaggedField {
  1685. // Required. Identifies the column.
  1686. FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  1687. // Semantic tag that identifies what a column contains, to determine which
  1688. // statistical model to use to estimate the reidentifiability of each
  1689. // value. [required]
  1690. oneof tag {
  1691. // A column can be tagged with a InfoType to use the relevant public
  1692. // dataset as a statistical model of population, if available. We
  1693. // currently support US ZIP codes, region codes, ages and genders.
  1694. // To programmatically obtain the list of supported InfoTypes, use
  1695. // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  1696. InfoType info_type = 2;
  1697. // A column can be tagged with a custom tag. In this case, the user must
  1698. // indicate an auxiliary table that contains statistical information on
  1699. // the possible values of this column (below).
  1700. string custom_tag = 3;
  1701. // If no semantic tag is indicated, we infer the statistical model from
  1702. // the distribution of values in the input data
  1703. google.protobuf.Empty inferred = 4;
  1704. }
  1705. }
  1706. // An auxiliary table contains statistical information on the relative
  1707. // frequency of different quasi-identifiers values. It has one or several
  1708. // quasi-identifiers columns, and one column that indicates the relative
  1709. // frequency of each quasi-identifier tuple.
  1710. // If a tuple is present in the data but not in the auxiliary table, the
  1711. // corresponding relative frequency is assumed to be zero (and thus, the
  1712. // tuple is highly reidentifiable).
  1713. message AuxiliaryTable {
  1714. // A quasi-identifier column has a custom_tag, used to know which column
  1715. // in the data corresponds to which column in the statistical model.
  1716. message QuasiIdField {
  1717. // Identifies the column.
  1718. FieldId field = 1;
  1719. // A auxiliary field.
  1720. string custom_tag = 2;
  1721. }
  1722. // Required. Auxiliary table location.
  1723. BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED];
  1724. // Required. Quasi-identifier columns.
  1725. repeated QuasiIdField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1726. // Required. The relative frequency column must contain a floating-point number
  1727. // between 0 and 1 (inclusive). Null values are assumed to be zero.
  1728. FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED];
  1729. }
  1730. // Required. Fields considered to be quasi-identifiers. No two columns can have the
  1731. // same tag.
  1732. repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1733. // ISO 3166-1 alpha-2 region code to use in the statistical modeling.
  1734. // Set if no column is tagged with a region-specific InfoType (like
  1735. // US_ZIP_5) or a region code.
  1736. string region_code = 2;
  1737. // Several auxiliary tables can be used in the analysis. Each custom_tag
  1738. // used to tag a quasi-identifiers column must appear in exactly one column
  1739. // of one auxiliary table.
  1740. repeated AuxiliaryTable auxiliary_tables = 3;
  1741. }
  1742. // δ-presence metric, used to estimate how likely it is for an attacker to
  1743. // figure out that one given individual appears in a de-identified dataset.
  1744. // Similarly to the k-map metric, we cannot compute δ-presence exactly without
  1745. // knowing the attack dataset, so we use a statistical model instead.
  1746. message DeltaPresenceEstimationConfig {
  1747. // Required. Fields considered to be quasi-identifiers. No two fields can have the
  1748. // same tag.
  1749. repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1750. // ISO 3166-1 alpha-2 region code to use in the statistical modeling.
  1751. // Set if no column is tagged with a region-specific InfoType (like
  1752. // US_ZIP_5) or a region code.
  1753. string region_code = 2;
  1754. // Several auxiliary tables can be used in the analysis. Each custom_tag
  1755. // used to tag a quasi-identifiers field must appear in exactly one
  1756. // field of one auxiliary table.
  1757. repeated StatisticalTable auxiliary_tables = 3;
  1758. }
  1759. // Types of analysis.
  1760. oneof type {
  1761. // Numerical stats
  1762. NumericalStatsConfig numerical_stats_config = 1;
  1763. // Categorical stats
  1764. CategoricalStatsConfig categorical_stats_config = 2;
  1765. // K-anonymity
  1766. KAnonymityConfig k_anonymity_config = 3;
  1767. // l-diversity
  1768. LDiversityConfig l_diversity_config = 4;
  1769. // k-map
  1770. KMapEstimationConfig k_map_estimation_config = 5;
  1771. // delta-presence
  1772. DeltaPresenceEstimationConfig delta_presence_estimation_config = 6;
  1773. }
  1774. }
  1775. // Result of a risk analysis operation request.
  1776. message AnalyzeDataSourceRiskDetails {
  1777. // Result of the numerical stats computation.
  1778. message NumericalStatsResult {
  1779. // Minimum value appearing in the column.
  1780. Value min_value = 1;
  1781. // Maximum value appearing in the column.
  1782. Value max_value = 2;
  1783. // List of 99 values that partition the set of field values into 100 equal
  1784. // sized buckets.
  1785. repeated Value quantile_values = 4;
  1786. }
  1787. // Result of the categorical stats computation.
  1788. message CategoricalStatsResult {
  1789. // Histogram of value frequencies in the column.
  1790. message CategoricalStatsHistogramBucket {
  1791. // Lower bound on the value frequency of the values in this bucket.
  1792. int64 value_frequency_lower_bound = 1;
  1793. // Upper bound on the value frequency of the values in this bucket.
  1794. int64 value_frequency_upper_bound = 2;
  1795. // Total number of values in this bucket.
  1796. int64 bucket_size = 3;
  1797. // Sample of value frequencies in this bucket. The total number of
  1798. // values returned per bucket is capped at 20.
  1799. repeated ValueFrequency bucket_values = 4;
  1800. // Total number of distinct values in this bucket.
  1801. int64 bucket_value_count = 5;
  1802. }
  1803. // Histogram of value frequencies in the column.
  1804. repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 5;
  1805. }
  1806. // Result of the k-anonymity computation.
  1807. message KAnonymityResult {
  1808. // The set of columns' values that share the same ldiversity value
  1809. message KAnonymityEquivalenceClass {
  1810. // Set of values defining the equivalence class. One value per
  1811. // quasi-identifier column in the original KAnonymity metric message.
  1812. // The order is always the same as the original request.
  1813. repeated Value quasi_ids_values = 1;
  1814. // Size of the equivalence class, for example number of rows with the
  1815. // above set of values.
  1816. int64 equivalence_class_size = 2;
  1817. }
  1818. // Histogram of k-anonymity equivalence classes.
  1819. message KAnonymityHistogramBucket {
  1820. // Lower bound on the size of the equivalence classes in this bucket.
  1821. int64 equivalence_class_size_lower_bound = 1;
  1822. // Upper bound on the size of the equivalence classes in this bucket.
  1823. int64 equivalence_class_size_upper_bound = 2;
  1824. // Total number of equivalence classes in this bucket.
  1825. int64 bucket_size = 3;
  1826. // Sample of equivalence classes in this bucket. The total number of
  1827. // classes returned per bucket is capped at 20.
  1828. repeated KAnonymityEquivalenceClass bucket_values = 4;
  1829. // Total number of distinct equivalence classes in this bucket.
  1830. int64 bucket_value_count = 5;
  1831. }
  1832. // Histogram of k-anonymity equivalence classes.
  1833. repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5;
  1834. }
  1835. // Result of the l-diversity computation.
  1836. message LDiversityResult {
  1837. // The set of columns' values that share the same ldiversity value.
  1838. message LDiversityEquivalenceClass {
  1839. // Quasi-identifier values defining the k-anonymity equivalence
  1840. // class. The order is always the same as the original request.
  1841. repeated Value quasi_ids_values = 1;
  1842. // Size of the k-anonymity equivalence class.
  1843. int64 equivalence_class_size = 2;
  1844. // Number of distinct sensitive values in this equivalence class.
  1845. int64 num_distinct_sensitive_values = 3;
  1846. // Estimated frequencies of top sensitive values.
  1847. repeated ValueFrequency top_sensitive_values = 4;
  1848. }
  1849. // Histogram of l-diversity equivalence class sensitive value frequencies.
  1850. message LDiversityHistogramBucket {
  1851. // Lower bound on the sensitive value frequencies of the equivalence
  1852. // classes in this bucket.
  1853. int64 sensitive_value_frequency_lower_bound = 1;
  1854. // Upper bound on the sensitive value frequencies of the equivalence
  1855. // classes in this bucket.
  1856. int64 sensitive_value_frequency_upper_bound = 2;
  1857. // Total number of equivalence classes in this bucket.
  1858. int64 bucket_size = 3;
  1859. // Sample of equivalence classes in this bucket. The total number of
  1860. // classes returned per bucket is capped at 20.
  1861. repeated LDiversityEquivalenceClass bucket_values = 4;
  1862. // Total number of distinct equivalence classes in this bucket.
  1863. int64 bucket_value_count = 5;
  1864. }
  1865. // Histogram of l-diversity equivalence class sensitive value frequencies.
  1866. repeated LDiversityHistogramBucket sensitive_value_frequency_histogram_buckets = 5;
  1867. }
  1868. // Result of the reidentifiability analysis. Note that these results are an
  1869. // estimation, not exact values.
  1870. message KMapEstimationResult {
  1871. // A tuple of values for the quasi-identifier columns.
  1872. message KMapEstimationQuasiIdValues {
  1873. // The quasi-identifier values.
  1874. repeated Value quasi_ids_values = 1;
  1875. // The estimated anonymity for these quasi-identifier values.
  1876. int64 estimated_anonymity = 2;
  1877. }
  1878. // A KMapEstimationHistogramBucket message with the following values:
  1879. // min_anonymity: 3
  1880. // max_anonymity: 5
  1881. // frequency: 42
  1882. // means that there are 42 records whose quasi-identifier values correspond
  1883. // to 3, 4 or 5 people in the overlying population. An important particular
  1884. // case is when min_anonymity = max_anonymity = 1: the frequency field then
  1885. // corresponds to the number of uniquely identifiable records.
  1886. message KMapEstimationHistogramBucket {
  1887. // Always positive.
  1888. int64 min_anonymity = 1;
  1889. // Always greater than or equal to min_anonymity.
  1890. int64 max_anonymity = 2;
  1891. // Number of records within these anonymity bounds.
  1892. int64 bucket_size = 5;
  1893. // Sample of quasi-identifier tuple values in this bucket. The total
  1894. // number of classes returned per bucket is capped at 20.
  1895. repeated KMapEstimationQuasiIdValues bucket_values = 6;
  1896. // Total number of distinct quasi-identifier tuple values in this bucket.
  1897. int64 bucket_value_count = 7;
  1898. }
  1899. // The intervals [min_anonymity, max_anonymity] do not overlap. If a value
  1900. // doesn't correspond to any such interval, the associated frequency is
  1901. // zero. For example, the following records:
  1902. // {min_anonymity: 1, max_anonymity: 1, frequency: 17}
  1903. // {min_anonymity: 2, max_anonymity: 3, frequency: 42}
  1904. // {min_anonymity: 5, max_anonymity: 10, frequency: 99}
  1905. // mean that there are no record with an estimated anonymity of 4, 5, or
  1906. // larger than 10.
  1907. repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1;
  1908. }
  1909. // Result of the δ-presence computation. Note that these results are an
  1910. // estimation, not exact values.
  1911. message DeltaPresenceEstimationResult {
  1912. // A tuple of values for the quasi-identifier columns.
  1913. message DeltaPresenceEstimationQuasiIdValues {
  1914. // The quasi-identifier values.
  1915. repeated Value quasi_ids_values = 1;
  1916. // The estimated probability that a given individual sharing these
  1917. // quasi-identifier values is in the dataset. This value, typically
  1918. // called δ, is the ratio between the number of records in the dataset
  1919. // with these quasi-identifier values, and the total number of individuals
  1920. // (inside *and* outside the dataset) with these quasi-identifier values.
  1921. // For example, if there are 15 individuals in the dataset who share the
  1922. // same quasi-identifier values, and an estimated 100 people in the entire
  1923. // population with these values, then δ is 0.15.
  1924. double estimated_probability = 2;
  1925. }
  1926. // A DeltaPresenceEstimationHistogramBucket message with the following
  1927. // values:
  1928. // min_probability: 0.1
  1929. // max_probability: 0.2
  1930. // frequency: 42
  1931. // means that there are 42 records for which δ is in [0.1, 0.2). An
  1932. // important particular case is when min_probability = max_probability = 1:
  1933. // then, every individual who shares this quasi-identifier combination is in
  1934. // the dataset.
  1935. message DeltaPresenceEstimationHistogramBucket {
  1936. // Between 0 and 1.
  1937. double min_probability = 1;
  1938. // Always greater than or equal to min_probability.
  1939. double max_probability = 2;
  1940. // Number of records within these probability bounds.
  1941. int64 bucket_size = 5;
  1942. // Sample of quasi-identifier tuple values in this bucket. The total
  1943. // number of classes returned per bucket is capped at 20.
  1944. repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6;
  1945. // Total number of distinct quasi-identifier tuple values in this bucket.
  1946. int64 bucket_value_count = 7;
  1947. }
  1948. // The intervals [min_probability, max_probability) do not overlap. If a
  1949. // value doesn't correspond to any such interval, the associated frequency
  1950. // is zero. For example, the following records:
  1951. // {min_probability: 0, max_probability: 0.1, frequency: 17}
  1952. // {min_probability: 0.2, max_probability: 0.3, frequency: 42}
  1953. // {min_probability: 0.3, max_probability: 0.4, frequency: 99}
  1954. // mean that there are no record with an estimated probability in [0.1, 0.2)
  1955. // nor larger or equal to 0.4.
  1956. repeated DeltaPresenceEstimationHistogramBucket delta_presence_estimation_histogram = 1;
  1957. }
  1958. // Risk analysis options.
  1959. message RequestedRiskAnalysisOptions {
  1960. // The job config for the risk job.
  1961. RiskAnalysisJobConfig job_config = 1;
  1962. }
  1963. // Privacy metric to compute.
  1964. PrivacyMetric requested_privacy_metric = 1;
  1965. // Input dataset to compute metrics over.
  1966. BigQueryTable requested_source_table = 2;
  1967. // Values associated with this metric.
  1968. oneof result {
  1969. // Numerical stats result
  1970. NumericalStatsResult numerical_stats_result = 3;
  1971. // Categorical stats result
  1972. CategoricalStatsResult categorical_stats_result = 4;
  1973. // K-anonymity result
  1974. KAnonymityResult k_anonymity_result = 5;
  1975. // L-divesity result
  1976. LDiversityResult l_diversity_result = 6;
  1977. // K-map result
  1978. KMapEstimationResult k_map_estimation_result = 7;
  1979. // Delta-presence result
  1980. DeltaPresenceEstimationResult delta_presence_estimation_result = 9;
  1981. }
  1982. // The configuration used for this job.
  1983. RequestedRiskAnalysisOptions requested_options = 10;
  1984. }
  1985. // A value of a field, including its frequency.
  1986. message ValueFrequency {
  1987. // A value contained in the field in question.
  1988. Value value = 1;
  1989. // How many times the value is contained in the field.
  1990. int64 count = 2;
  1991. }
  1992. // Set of primitive values supported by the system.
  1993. // Note that for the purposes of inspection or transformation, the number
  1994. // of bytes considered to comprise a 'Value' is based on its representation
  1995. // as a UTF-8 encoded string. For example, if 'integer_value' is set to
  1996. // 123456789, the number of bytes would be counted as 9, even though an
  1997. // int64 only holds up to 8 bytes of data.
  1998. message Value {
  1999. // Value types
  2000. oneof type {
  2001. // integer
  2002. int64 integer_value = 1;
  2003. // float
  2004. double float_value = 2;
  2005. // string
  2006. string string_value = 3;
  2007. // boolean
  2008. bool boolean_value = 4;
  2009. // timestamp
  2010. google.protobuf.Timestamp timestamp_value = 5;
  2011. // time of day
  2012. google.type.TimeOfDay time_value = 6;
  2013. // date
  2014. google.type.Date date_value = 7;
  2015. // day of week
  2016. google.type.DayOfWeek day_of_week_value = 8;
  2017. }
  2018. }
  2019. // Message for infoType-dependent details parsed from quote.
  2020. message QuoteInfo {
  2021. // Object representation of the quote.
  2022. oneof parsed_quote {
  2023. // The date time indicated by the quote.
  2024. DateTime date_time = 2;
  2025. }
  2026. }
  2027. // Message for a date time object.
  2028. // e.g. 2018-01-01, 5th August.
  2029. message DateTime {
  2030. // Time zone of the date time object.
  2031. message TimeZone {
  2032. // Set only if the offset can be determined. Positive for time ahead of UTC.
  2033. // E.g. For "UTC-9", this value is -540.
  2034. int32 offset_minutes = 1;
  2035. }
  2036. // One or more of the following must be set.
  2037. // Must be a valid date or time value.
  2038. google.type.Date date = 1;
  2039. // Day of week
  2040. google.type.DayOfWeek day_of_week = 2;
  2041. // Time of day
  2042. google.type.TimeOfDay time = 3;
  2043. // Time zone
  2044. TimeZone time_zone = 4;
  2045. }
  2046. // The configuration that controls how the data will change.
  2047. message DeidentifyConfig {
  2048. oneof transformation {
  2049. // Treat the dataset as free-form text and apply the same free text
  2050. // transformation everywhere.
  2051. InfoTypeTransformations info_type_transformations = 1;
  2052. // Treat the dataset as structured. Transformations can be applied to
  2053. // specific locations within structured datasets, such as transforming
  2054. // a column within a table.
  2055. RecordTransformations record_transformations = 2;
  2056. // Treat the dataset as an image and redact.
  2057. ImageTransformations image_transformations = 4;
  2058. }
  2059. // Mode for handling transformation errors. If left unspecified, the default
  2060. // mode is `TransformationErrorHandling.ThrowError`.
  2061. TransformationErrorHandling transformation_error_handling = 3;
  2062. }
  2063. // A type of transformation that is applied over images.
  2064. message ImageTransformations {
  2065. // Configuration for determining how redaction of images should occur.
  2066. message ImageTransformation {
  2067. // Apply transformation to the selected info_types.
  2068. message SelectedInfoTypes {
  2069. // Required. InfoTypes to apply the transformation to. Required. Provided InfoType
  2070. // must be unique within the ImageTransformations message.
  2071. repeated InfoType info_types = 5 [(google.api.field_behavior) = REQUIRED];
  2072. }
  2073. // Apply transformation to all findings.
  2074. message AllInfoTypes {
  2075. }
  2076. // Apply to all text.
  2077. message AllText {
  2078. }
  2079. oneof target {
  2080. // Apply transformation to the selected info_types.
  2081. SelectedInfoTypes selected_info_types = 4;
  2082. // Apply transformation to all findings not specified in other
  2083. // ImageTransformation's selected_info_types. Only one instance is allowed
  2084. // within the ImageTransformations message.
  2085. AllInfoTypes all_info_types = 5;
  2086. // Apply transformation to all text that doesn't match an infoType. Only
  2087. // one instance is allowed within the ImageTransformations message.
  2088. AllText all_text = 6;
  2089. }
  2090. // The color to use when redacting content from an image. If not
  2091. // specified, the default is black.
  2092. Color redaction_color = 3;
  2093. }
  2094. repeated ImageTransformation transforms = 2;
  2095. }
  2096. // How to handle transformation errors during de-identification. A
  2097. // transformation error occurs when the requested transformation is incompatible
  2098. // with the data. For example, trying to de-identify an IP address using a
  2099. // `DateShift` transformation would result in a transformation error, since date
  2100. // info cannot be extracted from an IP address.
  2101. // Information about any incompatible transformations, and how they were
  2102. // handled, is returned in the response as part of the
  2103. // `TransformationOverviews`.
  2104. message TransformationErrorHandling {
  2105. // Throw an error and fail the request when a transformation error occurs.
  2106. message ThrowError {
  2107. }
  2108. // Skips the data without modifying it if the requested transformation would
  2109. // cause an error. For example, if a `DateShift` transformation were applied
  2110. // an an IP address, this mode would leave the IP address unchanged in the
  2111. // response.
  2112. message LeaveUntransformed {
  2113. }
  2114. // How transformation errors should be handled.
  2115. oneof mode {
  2116. // Throw an error
  2117. ThrowError throw_error = 1;
  2118. // Ignore errors
  2119. LeaveUntransformed leave_untransformed = 2;
  2120. }
  2121. }
  2122. // A rule for transforming a value.
  2123. message PrimitiveTransformation {
  2124. oneof transformation {
  2125. // Replace with a specified value.
  2126. ReplaceValueConfig replace_config = 1;
  2127. // Redact
  2128. RedactConfig redact_config = 2;
  2129. // Mask
  2130. CharacterMaskConfig character_mask_config = 3;
  2131. // Ffx-Fpe
  2132. CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4;
  2133. // Fixed size bucketing
  2134. FixedSizeBucketingConfig fixed_size_bucketing_config = 5;
  2135. // Bucketing
  2136. BucketingConfig bucketing_config = 6;
  2137. // Replace with infotype
  2138. ReplaceWithInfoTypeConfig replace_with_info_type_config = 7;
  2139. // Time extraction
  2140. TimePartConfig time_part_config = 8;
  2141. // Crypto
  2142. CryptoHashConfig crypto_hash_config = 9;
  2143. // Date Shift
  2144. DateShiftConfig date_shift_config = 11;
  2145. // Deterministic Crypto
  2146. CryptoDeterministicConfig crypto_deterministic_config = 12;
  2147. // Replace with a value randomly drawn (with replacement) from a dictionary.
  2148. ReplaceDictionaryConfig replace_dictionary_config = 13;
  2149. }
  2150. }
  2151. // For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a
  2152. // portion of the value.
  2153. message TimePartConfig {
  2154. // Components that make up time.
  2155. enum TimePart {
  2156. // Unused
  2157. TIME_PART_UNSPECIFIED = 0;
  2158. // [0-9999]
  2159. YEAR = 1;
  2160. // [1-12]
  2161. MONTH = 2;
  2162. // [1-31]
  2163. DAY_OF_MONTH = 3;
  2164. // [1-7]
  2165. DAY_OF_WEEK = 4;
  2166. // [1-53]
  2167. WEEK_OF_YEAR = 5;
  2168. // [0-23]
  2169. HOUR_OF_DAY = 6;
  2170. }
  2171. // The part of the time to keep.
  2172. TimePart part_to_extract = 1;
  2173. }
  2174. // Pseudonymization method that generates surrogates via cryptographic hashing.
  2175. // Uses SHA-256.
  2176. // The key size must be either 32 or 64 bytes.
  2177. // Outputs a base64 encoded representation of the hashed output
  2178. // (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=).
  2179. // Currently, only string and integer values can be hashed.
  2180. // See https://cloud.google.com/dlp/docs/pseudonymization to learn more.
  2181. message CryptoHashConfig {
  2182. // The key used by the hash function.
  2183. CryptoKey crypto_key = 1;
  2184. }
  2185. // Pseudonymization method that generates deterministic encryption for the given
  2186. // input. Outputs a base64 encoded representation of the encrypted output.
  2187. // Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
  2188. message CryptoDeterministicConfig {
  2189. // The key used by the encryption function. For deterministic encryption
  2190. // using AES-SIV, the provided key is internally expanded to 64 bytes prior to
  2191. // use.
  2192. CryptoKey crypto_key = 1;
  2193. // The custom info type to annotate the surrogate with.
  2194. // This annotation will be applied to the surrogate by prefixing it with
  2195. // the name of the custom info type followed by the number of
  2196. // characters comprising the surrogate. The following scheme defines the
  2197. // format: {info type name}({surrogate character count}):{surrogate}
  2198. //
  2199. // For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
  2200. // the surrogate is 'abc', the full replacement value
  2201. // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  2202. //
  2203. // This annotation identifies the surrogate when inspecting content using the
  2204. // custom info type 'Surrogate'. This facilitates reversal of the
  2205. // surrogate when it occurs in free text.
  2206. //
  2207. // Note: For record transformations where the entire cell in a table is being
  2208. // transformed, surrogates are not mandatory. Surrogates are used to denote
  2209. // the location of the token and are necessary for re-identification in free
  2210. // form text.
  2211. //
  2212. // In order for inspection to work properly, the name of this info type must
  2213. // not occur naturally anywhere in your data; otherwise, inspection may either
  2214. //
  2215. // - reverse a surrogate that does not correspond to an actual identifier
  2216. // - be unable to parse the surrogate and result in an error
  2217. //
  2218. // Therefore, choose your custom info type name carefully after considering
  2219. // what your data looks like. One way to select a name that has a high chance
  2220. // of yielding reliable detection is to include one or more unicode characters
  2221. // that are highly improbable to exist in your data.
  2222. // For example, assuming your data is entered from a regular ASCII keyboard,
  2223. // the symbol with the hex code point 29DD might be used like so:
  2224. // ⧝MY_TOKEN_TYPE.
  2225. InfoType surrogate_info_type = 2;
  2226. // A context may be used for higher security and maintaining
  2227. // referential integrity such that the same identifier in two different
  2228. // contexts will be given a distinct surrogate. The context is appended to
  2229. // plaintext value being encrypted. On decryption the provided context is
  2230. // validated against the value used during encryption. If a context was
  2231. // provided during encryption, same context must be provided during decryption
  2232. // as well.
  2233. //
  2234. // If the context is not set, plaintext would be used as is for encryption.
  2235. // If the context is set but:
  2236. //
  2237. // 1. there is no record present when transforming a given value or
  2238. // 2. the field is not present when transforming a given value,
  2239. //
  2240. // plaintext would be used as is for encryption.
  2241. //
  2242. // Note that case (1) is expected when an `InfoTypeTransformation` is
  2243. // applied to both structured and unstructured `ContentItem`s.
  2244. FieldId context = 3;
  2245. }
  2246. // Replace each input value with a given `Value`.
  2247. message ReplaceValueConfig {
  2248. // Value to replace it with.
  2249. Value new_value = 1;
  2250. }
  2251. // Replace each input value with a value randomly selected from the dictionary.
  2252. message ReplaceDictionaryConfig {
  2253. oneof type {
  2254. // A list of words to select from for random replacement. The
  2255. // [limits](https://cloud.google.com/dlp/limits) page contains details about
  2256. // the size limits of dictionaries.
  2257. CustomInfoType.Dictionary.WordList word_list = 1;
  2258. }
  2259. }
  2260. // Replace each matching finding with the name of the info_type.
  2261. message ReplaceWithInfoTypeConfig {
  2262. }
  2263. // Redact a given value. For example, if used with an `InfoTypeTransformation`
  2264. // transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the
  2265. // output would be 'My phone number is '.
  2266. message RedactConfig {
  2267. }
  2268. // Characters to skip when doing deidentification of a value. These will be left
  2269. // alone and skipped.
  2270. message CharsToIgnore {
  2271. // Convenience enum for indicating common characters to not transform.
  2272. enum CommonCharsToIgnore {
  2273. // Unused.
  2274. COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0;
  2275. // 0-9
  2276. NUMERIC = 1;
  2277. // A-Z
  2278. ALPHA_UPPER_CASE = 2;
  2279. // a-z
  2280. ALPHA_LOWER_CASE = 3;
  2281. // US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
  2282. PUNCTUATION = 4;
  2283. // Whitespace character, one of [ \t\n\x0B\f\r]
  2284. WHITESPACE = 5;
  2285. }
  2286. oneof characters {
  2287. // Characters to not transform when masking.
  2288. string characters_to_skip = 1;
  2289. // Common characters to not transform when masking. Useful to avoid removing
  2290. // punctuation.
  2291. CommonCharsToIgnore common_characters_to_ignore = 2;
  2292. }
  2293. }
  2294. // Partially mask a string by replacing a given number of characters with a
  2295. // fixed character. Masking can start from the beginning or end of the string.
  2296. // This can be used on data of any type (numbers, longs, and so on) and when
  2297. // de-identifying structured data we'll attempt to preserve the original data's
  2298. // type. (This allows you to take a long like 123 and modify it to a string like
  2299. // **3.
  2300. message CharacterMaskConfig {
  2301. // Character to use to mask the sensitive values&mdash;for example, `*` for an
  2302. // alphabetic string such as a name, or `0` for a numeric string such as ZIP
  2303. // code or credit card number. This string must have a length of 1. If not
  2304. // supplied, this value defaults to `*` for strings, and `0` for digits.
  2305. string masking_character = 1;
  2306. // Number of characters to mask. If not set, all matching chars will be
  2307. // masked. Skipped characters do not count towards this tally.
  2308. //
  2309. // If `number_to_mask` is negative, this denotes inverse masking. Cloud DLP
  2310. // masks all but a number of characters.
  2311. // For example, suppose you have the following values:
  2312. //
  2313. // - `masking_character` is `*`
  2314. // - `number_to_mask` is `-4`
  2315. // - `reverse_order` is `false`
  2316. // - `CharsToIgnore` includes `-`
  2317. // - Input string is `1234-5678-9012-3456`
  2318. //
  2319. // The resulting de-identified string is
  2320. // `****-****-****-3456`. Cloud DLP masks all but the last four characters.
  2321. // If `reverse_order` is `true`, all but the first four characters are masked
  2322. // as `1234-****-****-****`.
  2323. int32 number_to_mask = 2;
  2324. // Mask characters in reverse order. For example, if `masking_character` is
  2325. // `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the
  2326. // input string `1234-5678-9012-3456` is masked as `00000000000000-3456`.
  2327. // If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order`
  2328. // is `true`, then the string `12345` is masked as `12***`.
  2329. bool reverse_order = 3;
  2330. // When masking a string, items in this list will be skipped when replacing
  2331. // characters. For example, if the input string is `555-555-5555` and you
  2332. // instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP
  2333. // returns `***-**5-5555`.
  2334. repeated CharsToIgnore characters_to_ignore = 4;
  2335. }
  2336. // Buckets values based on fixed size ranges. The
  2337. // Bucketing transformation can provide all of this functionality,
  2338. // but requires more configuration. This message is provided as a convenience to
  2339. // the user for simple bucketing strategies.
  2340. //
  2341. // The transformed value will be a hyphenated string of
  2342. // {lower_bound}-{upper_bound}. For example, if lower_bound = 10 and upper_bound
  2343. // = 20, all values that are within this bucket will be replaced with "10-20".
  2344. //
  2345. // This can be used on data of type: double, long.
  2346. //
  2347. // If the bound Value type differs from the type of data
  2348. // being transformed, we will first attempt converting the type of the data to
  2349. // be transformed to match the type of the bound before comparing.
  2350. //
  2351. // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more.
  2352. message FixedSizeBucketingConfig {
  2353. // Required. Lower bound value of buckets. All values less than `lower_bound` are
  2354. // grouped together into a single bucket; for example if `lower_bound` = 10,
  2355. // then all values less than 10 are replaced with the value "-10".
  2356. Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED];
  2357. // Required. Upper bound value of buckets. All values greater than upper_bound are
  2358. // grouped together into a single bucket; for example if `upper_bound` = 89,
  2359. // then all values greater than 89 are replaced with the value "89+".
  2360. Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED];
  2361. // Required. Size of each bucket (except for minimum and maximum buckets). So if
  2362. // `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the
  2363. // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60,
  2364. // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works.
  2365. double bucket_size = 3 [(google.api.field_behavior) = REQUIRED];
  2366. }
  2367. // Generalization function that buckets values based on ranges. The ranges and
  2368. // replacement values are dynamically provided by the user for custom behavior,
  2369. // such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH
  2370. // This can be used on
  2371. // data of type: number, long, string, timestamp.
  2372. // If the bound `Value` type differs from the type of data being transformed, we
  2373. // will first attempt converting the type of the data to be transformed to match
  2374. // the type of the bound before comparing.
  2375. // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more.
  2376. message BucketingConfig {
  2377. // Bucket is represented as a range, along with replacement values.
  2378. message Bucket {
  2379. // Lower bound of the range, inclusive. Type should be the same as max if
  2380. // used.
  2381. Value min = 1;
  2382. // Upper bound of the range, exclusive; type must match min.
  2383. Value max = 2;
  2384. // Required. Replacement value for this bucket.
  2385. Value replacement_value = 3 [(google.api.field_behavior) = REQUIRED];
  2386. }
  2387. // Set of buckets. Ranges must be non-overlapping.
  2388. repeated Bucket buckets = 1;
  2389. }
  2390. // Replaces an identifier with a surrogate using Format Preserving Encryption
  2391. // (FPE) with the FFX mode of operation; however when used in the
  2392. // `ReidentifyContent` API method, it serves the opposite function by reversing
  2393. // the surrogate back into the original identifier. The identifier must be
  2394. // encoded as ASCII. For a given crypto key and context, the same identifier
  2395. // will be replaced with the same surrogate. Identifiers must be at least two
  2396. // characters long. In the case that the identifier is the empty string, it will
  2397. // be skipped. See https://cloud.google.com/dlp/docs/pseudonymization to learn
  2398. // more.
  2399. //
  2400. // Note: We recommend using CryptoDeterministicConfig for all use cases which
  2401. // do not require preserving the input alphabet space and size, plus warrant
  2402. // referential integrity.
  2403. message CryptoReplaceFfxFpeConfig {
  2404. // These are commonly used subsets of the alphabet that the FFX mode
  2405. // natively supports. In the algorithm, the alphabet is selected using
  2406. // the "radix". Therefore each corresponds to a particular radix.
  2407. enum FfxCommonNativeAlphabet {
  2408. // Unused.
  2409. FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;
  2410. // `[0-9]` (radix of 10)
  2411. NUMERIC = 1;
  2412. // `[0-9A-F]` (radix of 16)
  2413. HEXADECIMAL = 2;
  2414. // `[0-9A-Z]` (radix of 36)
  2415. UPPER_CASE_ALPHA_NUMERIC = 3;
  2416. // `[0-9A-Za-z]` (radix of 62)
  2417. ALPHA_NUMERIC = 4;
  2418. }
  2419. // Required. The key used by the encryption algorithm.
  2420. CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED];
  2421. // The 'tweak', a context may be used for higher security since the same
  2422. // identifier in two different contexts won't be given the same surrogate. If
  2423. // the context is not set, a default tweak will be used.
  2424. //
  2425. // If the context is set but:
  2426. //
  2427. // 1. there is no record present when transforming a given value or
  2428. // 1. the field is not present when transforming a given value,
  2429. //
  2430. // a default tweak will be used.
  2431. //
  2432. // Note that case (1) is expected when an `InfoTypeTransformation` is
  2433. // applied to both structured and unstructured `ContentItem`s.
  2434. // Currently, the referenced field may be of value type integer or string.
  2435. //
  2436. // The tweak is constructed as a sequence of bytes in big endian byte order
  2437. // such that:
  2438. //
  2439. // - a 64 bit integer is encoded followed by a single byte of value 1
  2440. // - a string is encoded in UTF-8 format followed by a single byte of value 2
  2441. FieldId context = 2;
  2442. // Choose an alphabet which the data being transformed will be made up of.
  2443. oneof alphabet {
  2444. // Common alphabets.
  2445. FfxCommonNativeAlphabet common_alphabet = 4;
  2446. // This is supported by mapping these to the alphanumeric characters
  2447. // that the FFX mode natively supports. This happens before/after
  2448. // encryption/decryption.
  2449. // Each character listed must appear only once.
  2450. // Number of characters must be in the range [2, 95].
  2451. // This must be encoded as ASCII.
  2452. // The order of characters does not matter.
  2453. // The full list of allowed characters is:
  2454. // <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
  2455. // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/</code>
  2456. string custom_alphabet = 5;
  2457. // The native way to select the alphabet. Must be in the range [2, 95].
  2458. int32 radix = 6;
  2459. }
  2460. // The custom infoType to annotate the surrogate with.
  2461. // This annotation will be applied to the surrogate by prefixing it with
  2462. // the name of the custom infoType followed by the number of
  2463. // characters comprising the surrogate. The following scheme defines the
  2464. // format: info_type_name(surrogate_character_count):surrogate
  2465. //
  2466. // For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE' and
  2467. // the surrogate is 'abc', the full replacement value
  2468. // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  2469. //
  2470. // This annotation identifies the surrogate when inspecting content using the
  2471. // custom infoType
  2472. // [`SurrogateType`](https://cloud.google.com/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype).
  2473. // This facilitates reversal of the surrogate when it occurs in free text.
  2474. //
  2475. // In order for inspection to work properly, the name of this infoType must
  2476. // not occur naturally anywhere in your data; otherwise, inspection may
  2477. // find a surrogate that does not correspond to an actual identifier.
  2478. // Therefore, choose your custom infoType name carefully after considering
  2479. // what your data looks like. One way to select a name that has a high chance
  2480. // of yielding reliable detection is to include one or more unicode characters
  2481. // that are highly improbable to exist in your data.
  2482. // For example, assuming your data is entered from a regular ASCII keyboard,
  2483. // the symbol with the hex code point 29DD might be used like so:
  2484. // ⧝MY_TOKEN_TYPE
  2485. InfoType surrogate_info_type = 8;
  2486. }
  2487. // This is a data encryption key (DEK) (as opposed to
  2488. // a key encryption key (KEK) stored by Cloud Key Management Service
  2489. // (Cloud KMS).
  2490. // When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate
  2491. // IAM policy on the KEK to ensure an attacker cannot
  2492. // unwrap the DEK.
  2493. message CryptoKey {
  2494. // Sources of crypto keys.
  2495. oneof source {
  2496. // Transient crypto key
  2497. TransientCryptoKey transient = 1;
  2498. // Unwrapped crypto key
  2499. UnwrappedCryptoKey unwrapped = 2;
  2500. // Key wrapped using Cloud KMS
  2501. KmsWrappedCryptoKey kms_wrapped = 3;
  2502. }
  2503. }
  2504. // Use this to have a random data crypto key generated.
  2505. // It will be discarded after the request finishes.
  2506. message TransientCryptoKey {
  2507. // Required. Name of the key.
  2508. // This is an arbitrary string used to differentiate different keys.
  2509. // A unique key is generated per name: two separate `TransientCryptoKey`
  2510. // protos share the same generated key if their names are the same.
  2511. // When the data crypto key is generated, this name is not used in any way
  2512. // (repeating the api call will result in a different key being generated).
  2513. string name = 1 [(google.api.field_behavior) = REQUIRED];
  2514. }
  2515. // Using raw keys is prone to security risks due to accidentally
  2516. // leaking the key. Choose another type of key if possible.
  2517. message UnwrappedCryptoKey {
  2518. // Required. A 128/192/256 bit key.
  2519. bytes key = 1 [(google.api.field_behavior) = REQUIRED];
  2520. }
  2521. // Include to use an existing data crypto key wrapped by KMS.
  2522. // The wrapped key must be a 128-, 192-, or 256-bit key.
  2523. // Authorization requires the following IAM permissions when sending a request
  2524. // to perform a crypto transformation using a KMS-wrapped crypto key:
  2525. // dlp.kms.encrypt
  2526. //
  2527. // For more information, see [Creating a wrapped key]
  2528. // (https://cloud.google.com/dlp/docs/create-wrapped-key).
  2529. //
  2530. // Note: When you use Cloud KMS for cryptographic operations,
  2531. // [charges apply](https://cloud.google.com/kms/pricing).
  2532. message KmsWrappedCryptoKey {
  2533. // Required. The wrapped data crypto key.
  2534. bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED];
  2535. // Required. The resource name of the KMS CryptoKey to use for unwrapping.
  2536. string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED];
  2537. }
  2538. // Shifts dates by random number of days, with option to be consistent for the
  2539. // same context. See https://cloud.google.com/dlp/docs/concepts-date-shifting
  2540. // to learn more.
  2541. message DateShiftConfig {
  2542. // Required. Range of shift in days. Actual shift will be selected at random within this
  2543. // range (inclusive ends). Negative means shift to earlier in time. Must not
  2544. // be more than 365250 days (1000 years) each direction.
  2545. //
  2546. // For example, 3 means shift date to at most 3 days into the future.
  2547. int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED];
  2548. // Required. For example, -5 means shift date to at most 5 days back in the past.
  2549. int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED];
  2550. // Points to the field that contains the context, for example, an entity id.
  2551. // If set, must also set cryptoKey. If set, shift will be consistent for the
  2552. // given context.
  2553. FieldId context = 3;
  2554. // Method for calculating shift that takes context into consideration. If
  2555. // set, must also set context. Can only be applied to table items.
  2556. oneof method {
  2557. // Causes the shift to be computed based on this key and the context. This
  2558. // results in the same shift for the same context and crypto_key. If
  2559. // set, must also set context. Can only be applied to table items.
  2560. CryptoKey crypto_key = 4;
  2561. }
  2562. }
  2563. // A type of transformation that will scan unstructured text and
  2564. // apply various `PrimitiveTransformation`s to each finding, where the
  2565. // transformation is applied to only values that were identified as a specific
  2566. // info_type.
  2567. message InfoTypeTransformations {
  2568. // A transformation to apply to text that is identified as a specific
  2569. // info_type.
  2570. message InfoTypeTransformation {
  2571. // InfoTypes to apply the transformation to. An empty list will cause
  2572. // this transformation to apply to all findings that correspond to
  2573. // infoTypes that were requested in `InspectConfig`.
  2574. repeated InfoType info_types = 1;
  2575. // Required. Primitive transformation to apply to the infoType.
  2576. PrimitiveTransformation primitive_transformation = 2 [(google.api.field_behavior) = REQUIRED];
  2577. }
  2578. // Required. Transformation for each infoType. Cannot specify more than one
  2579. // for a given infoType.
  2580. repeated InfoTypeTransformation transformations = 1 [(google.api.field_behavior) = REQUIRED];
  2581. }
  2582. // The transformation to apply to the field.
  2583. message FieldTransformation {
  2584. // Required. Input field(s) to apply the transformation to.
  2585. // When you have columns that reference their position within a list,
  2586. // omit the index from the FieldId. FieldId name matching ignores the index.
  2587. // For example, instead of "contact.nums[0].type", use "contact.nums.type".
  2588. repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED];
  2589. // Only apply the transformation if the condition evaluates to true for the
  2590. // given `RecordCondition`. The conditions are allowed to reference fields
  2591. // that are not used in the actual transformation.
  2592. //
  2593. // Example Use Cases:
  2594. //
  2595. // - Apply a different bucket transformation to an age column if the zip code
  2596. // column for the same record is within a specific range.
  2597. // - Redact a field if the date of birth field is greater than 85.
  2598. RecordCondition condition = 3;
  2599. // Transformation to apply. [required]
  2600. oneof transformation {
  2601. // Apply the transformation to the entire field.
  2602. PrimitiveTransformation primitive_transformation = 4;
  2603. // Treat the contents of the field as free text, and selectively
  2604. // transform content that matches an `InfoType`.
  2605. InfoTypeTransformations info_type_transformations = 5;
  2606. }
  2607. }
  2608. // A type of transformation that is applied over structured data such as a
  2609. // table.
  2610. message RecordTransformations {
  2611. // Transform the record by applying various field transformations.
  2612. repeated FieldTransformation field_transformations = 1;
  2613. // Configuration defining which records get suppressed entirely. Records that
  2614. // match any suppression rule are omitted from the output.
  2615. repeated RecordSuppression record_suppressions = 2;
  2616. }
  2617. // Configuration to suppress records whose suppression conditions evaluate to
  2618. // true.
  2619. message RecordSuppression {
  2620. // A condition that when it evaluates to true will result in the record being
  2621. // evaluated to be suppressed from the transformed content.
  2622. RecordCondition condition = 1;
  2623. }
  2624. // A condition for determining whether a transformation should be applied to
  2625. // a field.
  2626. message RecordCondition {
  2627. // The field type of `value` and `field` do not need to match to be
  2628. // considered equal, but not all comparisons are possible.
  2629. // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types,
  2630. // but all other comparisons are invalid with incompatible types.
  2631. // A `value` of type:
  2632. //
  2633. // - `string` can be compared against all other types
  2634. // - `boolean` can only be compared against other booleans
  2635. // - `integer` can be compared against doubles or a string if the string value
  2636. // can be parsed as an integer.
  2637. // - `double` can be compared against integers or a string if the string can
  2638. // be parsed as a double.
  2639. // - `Timestamp` can be compared against strings in RFC 3339 date string
  2640. // format.
  2641. // - `TimeOfDay` can be compared against timestamps and strings in the format
  2642. // of 'HH:mm:ss'.
  2643. //
  2644. // If we fail to compare do to type mismatch, a warning will be given and
  2645. // the condition will evaluate to false.
  2646. message Condition {
  2647. // Required. Field within the record this condition is evaluated against.
  2648. FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  2649. // Required. Operator used to compare the field or infoType to the value.
  2650. RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED];
  2651. // Value to compare against. [Mandatory, except for `EXISTS` tests.]
  2652. Value value = 4;
  2653. }
  2654. // A collection of conditions.
  2655. message Conditions {
  2656. // A collection of conditions.
  2657. repeated Condition conditions = 1;
  2658. }
  2659. // An expression, consisting of an operator and conditions.
  2660. message Expressions {
  2661. // Logical operators for conditional checks.
  2662. enum LogicalOperator {
  2663. // Unused
  2664. LOGICAL_OPERATOR_UNSPECIFIED = 0;
  2665. // Conditional AND
  2666. AND = 1;
  2667. }
  2668. // The operator to apply to the result of conditions. Default and currently
  2669. // only supported value is `AND`.
  2670. LogicalOperator logical_operator = 1;
  2671. // Expression types.
  2672. oneof type {
  2673. // Conditions to apply to the expression.
  2674. Conditions conditions = 3;
  2675. }
  2676. }
  2677. // An expression.
  2678. Expressions expressions = 3;
  2679. }
  2680. // Overview of the modifications that occurred.
  2681. message TransformationOverview {
  2682. // Total size in bytes that were transformed in some way.
  2683. int64 transformed_bytes = 2;
  2684. // Transformations applied to the dataset.
  2685. repeated TransformationSummary transformation_summaries = 3;
  2686. }
  2687. // Summary of a single transformation.
  2688. // Only one of 'transformation', 'field_transformation', or 'record_suppress'
  2689. // will be set.
  2690. message TransformationSummary {
  2691. // Possible outcomes of transformations.
  2692. enum TransformationResultCode {
  2693. // Unused
  2694. TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0;
  2695. // Transformation completed without an error.
  2696. SUCCESS = 1;
  2697. // Transformation had an error.
  2698. ERROR = 2;
  2699. }
  2700. // A collection that informs the user the number of times a particular
  2701. // `TransformationResultCode` and error details occurred.
  2702. message SummaryResult {
  2703. // Number of transformations counted by this result.
  2704. int64 count = 1;
  2705. // Outcome of the transformation.
  2706. TransformationResultCode code = 2;
  2707. // A place for warnings or errors to show up if a transformation didn't
  2708. // work as expected.
  2709. string details = 3;
  2710. }
  2711. // Set if the transformation was limited to a specific InfoType.
  2712. InfoType info_type = 1;
  2713. // Set if the transformation was limited to a specific FieldId.
  2714. FieldId field = 2;
  2715. // The specific transformation these stats apply to.
  2716. PrimitiveTransformation transformation = 3;
  2717. // The field transformation that was applied.
  2718. // If multiple field transformations are requested for a single field,
  2719. // this list will contain all of them; otherwise, only one is supplied.
  2720. repeated FieldTransformation field_transformations = 5;
  2721. // The specific suppression option these stats apply to.
  2722. RecordSuppression record_suppress = 6;
  2723. // Collection of all transformations that took place or had an error.
  2724. repeated SummaryResult results = 4;
  2725. // Total size in bytes that were transformed in some way.
  2726. int64 transformed_bytes = 7;
  2727. }
  2728. // A flattened description of a `PrimitiveTransformation` or
  2729. // `RecordSuppression`.
  2730. message TransformationDescription {
  2731. // The transformation type.
  2732. TransformationType type = 1;
  2733. // A description of the transformation. This is empty for a
  2734. // RECORD_SUPPRESSION, or is the output of calling toString() on the
  2735. // `PrimitiveTransformation` protocol buffer message for any other type of
  2736. // transformation.
  2737. string description = 2;
  2738. // A human-readable string representation of the `RecordCondition`
  2739. // corresponding to this transformation. Set if a `RecordCondition` was used
  2740. // to determine whether or not to apply this transformation.
  2741. //
  2742. // Examples:
  2743. // * (age_field > 85)
  2744. // * (age_field <= 18)
  2745. // * (zip_field exists)
  2746. // * (zip_field == 01234) && (city_field != "Springville")
  2747. // * (zip_field == 01234) && (age_field <= 18) && (city_field exists)
  2748. string condition = 3;
  2749. // Set if the transformation was limited to a specific `InfoType`.
  2750. InfoType info_type = 4;
  2751. }
  2752. // Details about a single transformation. This object contains a description of
  2753. // the transformation, information about whether the transformation was
  2754. // successfully applied, and the precise location where the transformation
  2755. // occurred. These details are stored in a user-specified BigQuery table.
  2756. message TransformationDetails {
  2757. // The name of the job that completed the transformation.
  2758. string resource_name = 1;
  2759. // The top level name of the container where the transformation is located
  2760. // (this will be the source file name or table name).
  2761. string container_name = 2;
  2762. // Description of transformation. This would only contain more than one
  2763. // element if there were multiple matching transformations and which one to
  2764. // apply was ambiguous. Not set for states that contain no transformation,
  2765. // currently only state that contains no transformation is
  2766. // TransformationResultStateType.METADATA_UNRETRIEVABLE.
  2767. repeated TransformationDescription transformation = 3;
  2768. // Status of the transformation, if transformation was not successful, this
  2769. // will specify what caused it to fail, otherwise it will show that the
  2770. // transformation was successful.
  2771. TransformationResultStatus status_details = 4;
  2772. // The number of bytes that were transformed. If transformation was
  2773. // unsuccessful or did not take place because there was no content to
  2774. // transform, this will be zero.
  2775. int64 transformed_bytes = 5;
  2776. // The precise location of the transformed content in the original container.
  2777. TransformationLocation transformation_location = 6;
  2778. }
  2779. // Specifies the location of a transformation.
  2780. message TransformationLocation {
  2781. oneof location_type {
  2782. // For infotype transformations, link to the corresponding findings ID so
  2783. // that location information does not need to be duplicated. Each findings
  2784. // ID correlates to an entry in the findings output table, this table only
  2785. // gets created when users specify to save findings (add the save findings
  2786. // action to the request).
  2787. string finding_id = 1;
  2788. // For record transformations, provide a field and container information.
  2789. RecordTransformation record_transformation = 2;
  2790. }
  2791. // Information about the functionality of the container where this finding
  2792. // occurred, if available.
  2793. TransformationContainerType container_type = 3;
  2794. }
  2795. message RecordTransformation {
  2796. // For record transformations, provide a field.
  2797. FieldId field_id = 1;
  2798. // Findings container modification timestamp, if applicable.
  2799. google.protobuf.Timestamp container_timestamp = 2;
  2800. // Container version, if available ("generation" for Cloud Storage).
  2801. string container_version = 3;
  2802. }
  2803. message TransformationResultStatus {
  2804. // Transformation result status type, this will be either SUCCESS, or it will
  2805. // be the reason for why the transformation was not completely successful.
  2806. TransformationResultStatusType result_status_type = 1;
  2807. // Detailed error codes and messages
  2808. google.rpc.Status details = 2;
  2809. }
  2810. // Enum of possible outcomes of transformations. SUCCESS if transformation and
  2811. // storing of transformation was successful, otherwise, reason for not
  2812. // transforming.
  2813. enum TransformationResultStatusType {
  2814. STATE_TYPE_UNSPECIFIED = 0;
  2815. // This will be set when a finding could not be transformed (i.e. outside user
  2816. // set bucket range).
  2817. INVALID_TRANSFORM = 1;
  2818. // This will be set when a BigQuery transformation was successful but could
  2819. // not be stored back in BigQuery because the transformed row exceeds
  2820. // BigQuery's max row size.
  2821. BIGQUERY_MAX_ROW_SIZE_EXCEEDED = 2;
  2822. // This will be set when there is a finding in the custom metadata of a file,
  2823. // but at the write time of the transformed file, this key / value pair is
  2824. // unretrievable.
  2825. METADATA_UNRETRIEVABLE = 3;
  2826. // This will be set when the transformation and storing of it is successful.
  2827. SUCCESS = 4;
  2828. }
  2829. // Describes functionality of a given container in its original format.
  2830. enum TransformationContainerType {
  2831. TRANSFORM_UNKNOWN_CONTAINER = 0;
  2832. TRANSFORM_BODY = 1;
  2833. TRANSFORM_METADATA = 2;
  2834. TRANSFORM_TABLE = 3;
  2835. }
  2836. // An enum of rules that can be used to transform a value. Can be a
  2837. // record suppression, or one of the transformation rules specified under
  2838. // `PrimitiveTransformation`.
  2839. enum TransformationType {
  2840. // Unused
  2841. TRANSFORMATION_TYPE_UNSPECIFIED = 0;
  2842. // Record suppression
  2843. RECORD_SUPPRESSION = 1;
  2844. // Replace value
  2845. REPLACE_VALUE = 2;
  2846. // Replace value using a dictionary.
  2847. REPLACE_DICTIONARY = 15;
  2848. // Redact
  2849. REDACT = 3;
  2850. // Character mask
  2851. CHARACTER_MASK = 4;
  2852. // FFX-FPE
  2853. CRYPTO_REPLACE_FFX_FPE = 5;
  2854. // Fixed size bucketing
  2855. FIXED_SIZE_BUCKETING = 6;
  2856. // Bucketing
  2857. BUCKETING = 7;
  2858. // Replace with info type
  2859. REPLACE_WITH_INFO_TYPE = 8;
  2860. // Time part
  2861. TIME_PART = 9;
  2862. // Crypto hash
  2863. CRYPTO_HASH = 10;
  2864. // Date shift
  2865. DATE_SHIFT = 12;
  2866. // Deterministic crypto
  2867. CRYPTO_DETERMINISTIC_CONFIG = 13;
  2868. // Redact image
  2869. REDACT_IMAGE = 14;
  2870. }
  2871. // Config for storing transformation details.
  2872. message TransformationDetailsStorageConfig {
  2873. // Location to store the transformation summary.
  2874. oneof type {
  2875. // The BigQuery table in which to store the output. This may be an existing
  2876. // table or in a new table in an existing dataset.
  2877. // If table_id is not set a new one will be generated for you with the
  2878. // following format:
  2879. // dlp_googleapis_transformation_details_yyyy_mm_dd_[dlp_job_id]. Pacific
  2880. // time zone will be used for generating the date details.
  2881. BigQueryTable table = 1;
  2882. }
  2883. }
  2884. // Schedule for inspect job triggers.
  2885. message Schedule {
  2886. oneof option {
  2887. // With this option a job is started on a regular periodic basis. For
  2888. // example: every day (86400 seconds).
  2889. //
  2890. // A scheduled start time will be skipped if the previous
  2891. // execution has not ended when its scheduled time occurs.
  2892. //
  2893. // This value must be set to a time duration greater than or equal
  2894. // to 1 day and can be no longer than 60 days.
  2895. google.protobuf.Duration recurrence_period_duration = 1;
  2896. }
  2897. }
  2898. // Job trigger option for hybrid jobs. Jobs must be manually created
  2899. // and finished.
  2900. message Manual {
  2901. }
  2902. // The inspectTemplate contains a configuration (set of types of sensitive data
  2903. // to be detected) to be used anywhere you otherwise would normally specify
  2904. // InspectConfig. See https://cloud.google.com/dlp/docs/concepts-templates
  2905. // to learn more.
  2906. message InspectTemplate {
  2907. option (google.api.resource) = {
  2908. type: "dlp.googleapis.com/InspectTemplate"
  2909. pattern: "organizations/{organization}/inspectTemplates/{inspect_template}"
  2910. pattern: "projects/{project}/inspectTemplates/{inspect_template}"
  2911. pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}"
  2912. pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}"
  2913. };
  2914. // Output only. The template name.
  2915. //
  2916. // The template will have one of the following formats:
  2917. // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR
  2918. // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`;
  2919. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  2920. // Display name (max 256 chars).
  2921. string display_name = 2;
  2922. // Short description (max 256 chars).
  2923. string description = 3;
  2924. // Output only. The creation timestamp of an inspectTemplate.
  2925. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  2926. // Output only. The last update timestamp of an inspectTemplate.
  2927. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  2928. // The core content of the template. Configuration of the scanning process.
  2929. InspectConfig inspect_config = 6;
  2930. }
  2931. // DeidentifyTemplates contains instructions on how to de-identify content.
  2932. // See https://cloud.google.com/dlp/docs/concepts-templates to learn more.
  2933. message DeidentifyTemplate {
  2934. option (google.api.resource) = {
  2935. type: "dlp.googleapis.com/DeidentifyTemplate"
  2936. pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}"
  2937. pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}"
  2938. pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}"
  2939. pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}"
  2940. };
  2941. // Output only. The template name.
  2942. //
  2943. // The template will have one of the following formats:
  2944. // `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR
  2945. // `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID`
  2946. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  2947. // Display name (max 256 chars).
  2948. string display_name = 2;
  2949. // Short description (max 256 chars).
  2950. string description = 3;
  2951. // Output only. The creation timestamp of an inspectTemplate.
  2952. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  2953. // Output only. The last update timestamp of an inspectTemplate.
  2954. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  2955. // The core content of the template.
  2956. DeidentifyConfig deidentify_config = 6;
  2957. }
  2958. // Details information about an error encountered during job execution or
  2959. // the results of an unsuccessful activation of the JobTrigger.
  2960. message Error {
  2961. // Detailed error codes and messages.
  2962. google.rpc.Status details = 1;
  2963. // The times the error occurred.
  2964. repeated google.protobuf.Timestamp timestamps = 2;
  2965. }
  2966. // Contains a configuration to make dlp api calls on a repeating basis.
  2967. // See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more.
  2968. message JobTrigger {
  2969. option (google.api.resource) = {
  2970. type: "dlp.googleapis.com/JobTrigger"
  2971. pattern: "projects/{project}/jobTriggers/{job_trigger}"
  2972. pattern: "projects/{project}/locations/{location}/jobTriggers/{job_trigger}"
  2973. };
  2974. // What event needs to occur for a new job to be started.
  2975. message Trigger {
  2976. oneof trigger {
  2977. // Create a job on a repeating basis based on the elapse of time.
  2978. Schedule schedule = 1;
  2979. // For use with hybrid jobs. Jobs must be manually created and finished.
  2980. Manual manual = 2;
  2981. }
  2982. }
  2983. // Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs
  2984. // will be created with this configuration. The service may automatically
  2985. // pause triggers experiencing frequent errors. To restart a job, set the
  2986. // status to HEALTHY after correcting user errors.
  2987. enum Status {
  2988. // Unused.
  2989. STATUS_UNSPECIFIED = 0;
  2990. // Trigger is healthy.
  2991. HEALTHY = 1;
  2992. // Trigger is temporarily paused.
  2993. PAUSED = 2;
  2994. // Trigger is cancelled and can not be resumed.
  2995. CANCELLED = 3;
  2996. }
  2997. // Unique resource name for the triggeredJob, assigned by the service when the
  2998. // triggeredJob is created, for example
  2999. // `projects/dlp-test-project/jobTriggers/53234423`.
  3000. string name = 1;
  3001. // Display name (max 100 chars)
  3002. string display_name = 2;
  3003. // User provided description (max 256 chars)
  3004. string description = 3;
  3005. // The configuration details for the specific type of job to run.
  3006. oneof job {
  3007. // For inspect jobs, a snapshot of the configuration.
  3008. InspectJobConfig inspect_job = 4;
  3009. }
  3010. // A list of triggers which will be OR'ed together. Only one in the list
  3011. // needs to trigger for a job to be started. The list may contain only
  3012. // a single Schedule trigger and must have at least one object.
  3013. repeated Trigger triggers = 5;
  3014. // Output only. A stream of errors encountered when the trigger was activated. Repeated
  3015. // errors may result in the JobTrigger automatically being paused.
  3016. // Will return the last 100 errors. Whenever the JobTrigger is modified
  3017. // this list will be cleared.
  3018. repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  3019. // Output only. The creation timestamp of a triggeredJob.
  3020. google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  3021. // Output only. The last update timestamp of a triggeredJob.
  3022. google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  3023. // Output only. The timestamp of the last time this trigger executed.
  3024. google.protobuf.Timestamp last_run_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  3025. // Required. A status for this trigger.
  3026. Status status = 10 [(google.api.field_behavior) = REQUIRED];
  3027. }
  3028. // A task to execute on the completion of a job.
  3029. // See https://cloud.google.com/dlp/docs/concepts-actions to learn more.
  3030. message Action {
  3031. // If set, the detailed findings will be persisted to the specified
  3032. // OutputStorageConfig. Only a single instance of this action can be
  3033. // specified.
  3034. // Compatible with: Inspect, Risk
  3035. message SaveFindings {
  3036. // Location to store findings outside of DLP.
  3037. OutputStorageConfig output_config = 1;
  3038. }
  3039. // Publish a message into a given Pub/Sub topic when DlpJob has completed. The
  3040. // message contains a single field, `DlpJobName`, which is equal to the
  3041. // finished job's
  3042. // [`DlpJob.name`](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.dlpJobs#DlpJob).
  3043. // Compatible with: Inspect, Risk
  3044. message PublishToPubSub {
  3045. // Cloud Pub/Sub topic to send notifications to. The topic must have given
  3046. // publishing access rights to the DLP API service account executing
  3047. // the long running DlpJob sending the notifications.
  3048. // Format is projects/{project}/topics/{topic}.
  3049. string topic = 1;
  3050. }
  3051. // Publish the result summary of a DlpJob to the Cloud Security
  3052. // Command Center (CSCC Alpha).
  3053. // This action is only available for projects which are parts of
  3054. // an organization and whitelisted for the alpha Cloud Security Command
  3055. // Center.
  3056. // The action will publish the count of finding instances and their info
  3057. // types. The summary of findings will be persisted in CSCC and are governed
  3058. // by CSCC service-specific policy, see
  3059. // https://cloud.google.com/terms/service-terms Only a single instance of this
  3060. // action can be specified. Compatible with: Inspect
  3061. message PublishSummaryToCscc {
  3062. }
  3063. // Publish findings of a DlpJob to Data Catalog. In Data Catalog, tag
  3064. // templates are applied to the resource that Cloud DLP scanned. Data
  3065. // Catalog tag templates are stored in the same project and region where the
  3066. // BigQuery table exists. For Cloud DLP to create and apply the tag template,
  3067. // the Cloud DLP service agent must have the
  3068. // `roles/datacatalog.tagTemplateOwner` permission on the project. The tag
  3069. // template contains fields summarizing the results of the DlpJob. Any field
  3070. // values previously written by another DlpJob are deleted. [InfoType naming
  3071. // patterns][google.privacy.dlp.v2.InfoType] are strictly enforced when using
  3072. // this feature.
  3073. //
  3074. // Findings are persisted in Data Catalog storage and are governed by
  3075. // service-specific policies for Data Catalog. For more information, see
  3076. // [Service Specific Terms](https://cloud.google.com/terms/service-terms).
  3077. //
  3078. // Only a single instance of this action can be specified. This action is
  3079. // allowed only if all resources being scanned are BigQuery tables.
  3080. // Compatible with: Inspect
  3081. message PublishFindingsToCloudDataCatalog {
  3082. }
  3083. // Create a de-identified copy of the requested table or files.
  3084. //
  3085. // A TransformationDetail will be created for each transformation.
  3086. //
  3087. // If any rows in BigQuery are skipped during de-identification
  3088. // (transformation errors or row size exceeds BigQuery insert API limits) they
  3089. // are placed in the failure output table. If the original row exceeds
  3090. // the BigQuery insert API limit it will be truncated when written to the
  3091. // failure output table. The failure output table can be set in the
  3092. // action.deidentify.output.big_query_output.deidentified_failure_output_table
  3093. // field, if no table is set, a table will be automatically created in the
  3094. // same project and dataset as the original table.
  3095. //
  3096. // Compatible with: Inspect
  3097. message Deidentify {
  3098. // User specified deidentify templates and configs for structured,
  3099. // unstructured, and image files.
  3100. TransformationConfig transformation_config = 7;
  3101. // Config for storing transformation details. This is separate from the
  3102. // de-identified content, and contains metadata about the successful
  3103. // transformations and/or failures that occurred while de-identifying. This
  3104. // needs to be set in order for users to access information about the status
  3105. // of each transformation (see
  3106. // [TransformationDetails][google.privacy.dlp.v2.TransformationDetails]
  3107. // message for more information about what is noted).
  3108. TransformationDetailsStorageConfig transformation_details_storage_config = 3;
  3109. oneof output {
  3110. // Required. User settable Cloud Storage bucket and folders to store de-identified
  3111. // files. This field must be set for cloud storage deidentification. The
  3112. // output Cloud Storage bucket must be different from the input bucket.
  3113. // De-identified files will overwrite files in the output path.
  3114. //
  3115. // Form of: gs://bucket/folder/ or gs://bucket
  3116. string cloud_storage_output = 9 [(google.api.field_behavior) = REQUIRED];
  3117. }
  3118. // List of user-specified file type groups to transform. If specified, only
  3119. // the files with these filetypes will be transformed. If empty, all
  3120. // supported files will be transformed. Supported types may be automatically
  3121. // added over time. If a file type is set in this field that isn't supported
  3122. // by the Deidentify action then the job will fail and will not be
  3123. // successfully created/started. Currently the only filetypes supported are:
  3124. // IMAGES, TEXT_FILES, CSV, TSV.
  3125. repeated FileType file_types_to_transform = 8;
  3126. }
  3127. // Sends an email when the job completes. The email goes to IAM project owners
  3128. // and technical [Essential
  3129. // Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts).
  3130. message JobNotificationEmails {
  3131. }
  3132. // Enable Stackdriver metric dlp.googleapis.com/finding_count. This
  3133. // will publish a metric to stack driver on each infotype requested and
  3134. // how many findings were found for it. CustomDetectors will be bucketed
  3135. // as 'Custom' under the Stackdriver label 'info_type'.
  3136. message PublishToStackdriver {
  3137. }
  3138. oneof action {
  3139. // Save resulting findings in a provided location.
  3140. SaveFindings save_findings = 1;
  3141. // Publish a notification to a Pub/Sub topic.
  3142. PublishToPubSub pub_sub = 2;
  3143. // Publish summary to Cloud Security Command Center (Alpha).
  3144. PublishSummaryToCscc publish_summary_to_cscc = 3;
  3145. // Publish findings to Cloud Datahub.
  3146. PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5;
  3147. // Create a de-identified copy of the input data.
  3148. Deidentify deidentify = 7;
  3149. // Sends an email when the job completes. The email goes to IAM project
  3150. // owners and technical [Essential
  3151. // Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts).
  3152. JobNotificationEmails job_notification_emails = 8;
  3153. // Enable Stackdriver metric dlp.googleapis.com/finding_count.
  3154. PublishToStackdriver publish_to_stackdriver = 9;
  3155. }
  3156. }
  3157. // User specified templates and configs for how to deidentify structured,
  3158. // unstructures, and image files. User must provide either a unstructured
  3159. // deidentify template or at least one redact image config.
  3160. message TransformationConfig {
  3161. // De-identify template.
  3162. // If this template is specified, it will serve as the default de-identify
  3163. // template. This template cannot contain `record_transformations` since it
  3164. // can be used for unstructured content such as free-form text files. If this
  3165. // template is not set, a default `ReplaceWithInfoTypeConfig` will be used to
  3166. // de-identify unstructured content.
  3167. string deidentify_template = 1;
  3168. // Structured de-identify template.
  3169. // If this template is specified, it will serve as the de-identify template
  3170. // for structured content such as delimited files and tables. If this template
  3171. // is not set but the `deidentify_template` is set, then `deidentify_template`
  3172. // will also apply to the structured content. If neither template is set, a
  3173. // default `ReplaceWithInfoTypeConfig` will be used to de-identify structured
  3174. // content.
  3175. string structured_deidentify_template = 2;
  3176. // Image redact template.
  3177. // If this template is specified, it will serve as the de-identify template
  3178. // for images. If this template is not set, all findings in the image will be
  3179. // redacted with a black box.
  3180. string image_redact_template = 4;
  3181. }
  3182. // Request message for CreateInspectTemplate.
  3183. message CreateInspectTemplateRequest {
  3184. // Required. Parent resource name.
  3185. //
  3186. // The format of this value varies depending on the scope of the request
  3187. // (project or organization) and whether you have [specified a processing
  3188. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3189. //
  3190. // + Projects scope, location specified:<br/>
  3191. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3192. // + Projects scope, no location specified (defaults to global):<br/>
  3193. // `projects/`<var>PROJECT_ID</var>
  3194. // + Organizations scope, location specified:<br/>
  3195. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3196. // + Organizations scope, no location specified (defaults to global):<br/>
  3197. // `organizations/`<var>ORG_ID</var>
  3198. //
  3199. // The following example `parent` string specifies a parent project with the
  3200. // identifier `example-project`, and specifies the `europe-west3` location
  3201. // for processing data:
  3202. //
  3203. // parent=projects/example-project/locations/europe-west3
  3204. string parent = 1 [
  3205. (google.api.field_behavior) = REQUIRED,
  3206. (google.api.resource_reference) = {
  3207. child_type: "dlp.googleapis.com/InspectTemplate"
  3208. }
  3209. ];
  3210. // Required. The InspectTemplate to create.
  3211. InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED];
  3212. // The template id can contain uppercase and lowercase letters,
  3213. // numbers, and hyphens; that is, it must match the regular
  3214. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3215. // characters. Can be empty to allow the system to generate one.
  3216. string template_id = 3;
  3217. // Deprecated. This field has no effect.
  3218. string location_id = 4;
  3219. }
  3220. // Request message for UpdateInspectTemplate.
  3221. message UpdateInspectTemplateRequest {
  3222. // Required. Resource name of organization and inspectTemplate to be updated, for
  3223. // example `organizations/433245324/inspectTemplates/432452342` or
  3224. // projects/project-id/inspectTemplates/432452342.
  3225. string name = 1 [
  3226. (google.api.field_behavior) = REQUIRED,
  3227. (google.api.resource_reference) = {
  3228. type: "dlp.googleapis.com/InspectTemplate"
  3229. }
  3230. ];
  3231. // New InspectTemplate value.
  3232. InspectTemplate inspect_template = 2;
  3233. // Mask to control which fields get updated.
  3234. google.protobuf.FieldMask update_mask = 3;
  3235. }
  3236. // Request message for GetInspectTemplate.
  3237. message GetInspectTemplateRequest {
  3238. // Required. Resource name of the organization and inspectTemplate to be read, for
  3239. // example `organizations/433245324/inspectTemplates/432452342` or
  3240. // projects/project-id/inspectTemplates/432452342.
  3241. string name = 1 [
  3242. (google.api.field_behavior) = REQUIRED,
  3243. (google.api.resource_reference) = {
  3244. type: "dlp.googleapis.com/InspectTemplate"
  3245. }
  3246. ];
  3247. }
  3248. // Request message for ListInspectTemplates.
  3249. message ListInspectTemplatesRequest {
  3250. // Required. Parent resource name.
  3251. //
  3252. // The format of this value varies depending on the scope of the request
  3253. // (project or organization) and whether you have [specified a processing
  3254. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3255. //
  3256. // + Projects scope, location specified:<br/>
  3257. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3258. // + Projects scope, no location specified (defaults to global):<br/>
  3259. // `projects/`<var>PROJECT_ID</var>
  3260. // + Organizations scope, location specified:<br/>
  3261. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3262. // + Organizations scope, no location specified (defaults to global):<br/>
  3263. // `organizations/`<var>ORG_ID</var>
  3264. //
  3265. // The following example `parent` string specifies a parent project with the
  3266. // identifier `example-project`, and specifies the `europe-west3` location
  3267. // for processing data:
  3268. //
  3269. // parent=projects/example-project/locations/europe-west3
  3270. string parent = 1 [
  3271. (google.api.field_behavior) = REQUIRED,
  3272. (google.api.resource_reference) = {
  3273. child_type: "dlp.googleapis.com/InspectTemplate"
  3274. }
  3275. ];
  3276. // Page token to continue retrieval. Comes from previous call
  3277. // to `ListInspectTemplates`.
  3278. string page_token = 2;
  3279. // Size of the page, can be limited by the server. If zero server returns
  3280. // a page of max size 100.
  3281. int32 page_size = 3;
  3282. // Comma separated list of fields to order by,
  3283. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3284. // default sorting order is ascending, redundant space characters are
  3285. // insignificant.
  3286. //
  3287. // Example: `name asc,update_time, create_time desc`
  3288. //
  3289. // Supported fields are:
  3290. //
  3291. // - `create_time`: corresponds to the time the template was created.
  3292. // - `update_time`: corresponds to the time the template was last updated.
  3293. // - `name`: corresponds to the template's name.
  3294. // - `display_name`: corresponds to the template's display name.
  3295. string order_by = 4;
  3296. // Deprecated. This field has no effect.
  3297. string location_id = 5;
  3298. }
  3299. // Response message for ListInspectTemplates.
  3300. message ListInspectTemplatesResponse {
  3301. // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest.
  3302. repeated InspectTemplate inspect_templates = 1;
  3303. // If the next page is available then the next page token to be used
  3304. // in following ListInspectTemplates request.
  3305. string next_page_token = 2;
  3306. }
  3307. // Request message for DeleteInspectTemplate.
  3308. message DeleteInspectTemplateRequest {
  3309. // Required. Resource name of the organization and inspectTemplate to be deleted, for
  3310. // example `organizations/433245324/inspectTemplates/432452342` or
  3311. // projects/project-id/inspectTemplates/432452342.
  3312. string name = 1 [
  3313. (google.api.field_behavior) = REQUIRED,
  3314. (google.api.resource_reference) = {
  3315. type: "dlp.googleapis.com/InspectTemplate"
  3316. }
  3317. ];
  3318. }
  3319. // Request message for CreateJobTrigger.
  3320. message CreateJobTriggerRequest {
  3321. // Required. Parent resource name.
  3322. //
  3323. // The format of this value varies depending on whether you have [specified a
  3324. // processing
  3325. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3326. //
  3327. // + Projects scope, location specified:<br/>
  3328. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3329. // + Projects scope, no location specified (defaults to global):<br/>
  3330. // `projects/`<var>PROJECT_ID</var>
  3331. //
  3332. // The following example `parent` string specifies a parent project with the
  3333. // identifier `example-project`, and specifies the `europe-west3` location
  3334. // for processing data:
  3335. //
  3336. // parent=projects/example-project/locations/europe-west3
  3337. string parent = 1 [
  3338. (google.api.field_behavior) = REQUIRED,
  3339. (google.api.resource_reference) = {
  3340. child_type: "dlp.googleapis.com/JobTrigger"
  3341. }
  3342. ];
  3343. // Required. The JobTrigger to create.
  3344. JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED];
  3345. // The trigger id can contain uppercase and lowercase letters,
  3346. // numbers, and hyphens; that is, it must match the regular
  3347. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3348. // characters. Can be empty to allow the system to generate one.
  3349. string trigger_id = 3;
  3350. // Deprecated. This field has no effect.
  3351. string location_id = 4;
  3352. }
  3353. // Request message for ActivateJobTrigger.
  3354. message ActivateJobTriggerRequest {
  3355. // Required. Resource name of the trigger to activate, for example
  3356. // `projects/dlp-test-project/jobTriggers/53234423`.
  3357. string name = 1 [
  3358. (google.api.field_behavior) = REQUIRED,
  3359. (google.api.resource_reference) = {
  3360. type: "dlp.googleapis.com/JobTrigger"
  3361. }
  3362. ];
  3363. }
  3364. // Request message for UpdateJobTrigger.
  3365. message UpdateJobTriggerRequest {
  3366. // Required. Resource name of the project and the triggeredJob, for example
  3367. // `projects/dlp-test-project/jobTriggers/53234423`.
  3368. string name = 1 [
  3369. (google.api.field_behavior) = REQUIRED,
  3370. (google.api.resource_reference) = {
  3371. type: "dlp.googleapis.com/JobTrigger"
  3372. }
  3373. ];
  3374. // New JobTrigger value.
  3375. JobTrigger job_trigger = 2;
  3376. // Mask to control which fields get updated.
  3377. google.protobuf.FieldMask update_mask = 3;
  3378. }
  3379. // Request message for GetJobTrigger.
  3380. message GetJobTriggerRequest {
  3381. // Required. Resource name of the project and the triggeredJob, for example
  3382. // `projects/dlp-test-project/jobTriggers/53234423`.
  3383. string name = 1 [
  3384. (google.api.field_behavior) = REQUIRED,
  3385. (google.api.resource_reference) = {
  3386. type: "dlp.googleapis.com/JobTrigger"
  3387. }
  3388. ];
  3389. }
  3390. // Request message for CreateDlpJobRequest. Used to initiate long running
  3391. // jobs such as calculating risk metrics or inspecting Google Cloud
  3392. // Storage.
  3393. message CreateDlpJobRequest {
  3394. // Required. Parent resource name.
  3395. //
  3396. // The format of this value varies depending on whether you have [specified a
  3397. // processing
  3398. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3399. //
  3400. // + Projects scope, location specified:<br/>
  3401. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3402. // + Projects scope, no location specified (defaults to global):<br/>
  3403. // `projects/`<var>PROJECT_ID</var>
  3404. //
  3405. // The following example `parent` string specifies a parent project with the
  3406. // identifier `example-project`, and specifies the `europe-west3` location
  3407. // for processing data:
  3408. //
  3409. // parent=projects/example-project/locations/europe-west3
  3410. string parent = 1 [
  3411. (google.api.field_behavior) = REQUIRED,
  3412. (google.api.resource_reference) = {
  3413. child_type: "dlp.googleapis.com/DlpJob"
  3414. }
  3415. ];
  3416. // The configuration details for the specific type of job to run.
  3417. oneof job {
  3418. // An inspection job scans a storage repository for InfoTypes.
  3419. InspectJobConfig inspect_job = 2;
  3420. // A risk analysis job calculates re-identification risk metrics for a
  3421. // BigQuery table.
  3422. RiskAnalysisJobConfig risk_job = 3;
  3423. }
  3424. // The job id can contain uppercase and lowercase letters,
  3425. // numbers, and hyphens; that is, it must match the regular
  3426. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3427. // characters. Can be empty to allow the system to generate one.
  3428. string job_id = 4;
  3429. // Deprecated. This field has no effect.
  3430. string location_id = 5;
  3431. }
  3432. // Request message for ListJobTriggers.
  3433. message ListJobTriggersRequest {
  3434. // Required. Parent resource name.
  3435. //
  3436. // The format of this value varies depending on whether you have [specified a
  3437. // processing
  3438. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3439. //
  3440. // + Projects scope, location specified:<br/>
  3441. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3442. // + Projects scope, no location specified (defaults to global):<br/>
  3443. // `projects/`<var>PROJECT_ID</var>
  3444. //
  3445. // The following example `parent` string specifies a parent project with the
  3446. // identifier `example-project`, and specifies the `europe-west3` location
  3447. // for processing data:
  3448. //
  3449. // parent=projects/example-project/locations/europe-west3
  3450. string parent = 1 [
  3451. (google.api.field_behavior) = REQUIRED,
  3452. (google.api.resource_reference) = {
  3453. child_type: "dlp.googleapis.com/JobTrigger"
  3454. }
  3455. ];
  3456. // Page token to continue retrieval. Comes from previous call
  3457. // to ListJobTriggers. `order_by` field must not
  3458. // change for subsequent calls.
  3459. string page_token = 2;
  3460. // Size of the page, can be limited by a server.
  3461. int32 page_size = 3;
  3462. // Comma separated list of triggeredJob fields to order by,
  3463. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3464. // default sorting order is ascending, redundant space characters are
  3465. // insignificant.
  3466. //
  3467. // Example: `name asc,update_time, create_time desc`
  3468. //
  3469. // Supported fields are:
  3470. //
  3471. // - `create_time`: corresponds to the time the JobTrigger was created.
  3472. // - `update_time`: corresponds to the time the JobTrigger was last updated.
  3473. // - `last_run_time`: corresponds to the last time the JobTrigger ran.
  3474. // - `name`: corresponds to the JobTrigger's name.
  3475. // - `display_name`: corresponds to the JobTrigger's display name.
  3476. // - `status`: corresponds to JobTrigger's status.
  3477. string order_by = 4;
  3478. // Allows filtering.
  3479. //
  3480. // Supported syntax:
  3481. //
  3482. // * Filter expressions are made up of one or more restrictions.
  3483. // * Restrictions can be combined by `AND` or `OR` logical operators. A
  3484. // sequence of restrictions implicitly uses `AND`.
  3485. // * A restriction has the form of `{field} {operator} {value}`.
  3486. // * Supported fields/values for inspect triggers:
  3487. // - `status` - HEALTHY|PAUSED|CANCELLED
  3488. // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  3489. // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
  3490. // quotation marks. Nanoseconds are ignored.
  3491. // - 'error_count' - Number of errors that have occurred while running.
  3492. // * The operator must be `=` or `!=` for status and inspected_storage.
  3493. //
  3494. // Examples:
  3495. //
  3496. // * inspected_storage = cloud_storage AND status = HEALTHY
  3497. // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  3498. // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
  3499. // * last_run_time > \"2017-12-12T00:00:00+00:00\"
  3500. //
  3501. // The length of this field should be no more than 500 characters.
  3502. string filter = 5;
  3503. // The type of jobs. Will use `DlpJobType.INSPECT` if not set.
  3504. DlpJobType type = 6;
  3505. // Deprecated. This field has no effect.
  3506. string location_id = 7;
  3507. }
  3508. // Response message for ListJobTriggers.
  3509. message ListJobTriggersResponse {
  3510. // List of triggeredJobs, up to page_size in ListJobTriggersRequest.
  3511. repeated JobTrigger job_triggers = 1;
  3512. // If the next page is available then the next page token to be used
  3513. // in following ListJobTriggers request.
  3514. string next_page_token = 2;
  3515. }
  3516. // Request message for DeleteJobTrigger.
  3517. message DeleteJobTriggerRequest {
  3518. // Required. Resource name of the project and the triggeredJob, for example
  3519. // `projects/dlp-test-project/jobTriggers/53234423`.
  3520. string name = 1 [
  3521. (google.api.field_behavior) = REQUIRED,
  3522. (google.api.resource_reference) = {
  3523. type: "dlp.googleapis.com/JobTrigger"
  3524. }
  3525. ];
  3526. }
  3527. // Controls what and how to inspect for findings.
  3528. message InspectJobConfig {
  3529. // The data to scan.
  3530. StorageConfig storage_config = 1;
  3531. // How and what to scan for.
  3532. InspectConfig inspect_config = 2;
  3533. // If provided, will be used as the default for all values in InspectConfig.
  3534. // `inspect_config` will be merged into the values persisted as part of the
  3535. // template.
  3536. string inspect_template_name = 3;
  3537. // Actions to execute at the completion of the job.
  3538. repeated Action actions = 4;
  3539. }
  3540. // A task to execute when a data profile has been generated.
  3541. message DataProfileAction {
  3542. // If set, the detailed data profiles will be persisted to the location
  3543. // of your choice whenever updated.
  3544. message Export {
  3545. // Store all table and column profiles in an existing table or a new table
  3546. // in an existing dataset. Each re-generation will result in a new row in
  3547. // BigQuery.
  3548. BigQueryTable profile_table = 1;
  3549. }
  3550. // Send a Pub/Sub message into the given Pub/Sub topic to connect other
  3551. // systems to data profile generation. The message payload data will
  3552. // be the byte serialization of `DataProfilePubSubMessage`.
  3553. message PubSubNotification {
  3554. // The levels of detail that can be included in the Pub/Sub message.
  3555. enum DetailLevel {
  3556. // Unused.
  3557. DETAIL_LEVEL_UNSPECIFIED = 0;
  3558. // The full table data profile.
  3559. TABLE_PROFILE = 1;
  3560. // The resource name of the table.
  3561. RESOURCE_NAME = 2;
  3562. }
  3563. // Cloud Pub/Sub topic to send notifications to.
  3564. // Format is projects/{project}/topics/{topic}.
  3565. string topic = 1;
  3566. // The type of event that triggers a Pub/Sub. At most one
  3567. // `PubSubNotification` per EventType is permitted.
  3568. EventType event = 2;
  3569. // Conditions (e.g., data risk or sensitivity level) for triggering a
  3570. // Pub/Sub.
  3571. DataProfilePubSubCondition pubsub_condition = 3;
  3572. // How much data to include in the Pub/Sub message. If the user wishes to
  3573. // limit the size of the message, they can use resource_name and fetch the
  3574. // profile fields they wish to. Per table profile (not per column).
  3575. DetailLevel detail_of_message = 4;
  3576. }
  3577. // Types of event that can trigger an action.
  3578. enum EventType {
  3579. // Unused.
  3580. EVENT_TYPE_UNSPECIFIED = 0;
  3581. // New profile (not a re-profile).
  3582. NEW_PROFILE = 1;
  3583. // Changed one of the following profile metrics:
  3584. // * Table data risk score
  3585. // * Table sensitivity score
  3586. // * Table resource visibility
  3587. // * Table encryption type
  3588. // * Table predicted infoTypes
  3589. // * Table other infoTypes
  3590. CHANGED_PROFILE = 2;
  3591. // Table data risk score or sensitivity score increased.
  3592. SCORE_INCREASED = 3;
  3593. // A user (non-internal) error occurred.
  3594. ERROR_CHANGED = 4;
  3595. }
  3596. oneof action {
  3597. // Export data profiles into a provided location.
  3598. Export export_data = 1;
  3599. // Publish a message into the Pub/Sub topic.
  3600. PubSubNotification pub_sub_notification = 2;
  3601. }
  3602. }
  3603. // Configuration for setting up a job to scan resources for profile generation.
  3604. // Only one data profile configuration may exist per organization, folder,
  3605. // or project.
  3606. //
  3607. // The generated data profiles are retained according to the
  3608. // [data retention policy]
  3609. // (https://cloud.google.com/dlp/docs/data-profiles#retention).
  3610. message DataProfileJobConfig {
  3611. // The data to scan.
  3612. DataProfileLocation location = 1;
  3613. // The project that will run the scan. The DLP service
  3614. // account that exists within this project must have access to all resources
  3615. // that are profiled, and the Cloud DLP API must be enabled.
  3616. string project_id = 5;
  3617. // Detection logic for profile generation.
  3618. //
  3619. // Not all template features are used by profiles. FindingLimits,
  3620. // include_quote and exclude_info_types have no impact on
  3621. // data profiling.
  3622. //
  3623. // Multiple templates may be provided if there is data in multiple regions.
  3624. // At most one template must be specified per-region (including "global").
  3625. // Each region is scanned using the applicable template. If no region-specific
  3626. // template is specified, but a "global" template is specified, it will be
  3627. // copied to that region and used instead. If no global or region-specific
  3628. // template is provided for a region with data, that region's data will not be
  3629. // scanned.
  3630. //
  3631. // For more information, see
  3632. // https://cloud.google.com/dlp/docs/data-profiles#data_residency.
  3633. repeated string inspect_templates = 7;
  3634. // Actions to execute at the completion of the job.
  3635. repeated DataProfileAction data_profile_actions = 6;
  3636. }
  3637. // The data that will be profiled.
  3638. message DataProfileLocation {
  3639. // The location to be scanned.
  3640. oneof location {
  3641. // The ID of an organization to scan.
  3642. int64 organization_id = 1;
  3643. // The ID of the Folder within an organization to scan.
  3644. int64 folder_id = 2;
  3645. }
  3646. }
  3647. // Combines all of the information about a DLP job.
  3648. message DlpJob {
  3649. option (google.api.resource) = {
  3650. type: "dlp.googleapis.com/DlpJob"
  3651. pattern: "projects/{project}/dlpJobs/{dlp_job}"
  3652. pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}"
  3653. };
  3654. // Possible states of a job. New items may be added.
  3655. enum JobState {
  3656. // Unused.
  3657. JOB_STATE_UNSPECIFIED = 0;
  3658. // The job has not yet started.
  3659. PENDING = 1;
  3660. // The job is currently running. Once a job has finished it will transition
  3661. // to FAILED or DONE.
  3662. RUNNING = 2;
  3663. // The job is no longer running.
  3664. DONE = 3;
  3665. // The job was canceled before it could be completed.
  3666. CANCELED = 4;
  3667. // The job had an error and did not complete.
  3668. FAILED = 5;
  3669. // The job is currently accepting findings via hybridInspect.
  3670. // A hybrid job in ACTIVE state may continue to have findings added to it
  3671. // through the calling of hybridInspect. After the job has finished no more
  3672. // calls to hybridInspect may be made. ACTIVE jobs can transition to DONE.
  3673. ACTIVE = 6;
  3674. }
  3675. // The server-assigned name.
  3676. string name = 1;
  3677. // The type of job.
  3678. DlpJobType type = 2;
  3679. // State of a job.
  3680. JobState state = 3;
  3681. oneof details {
  3682. // Results from analyzing risk of a data source.
  3683. AnalyzeDataSourceRiskDetails risk_details = 4;
  3684. // Results from inspecting a data source.
  3685. InspectDataSourceDetails inspect_details = 5;
  3686. }
  3687. // Time when the job was created.
  3688. google.protobuf.Timestamp create_time = 6;
  3689. // Time when the job started.
  3690. google.protobuf.Timestamp start_time = 7;
  3691. // Time when the job finished.
  3692. google.protobuf.Timestamp end_time = 8;
  3693. // If created by a job trigger, the resource name of the trigger that
  3694. // instantiated the job.
  3695. string job_trigger_name = 10;
  3696. // A stream of errors encountered running the job.
  3697. repeated Error errors = 11;
  3698. }
  3699. // The request message for [DlpJobs.GetDlpJob][].
  3700. message GetDlpJobRequest {
  3701. // Required. The name of the DlpJob resource.
  3702. string name = 1 [
  3703. (google.api.field_behavior) = REQUIRED,
  3704. (google.api.resource_reference) = {
  3705. type: "dlp.googleapis.com/DlpJob"
  3706. }
  3707. ];
  3708. }
  3709. // The request message for listing DLP jobs.
  3710. message ListDlpJobsRequest {
  3711. // Required. Parent resource name.
  3712. //
  3713. // The format of this value varies depending on whether you have [specified a
  3714. // processing
  3715. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3716. //
  3717. // + Projects scope, location specified:<br/>
  3718. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3719. // + Projects scope, no location specified (defaults to global):<br/>
  3720. // `projects/`<var>PROJECT_ID</var>
  3721. //
  3722. // The following example `parent` string specifies a parent project with the
  3723. // identifier `example-project`, and specifies the `europe-west3` location
  3724. // for processing data:
  3725. //
  3726. // parent=projects/example-project/locations/europe-west3
  3727. string parent = 4 [
  3728. (google.api.field_behavior) = REQUIRED,
  3729. (google.api.resource_reference) = {
  3730. child_type: "dlp.googleapis.com/DlpJob"
  3731. }
  3732. ];
  3733. // Allows filtering.
  3734. //
  3735. // Supported syntax:
  3736. //
  3737. // * Filter expressions are made up of one or more restrictions.
  3738. // * Restrictions can be combined by `AND` or `OR` logical operators. A
  3739. // sequence of restrictions implicitly uses `AND`.
  3740. // * A restriction has the form of `{field} {operator} {value}`.
  3741. // * Supported fields/values for inspect jobs:
  3742. // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED
  3743. // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  3744. // - `trigger_name` - The name of the trigger that created the job.
  3745. // - 'end_time` - Corresponds to the time the job finished.
  3746. // - 'start_time` - Corresponds to the time the job finished.
  3747. // * Supported fields for risk analysis jobs:
  3748. // - `state` - RUNNING|CANCELED|FINISHED|FAILED
  3749. // - 'end_time` - Corresponds to the time the job finished.
  3750. // - 'start_time` - Corresponds to the time the job finished.
  3751. // * The operator must be `=` or `!=`.
  3752. //
  3753. // Examples:
  3754. //
  3755. // * inspected_storage = cloud_storage AND state = done
  3756. // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  3757. // * inspected_storage = cloud_storage AND (state = done OR state = canceled)
  3758. // * end_time > \"2017-12-12T00:00:00+00:00\"
  3759. //
  3760. // The length of this field should be no more than 500 characters.
  3761. string filter = 1;
  3762. // The standard list page size.
  3763. int32 page_size = 2;
  3764. // The standard list page token.
  3765. string page_token = 3;
  3766. // The type of job. Defaults to `DlpJobType.INSPECT`
  3767. DlpJobType type = 5;
  3768. // Comma separated list of fields to order by,
  3769. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3770. // default sorting order is ascending, redundant space characters are
  3771. // insignificant.
  3772. //
  3773. // Example: `name asc, end_time asc, create_time desc`
  3774. //
  3775. // Supported fields are:
  3776. //
  3777. // - `create_time`: corresponds to the time the job was created.
  3778. // - `end_time`: corresponds to the time the job ended.
  3779. // - `name`: corresponds to the job's name.
  3780. // - `state`: corresponds to `state`
  3781. string order_by = 6;
  3782. // Deprecated. This field has no effect.
  3783. string location_id = 7;
  3784. }
  3785. // The response message for listing DLP jobs.
  3786. message ListDlpJobsResponse {
  3787. // A list of DlpJobs that matches the specified filter in the request.
  3788. repeated DlpJob jobs = 1;
  3789. // The standard List next-page token.
  3790. string next_page_token = 2;
  3791. }
  3792. // The request message for canceling a DLP job.
  3793. message CancelDlpJobRequest {
  3794. // Required. The name of the DlpJob resource to be cancelled.
  3795. string name = 1 [
  3796. (google.api.field_behavior) = REQUIRED,
  3797. (google.api.resource_reference) = {
  3798. type: "dlp.googleapis.com/DlpJob"
  3799. }
  3800. ];
  3801. }
  3802. // The request message for finishing a DLP hybrid job.
  3803. message FinishDlpJobRequest {
  3804. // Required. The name of the DlpJob resource to be cancelled.
  3805. string name = 1 [
  3806. (google.api.field_behavior) = REQUIRED,
  3807. (google.api.resource_reference) = {
  3808. type: "dlp.googleapis.com/DlpJob"
  3809. }
  3810. ];
  3811. }
  3812. // The request message for deleting a DLP job.
  3813. message DeleteDlpJobRequest {
  3814. // Required. The name of the DlpJob resource to be deleted.
  3815. string name = 1 [
  3816. (google.api.field_behavior) = REQUIRED,
  3817. (google.api.resource_reference) = {
  3818. type: "dlp.googleapis.com/DlpJob"
  3819. }
  3820. ];
  3821. }
  3822. // Request message for CreateDeidentifyTemplate.
  3823. message CreateDeidentifyTemplateRequest {
  3824. // Required. Parent resource name.
  3825. //
  3826. // The format of this value varies depending on the scope of the request
  3827. // (project or organization) and whether you have [specified a processing
  3828. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3829. //
  3830. // + Projects scope, location specified:<br/>
  3831. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3832. // + Projects scope, no location specified (defaults to global):<br/>
  3833. // `projects/`<var>PROJECT_ID</var>
  3834. // + Organizations scope, location specified:<br/>
  3835. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3836. // + Organizations scope, no location specified (defaults to global):<br/>
  3837. // `organizations/`<var>ORG_ID</var>
  3838. //
  3839. // The following example `parent` string specifies a parent project with the
  3840. // identifier `example-project`, and specifies the `europe-west3` location
  3841. // for processing data:
  3842. //
  3843. // parent=projects/example-project/locations/europe-west3
  3844. string parent = 1 [
  3845. (google.api.field_behavior) = REQUIRED,
  3846. (google.api.resource_reference) = {
  3847. child_type: "dlp.googleapis.com/DeidentifyTemplate"
  3848. }
  3849. ];
  3850. // Required. The DeidentifyTemplate to create.
  3851. DeidentifyTemplate deidentify_template = 2 [(google.api.field_behavior) = REQUIRED];
  3852. // The template id can contain uppercase and lowercase letters,
  3853. // numbers, and hyphens; that is, it must match the regular
  3854. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3855. // characters. Can be empty to allow the system to generate one.
  3856. string template_id = 3;
  3857. // Deprecated. This field has no effect.
  3858. string location_id = 4;
  3859. }
  3860. // Request message for UpdateDeidentifyTemplate.
  3861. message UpdateDeidentifyTemplateRequest {
  3862. // Required. Resource name of organization and deidentify template to be updated, for
  3863. // example `organizations/433245324/deidentifyTemplates/432452342` or
  3864. // projects/project-id/deidentifyTemplates/432452342.
  3865. string name = 1 [
  3866. (google.api.field_behavior) = REQUIRED,
  3867. (google.api.resource_reference) = {
  3868. type: "dlp.googleapis.com/DeidentifyTemplate"
  3869. }
  3870. ];
  3871. // New DeidentifyTemplate value.
  3872. DeidentifyTemplate deidentify_template = 2;
  3873. // Mask to control which fields get updated.
  3874. google.protobuf.FieldMask update_mask = 3;
  3875. }
  3876. // Request message for GetDeidentifyTemplate.
  3877. message GetDeidentifyTemplateRequest {
  3878. // Required. Resource name of the organization and deidentify template to be read, for
  3879. // example `organizations/433245324/deidentifyTemplates/432452342` or
  3880. // projects/project-id/deidentifyTemplates/432452342.
  3881. string name = 1 [
  3882. (google.api.field_behavior) = REQUIRED,
  3883. (google.api.resource_reference) = {
  3884. type: "dlp.googleapis.com/DeidentifyTemplate"
  3885. }
  3886. ];
  3887. }
  3888. // Request message for ListDeidentifyTemplates.
  3889. message ListDeidentifyTemplatesRequest {
  3890. // Required. Parent resource name.
  3891. //
  3892. // The format of this value varies depending on the scope of the request
  3893. // (project or organization) and whether you have [specified a processing
  3894. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3895. //
  3896. // + Projects scope, location specified:<br/>
  3897. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3898. // + Projects scope, no location specified (defaults to global):<br/>
  3899. // `projects/`<var>PROJECT_ID</var>
  3900. // + Organizations scope, location specified:<br/>
  3901. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3902. // + Organizations scope, no location specified (defaults to global):<br/>
  3903. // `organizations/`<var>ORG_ID</var>
  3904. //
  3905. // The following example `parent` string specifies a parent project with the
  3906. // identifier `example-project`, and specifies the `europe-west3` location
  3907. // for processing data:
  3908. //
  3909. // parent=projects/example-project/locations/europe-west3
  3910. string parent = 1 [
  3911. (google.api.field_behavior) = REQUIRED,
  3912. (google.api.resource_reference) = {
  3913. child_type: "dlp.googleapis.com/DeidentifyTemplate"
  3914. }
  3915. ];
  3916. // Page token to continue retrieval. Comes from previous call
  3917. // to `ListDeidentifyTemplates`.
  3918. string page_token = 2;
  3919. // Size of the page, can be limited by the server. If zero server returns
  3920. // a page of max size 100.
  3921. int32 page_size = 3;
  3922. // Comma separated list of fields to order by,
  3923. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3924. // default sorting order is ascending, redundant space characters are
  3925. // insignificant.
  3926. //
  3927. // Example: `name asc,update_time, create_time desc`
  3928. //
  3929. // Supported fields are:
  3930. //
  3931. // - `create_time`: corresponds to the time the template was created.
  3932. // - `update_time`: corresponds to the time the template was last updated.
  3933. // - `name`: corresponds to the template's name.
  3934. // - `display_name`: corresponds to the template's display name.
  3935. string order_by = 4;
  3936. // Deprecated. This field has no effect.
  3937. string location_id = 5;
  3938. }
  3939. // Response message for ListDeidentifyTemplates.
  3940. message ListDeidentifyTemplatesResponse {
  3941. // List of deidentify templates, up to page_size in
  3942. // ListDeidentifyTemplatesRequest.
  3943. repeated DeidentifyTemplate deidentify_templates = 1;
  3944. // If the next page is available then the next page token to be used
  3945. // in following ListDeidentifyTemplates request.
  3946. string next_page_token = 2;
  3947. }
  3948. // Request message for DeleteDeidentifyTemplate.
  3949. message DeleteDeidentifyTemplateRequest {
  3950. // Required. Resource name of the organization and deidentify template to be deleted,
  3951. // for example `organizations/433245324/deidentifyTemplates/432452342` or
  3952. // projects/project-id/deidentifyTemplates/432452342.
  3953. string name = 1 [
  3954. (google.api.field_behavior) = REQUIRED,
  3955. (google.api.resource_reference) = {
  3956. type: "dlp.googleapis.com/DeidentifyTemplate"
  3957. }
  3958. ];
  3959. }
  3960. // Configuration for a custom dictionary created from a data source of any size
  3961. // up to the maximum size defined in the
  3962. // [limits](https://cloud.google.com/dlp/limits) page. The artifacts of
  3963. // dictionary creation are stored in the specified Cloud Storage
  3964. // location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries
  3965. // that satisfy the size requirements.
  3966. message LargeCustomDictionaryConfig {
  3967. // Location to store dictionary artifacts in Cloud Storage. These files
  3968. // will only be accessible by project owners and the DLP API. If any of these
  3969. // artifacts are modified, the dictionary is considered invalid and can no
  3970. // longer be used.
  3971. CloudStoragePath output_path = 1;
  3972. oneof source {
  3973. // Set of files containing newline-delimited lists of dictionary phrases.
  3974. CloudStorageFileSet cloud_storage_file_set = 2;
  3975. // Field in a BigQuery table where each cell represents a dictionary phrase.
  3976. BigQueryField big_query_field = 3;
  3977. }
  3978. }
  3979. // Summary statistics of a custom dictionary.
  3980. message LargeCustomDictionaryStats {
  3981. // Approximate number of distinct phrases in the dictionary.
  3982. int64 approx_num_phrases = 1;
  3983. }
  3984. // Configuration for stored infoTypes. All fields and subfield are provided
  3985. // by the user. For more information, see
  3986. // https://cloud.google.com/dlp/docs/creating-custom-infotypes.
  3987. message StoredInfoTypeConfig {
  3988. // Display name of the StoredInfoType (max 256 characters).
  3989. string display_name = 1;
  3990. // Description of the StoredInfoType (max 256 characters).
  3991. string description = 2;
  3992. // Stored infotype types.
  3993. oneof type {
  3994. // StoredInfoType where findings are defined by a dictionary of phrases.
  3995. LargeCustomDictionaryConfig large_custom_dictionary = 3;
  3996. // Store dictionary-based CustomInfoType.
  3997. CustomInfoType.Dictionary dictionary = 4;
  3998. // Store regular expression-based StoredInfoType.
  3999. CustomInfoType.Regex regex = 5;
  4000. }
  4001. }
  4002. // Statistics for a StoredInfoType.
  4003. message StoredInfoTypeStats {
  4004. // Stat types
  4005. oneof type {
  4006. // StoredInfoType where findings are defined by a dictionary of phrases.
  4007. LargeCustomDictionaryStats large_custom_dictionary = 1;
  4008. }
  4009. }
  4010. // Version of a StoredInfoType, including the configuration used to build it,
  4011. // create timestamp, and current state.
  4012. message StoredInfoTypeVersion {
  4013. // StoredInfoType configuration.
  4014. StoredInfoTypeConfig config = 1;
  4015. // Create timestamp of the version. Read-only, determined by the system
  4016. // when the version is created.
  4017. google.protobuf.Timestamp create_time = 2;
  4018. // Stored info type version state. Read-only, updated by the system
  4019. // during dictionary creation.
  4020. StoredInfoTypeState state = 3;
  4021. // Errors that occurred when creating this storedInfoType version, or
  4022. // anomalies detected in the storedInfoType data that render it unusable. Only
  4023. // the five most recent errors will be displayed, with the most recent error
  4024. // appearing first.
  4025. //
  4026. // For example, some of the data for stored custom dictionaries is put in
  4027. // the user's Cloud Storage bucket, and if this data is modified or
  4028. // deleted by the user or another system, the dictionary becomes invalid.
  4029. //
  4030. // If any errors occur, fix the problem indicated by the error message and
  4031. // use the UpdateStoredInfoType API method to create another version of the
  4032. // storedInfoType to continue using it, reusing the same `config` if it was
  4033. // not the source of the error.
  4034. repeated Error errors = 4;
  4035. // Statistics about this storedInfoType version.
  4036. StoredInfoTypeStats stats = 5;
  4037. }
  4038. // StoredInfoType resource message that contains information about the current
  4039. // version and any pending updates.
  4040. message StoredInfoType {
  4041. option (google.api.resource) = {
  4042. type: "dlp.googleapis.com/StoredInfoType"
  4043. pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}"
  4044. pattern: "projects/{project}/storedInfoTypes/{stored_info_type}"
  4045. pattern: "organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}"
  4046. pattern: "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}"
  4047. };
  4048. // Resource name.
  4049. string name = 1;
  4050. // Current version of the stored info type.
  4051. StoredInfoTypeVersion current_version = 2;
  4052. // Pending versions of the stored info type. Empty if no versions are
  4053. // pending.
  4054. repeated StoredInfoTypeVersion pending_versions = 3;
  4055. }
  4056. // Request message for CreateStoredInfoType.
  4057. message CreateStoredInfoTypeRequest {
  4058. // Required. Parent resource name.
  4059. //
  4060. // The format of this value varies depending on the scope of the request
  4061. // (project or organization) and whether you have [specified a processing
  4062. // location](https://cloud.google.com/dlp/docs/specifying-location):
  4063. //
  4064. // + Projects scope, location specified:<br/>
  4065. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  4066. // + Projects scope, no location specified (defaults to global):<br/>
  4067. // `projects/`<var>PROJECT_ID</var>
  4068. // + Organizations scope, location specified:<br/>
  4069. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  4070. // + Organizations scope, no location specified (defaults to global):<br/>
  4071. // `organizations/`<var>ORG_ID</var>
  4072. //
  4073. // The following example `parent` string specifies a parent project with the
  4074. // identifier `example-project`, and specifies the `europe-west3` location
  4075. // for processing data:
  4076. //
  4077. // parent=projects/example-project/locations/europe-west3
  4078. string parent = 1 [
  4079. (google.api.field_behavior) = REQUIRED,
  4080. (google.api.resource_reference) = {
  4081. child_type: "dlp.googleapis.com/StoredInfoType"
  4082. }
  4083. ];
  4084. // Required. Configuration of the storedInfoType to create.
  4085. StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED];
  4086. // The storedInfoType ID can contain uppercase and lowercase letters,
  4087. // numbers, and hyphens; that is, it must match the regular
  4088. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  4089. // characters. Can be empty to allow the system to generate one.
  4090. string stored_info_type_id = 3;
  4091. // Deprecated. This field has no effect.
  4092. string location_id = 4;
  4093. }
  4094. // Request message for UpdateStoredInfoType.
  4095. message UpdateStoredInfoTypeRequest {
  4096. // Required. Resource name of organization and storedInfoType to be updated, for
  4097. // example `organizations/433245324/storedInfoTypes/432452342` or
  4098. // projects/project-id/storedInfoTypes/432452342.
  4099. string name = 1 [
  4100. (google.api.field_behavior) = REQUIRED,
  4101. (google.api.resource_reference) = {
  4102. type: "dlp.googleapis.com/StoredInfoType"
  4103. }
  4104. ];
  4105. // Updated configuration for the storedInfoType. If not provided, a new
  4106. // version of the storedInfoType will be created with the existing
  4107. // configuration.
  4108. StoredInfoTypeConfig config = 2;
  4109. // Mask to control which fields get updated.
  4110. google.protobuf.FieldMask update_mask = 3;
  4111. }
  4112. // Request message for GetStoredInfoType.
  4113. message GetStoredInfoTypeRequest {
  4114. // Required. Resource name of the organization and storedInfoType to be read, for
  4115. // example `organizations/433245324/storedInfoTypes/432452342` or
  4116. // projects/project-id/storedInfoTypes/432452342.
  4117. string name = 1 [
  4118. (google.api.field_behavior) = REQUIRED,
  4119. (google.api.resource_reference) = {
  4120. type: "dlp.googleapis.com/StoredInfoType"
  4121. }
  4122. ];
  4123. }
  4124. // Request message for ListStoredInfoTypes.
  4125. message ListStoredInfoTypesRequest {
  4126. // Required. Parent resource name.
  4127. //
  4128. // The format of this value varies depending on the scope of the request
  4129. // (project or organization) and whether you have [specified a processing
  4130. // location](https://cloud.google.com/dlp/docs/specifying-location):
  4131. //
  4132. // + Projects scope, location specified:<br/>
  4133. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  4134. // + Projects scope, no location specified (defaults to global):<br/>
  4135. // `projects/`<var>PROJECT_ID</var>
  4136. //
  4137. // The following example `parent` string specifies a parent project with the
  4138. // identifier `example-project`, and specifies the `europe-west3` location
  4139. // for processing data:
  4140. //
  4141. // parent=projects/example-project/locations/europe-west3
  4142. string parent = 1 [
  4143. (google.api.field_behavior) = REQUIRED,
  4144. (google.api.resource_reference) = {
  4145. child_type: "dlp.googleapis.com/StoredInfoType"
  4146. }
  4147. ];
  4148. // Page token to continue retrieval. Comes from previous call
  4149. // to `ListStoredInfoTypes`.
  4150. string page_token = 2;
  4151. // Size of the page, can be limited by the server. If zero server returns
  4152. // a page of max size 100.
  4153. int32 page_size = 3;
  4154. // Comma separated list of fields to order by,
  4155. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  4156. // default sorting order is ascending, redundant space characters are
  4157. // insignificant.
  4158. //
  4159. // Example: `name asc, display_name, create_time desc`
  4160. //
  4161. // Supported fields are:
  4162. //
  4163. // - `create_time`: corresponds to the time the most recent version of the
  4164. // resource was created.
  4165. // - `state`: corresponds to the state of the resource.
  4166. // - `name`: corresponds to resource name.
  4167. // - `display_name`: corresponds to info type's display name.
  4168. string order_by = 4;
  4169. // Deprecated. This field has no effect.
  4170. string location_id = 5;
  4171. }
  4172. // Response message for ListStoredInfoTypes.
  4173. message ListStoredInfoTypesResponse {
  4174. // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
  4175. repeated StoredInfoType stored_info_types = 1;
  4176. // If the next page is available then the next page token to be used
  4177. // in following ListStoredInfoTypes request.
  4178. string next_page_token = 2;
  4179. }
  4180. // Request message for DeleteStoredInfoType.
  4181. message DeleteStoredInfoTypeRequest {
  4182. // Required. Resource name of the organization and storedInfoType to be deleted, for
  4183. // example `organizations/433245324/storedInfoTypes/432452342` or
  4184. // projects/project-id/storedInfoTypes/432452342.
  4185. string name = 1 [
  4186. (google.api.field_behavior) = REQUIRED,
  4187. (google.api.resource_reference) = {
  4188. type: "dlp.googleapis.com/StoredInfoType"
  4189. }
  4190. ];
  4191. }
  4192. // Request to search for potentially sensitive info in a custom location.
  4193. message HybridInspectJobTriggerRequest {
  4194. // Required. Resource name of the trigger to execute a hybrid inspect on, for example
  4195. // `projects/dlp-test-project/jobTriggers/53234423`.
  4196. string name = 1 [
  4197. (google.api.field_behavior) = REQUIRED,
  4198. (google.api.resource_reference) = {
  4199. type: "dlp.googleapis.com/JobTrigger"
  4200. }
  4201. ];
  4202. // The item to inspect.
  4203. HybridContentItem hybrid_item = 3;
  4204. }
  4205. // Request to search for potentially sensitive info in a custom location.
  4206. message HybridInspectDlpJobRequest {
  4207. // Required. Resource name of the job to execute a hybrid inspect on, for example
  4208. // `projects/dlp-test-project/dlpJob/53234423`.
  4209. string name = 1 [
  4210. (google.api.field_behavior) = REQUIRED,
  4211. (google.api.resource_reference) = {
  4212. type: "dlp.googleapis.com/DlpJob"
  4213. }
  4214. ];
  4215. // The item to inspect.
  4216. HybridContentItem hybrid_item = 3;
  4217. }
  4218. // An individual hybrid item to inspect. Will be stored temporarily during
  4219. // processing.
  4220. message HybridContentItem {
  4221. // The item to inspect.
  4222. ContentItem item = 1;
  4223. // Supplementary information that will be added to each finding.
  4224. HybridFindingDetails finding_details = 2;
  4225. }
  4226. // Populate to associate additional data with each finding.
  4227. message HybridFindingDetails {
  4228. // Details about the container where the content being inspected is from.
  4229. Container container_details = 1;
  4230. // Offset in bytes of the line, from the beginning of the file, where the
  4231. // finding is located. Populate if the item being scanned is only part of a
  4232. // bigger item, such as a shard of a file and you want to track the absolute
  4233. // position of the finding.
  4234. int64 file_offset = 2;
  4235. // Offset of the row for tables. Populate if the row(s) being scanned are
  4236. // part of a bigger dataset and you want to keep track of their absolute
  4237. // position.
  4238. int64 row_offset = 3;
  4239. // If the container is a table, additional information to make findings
  4240. // meaningful such as the columns that are primary keys. If not known ahead
  4241. // of time, can also be set within each inspect hybrid call and the two
  4242. // will be merged. Note that identifying_fields will only be stored to
  4243. // BigQuery, and only if the BigQuery action has been included.
  4244. TableOptions table_options = 4;
  4245. // Labels to represent user provided metadata about the data being inspected.
  4246. // If configured by the job, some key values may be required.
  4247. // The labels associated with `Finding`'s produced by hybrid
  4248. // inspection.
  4249. //
  4250. // Label keys must be between 1 and 63 characters long and must conform
  4251. // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
  4252. //
  4253. // Label values must be between 0 and 63 characters long and must conform
  4254. // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
  4255. //
  4256. // No more than 10 labels can be associated with a given finding.
  4257. //
  4258. // Examples:
  4259. // * `"environment" : "production"`
  4260. // * `"pipeline" : "etl"`
  4261. map<string, string> labels = 5;
  4262. }
  4263. // Quota exceeded errors will be thrown once quota has been met.
  4264. message HybridInspectResponse {
  4265. }
  4266. // Operators available for comparing the value of fields.
  4267. enum RelationalOperator {
  4268. // Unused
  4269. RELATIONAL_OPERATOR_UNSPECIFIED = 0;
  4270. // Equal. Attempts to match even with incompatible types.
  4271. EQUAL_TO = 1;
  4272. // Not equal to. Attempts to match even with incompatible types.
  4273. NOT_EQUAL_TO = 2;
  4274. // Greater than.
  4275. GREATER_THAN = 3;
  4276. // Less than.
  4277. LESS_THAN = 4;
  4278. // Greater than or equals.
  4279. GREATER_THAN_OR_EQUALS = 5;
  4280. // Less than or equals.
  4281. LESS_THAN_OR_EQUALS = 6;
  4282. // Exists
  4283. EXISTS = 7;
  4284. }
  4285. // Type of the match which can be applied to different ways of matching, like
  4286. // Dictionary, regular expression and intersecting with findings of another
  4287. // info type.
  4288. enum MatchingType {
  4289. // Invalid.
  4290. MATCHING_TYPE_UNSPECIFIED = 0;
  4291. // Full match.
  4292. //
  4293. // - Dictionary: join of Dictionary results matched complete finding quote
  4294. // - Regex: all regex matches fill a finding quote start to end
  4295. // - Exclude info type: completely inside affecting info types findings
  4296. MATCHING_TYPE_FULL_MATCH = 1;
  4297. // Partial match.
  4298. //
  4299. // - Dictionary: at least one of the tokens in the finding matches
  4300. // - Regex: substring of the finding matches
  4301. // - Exclude info type: intersects with affecting info types findings
  4302. MATCHING_TYPE_PARTIAL_MATCH = 2;
  4303. // Inverse match.
  4304. //
  4305. // - Dictionary: no tokens in the finding match the dictionary
  4306. // - Regex: finding doesn't match the regex
  4307. // - Exclude info type: no intersection with affecting info types findings
  4308. MATCHING_TYPE_INVERSE_MATCH = 3;
  4309. }
  4310. // Deprecated and unused.
  4311. enum ContentOption {
  4312. // Includes entire content of a file or a data stream.
  4313. CONTENT_UNSPECIFIED = 0;
  4314. // Text content within the data, excluding any metadata.
  4315. CONTENT_TEXT = 1;
  4316. // Images found in the data.
  4317. CONTENT_IMAGE = 2;
  4318. }
  4319. // Type of metadata containing the finding.
  4320. enum MetadataType {
  4321. // Unused
  4322. METADATATYPE_UNSPECIFIED = 0;
  4323. // General file metadata provided by Cloud Storage.
  4324. STORAGE_METADATA = 2;
  4325. }
  4326. // Parts of the APIs which use certain infoTypes.
  4327. enum InfoTypeSupportedBy {
  4328. // Unused.
  4329. ENUM_TYPE_UNSPECIFIED = 0;
  4330. // Supported by the inspect operations.
  4331. INSPECT = 1;
  4332. // Supported by the risk analysis operations.
  4333. RISK_ANALYSIS = 2;
  4334. }
  4335. // An enum to represent the various types of DLP jobs.
  4336. enum DlpJobType {
  4337. // Defaults to INSPECT_JOB.
  4338. DLP_JOB_TYPE_UNSPECIFIED = 0;
  4339. // The job inspected Google Cloud for sensitive data.
  4340. INSPECT_JOB = 1;
  4341. // The job executed a Risk Analysis computation.
  4342. RISK_ANALYSIS_JOB = 2;
  4343. }
  4344. // State of a StoredInfoType version.
  4345. enum StoredInfoTypeState {
  4346. // Unused
  4347. STORED_INFO_TYPE_STATE_UNSPECIFIED = 0;
  4348. // StoredInfoType version is being created.
  4349. PENDING = 1;
  4350. // StoredInfoType version is ready for use.
  4351. READY = 2;
  4352. // StoredInfoType creation failed. All relevant error messages are returned in
  4353. // the `StoredInfoTypeVersion` message.
  4354. FAILED = 3;
  4355. // StoredInfoType is no longer valid because artifacts stored in
  4356. // user-controlled storage were modified. To fix an invalid StoredInfoType,
  4357. // use the `UpdateStoredInfoType` method to create a new version.
  4358. INVALID = 4;
  4359. }
  4360. // Score is a summary of all elements in the data profile.
  4361. // A higher number means more risk.
  4362. message DataRiskLevel {
  4363. // Various score levels for resources.
  4364. enum DataRiskLevelScore {
  4365. // Unused.
  4366. RISK_SCORE_UNSPECIFIED = 0;
  4367. // Low risk - Lower indication of sensitive data that appears to have
  4368. // additional access restrictions in place or no indication of sensitive
  4369. // data found.
  4370. RISK_LOW = 10;
  4371. // Medium risk - Sensitive data may be present but additional access or fine
  4372. // grain access restrictions appear to be present. Consider limiting
  4373. // access even further or transform data to mask.
  4374. RISK_MODERATE = 20;
  4375. // High risk – SPII may be present. Access controls may include public
  4376. // ACLs. Exfiltration of data may lead to user data loss. Re-identification
  4377. // of users may be possible. Consider limiting usage and or removing SPII.
  4378. RISK_HIGH = 30;
  4379. }
  4380. // The score applied to the resource.
  4381. DataRiskLevelScore score = 1;
  4382. }
  4383. // How broadly a resource has been shared. New items may be added over time.
  4384. // A higher number means more restricted.
  4385. enum ResourceVisibility {
  4386. // Unused.
  4387. RESOURCE_VISIBILITY_UNSPECIFIED = 0;
  4388. // Visible to any user.
  4389. RESOURCE_VISIBILITY_PUBLIC = 10;
  4390. // Visible only to specific users.
  4391. RESOURCE_VISIBILITY_RESTRICTED = 20;
  4392. }
  4393. // Snapshot of the configurations used to generate the profile.
  4394. message DataProfileConfigSnapshot {
  4395. // A copy of the inspection config used to generate this profile. This
  4396. // is a copy of the inspect_template specified in `DataProfileJobConfig`.
  4397. InspectConfig inspect_config = 2;
  4398. // A copy of the configuration used to generate this profile.
  4399. DataProfileJobConfig data_profile_job = 3;
  4400. }
  4401. // The profile for a scanned table.
  4402. message TableDataProfile {
  4403. // Possible states of a profile. New items may be added.
  4404. enum State {
  4405. // Unused.
  4406. STATE_UNSPECIFIED = 0;
  4407. // The profile is currently running. Once a profile has finished it will
  4408. // transition to DONE.
  4409. RUNNING = 1;
  4410. // The profile is no longer generating.
  4411. // If profile_status.status.code is 0, the profile succeeded, otherwise, it
  4412. // failed.
  4413. DONE = 2;
  4414. }
  4415. // The name of the profile.
  4416. string name = 1;
  4417. // The resource name to the project data profile for this table.
  4418. string project_data_profile = 2;
  4419. // The GCP project ID that owns the BigQuery dataset.
  4420. string dataset_project_id = 24;
  4421. // The BigQuery location where the dataset's data is stored.
  4422. // See https://cloud.google.com/bigquery/docs/locations for supported
  4423. // locations.
  4424. string dataset_location = 29;
  4425. // The BigQuery dataset ID.
  4426. string dataset_id = 25;
  4427. // The BigQuery table ID.
  4428. string table_id = 26;
  4429. // The resource name of the table.
  4430. // https://cloud.google.com/apis/design/resource_names#full_resource_name
  4431. string full_resource = 3;
  4432. // Success or error status from the most recent profile generation attempt.
  4433. // May be empty if the profile is still being generated.
  4434. ProfileStatus profile_status = 21;
  4435. // State of a profile.
  4436. State state = 22;
  4437. // The sensitivity score of this table.
  4438. SensitivityScore sensitivity_score = 5;
  4439. // The data risk level of this table.
  4440. DataRiskLevel data_risk_level = 6;
  4441. // The infoTypes predicted from this table's data.
  4442. repeated InfoTypeSummary predicted_info_types = 27;
  4443. // Other infoTypes found in this table's data.
  4444. repeated OtherInfoTypeSummary other_info_types = 28;
  4445. // The snapshot of the configurations used to generate the profile.
  4446. DataProfileConfigSnapshot config_snapshot = 7;
  4447. // The time when this table was last modified
  4448. google.protobuf.Timestamp last_modified_time = 8;
  4449. // Optional. The time when this table expires.
  4450. google.protobuf.Timestamp expiration_time = 9;
  4451. // The number of columns profiled in the table.
  4452. int64 scanned_column_count = 10;
  4453. // The number of columns skipped in the table because of an error.
  4454. int64 failed_column_count = 11;
  4455. // The size of the table when the profile was generated.
  4456. int64 table_size_bytes = 12;
  4457. // Number of rows in the table when the profile was generated.
  4458. // This will not be populated for BigLake tables.
  4459. int64 row_count = 13;
  4460. // How the table is encrypted.
  4461. EncryptionStatus encryption_status = 14;
  4462. // How broadly a resource has been shared.
  4463. ResourceVisibility resource_visibility = 15;
  4464. // The last time the profile was generated.
  4465. google.protobuf.Timestamp profile_last_generated = 16;
  4466. // The labels applied to the resource at the time the profile was generated.
  4467. map<string, string> resource_labels = 17;
  4468. // The time at which the table was created.
  4469. google.protobuf.Timestamp create_time = 23;
  4470. }
  4471. message ProfileStatus {
  4472. // Profiling status code and optional message
  4473. google.rpc.Status status = 1;
  4474. // Time when the profile generation status was updated
  4475. google.protobuf.Timestamp timestamp = 3;
  4476. }
  4477. // How a resource is encrypted.
  4478. enum EncryptionStatus {
  4479. // Unused.
  4480. ENCRYPTION_STATUS_UNSPECIFIED = 0;
  4481. // Google manages server-side encryption keys on your behalf.
  4482. ENCRYPTION_GOOGLE_MANAGED = 1;
  4483. // Customer provides the key.
  4484. ENCRYPTION_CUSTOMER_MANAGED = 2;
  4485. }
  4486. // The infoType details for this column.
  4487. message InfoTypeSummary {
  4488. // The infoType.
  4489. InfoType info_type = 1;
  4490. // Not populated for predicted infotypes.
  4491. int32 estimated_prevalence = 2 [deprecated = true];
  4492. }
  4493. // Infotype details for other infoTypes found within a column.
  4494. message OtherInfoTypeSummary {
  4495. // The other infoType.
  4496. InfoType info_type = 1;
  4497. // Approximate percentage of non-null rows that contained data detected by
  4498. // this infotype.
  4499. int32 estimated_prevalence = 2;
  4500. }
  4501. // A condition for determining whether a Pub/Sub should be triggered.
  4502. message DataProfilePubSubCondition {
  4503. // Various score levels for resources.
  4504. enum ProfileScoreBucket {
  4505. // Unused.
  4506. PROFILE_SCORE_BUCKET_UNSPECIFIED = 0;
  4507. // High risk/sensitivity detected.
  4508. HIGH = 1;
  4509. // Medium or high risk/sensitivity detected.
  4510. MEDIUM_OR_HIGH = 2;
  4511. }
  4512. // A condition consisting of a value.
  4513. message PubSubCondition {
  4514. // The value for the condition to trigger.
  4515. oneof value {
  4516. // The minimum data risk score that triggers the condition.
  4517. ProfileScoreBucket minimum_risk_score = 1;
  4518. // The minimum sensitivity level that triggers the condition.
  4519. ProfileScoreBucket minimum_sensitivity_score = 2;
  4520. }
  4521. }
  4522. // An expression, consisting of an operator and conditions.
  4523. message PubSubExpressions {
  4524. // Logical operators for conditional checks.
  4525. enum PubSubLogicalOperator {
  4526. // Unused.
  4527. LOGICAL_OPERATOR_UNSPECIFIED = 0;
  4528. // Conditional OR.
  4529. OR = 1;
  4530. // Conditional AND.
  4531. AND = 2;
  4532. }
  4533. // The operator to apply to the collection of conditions.
  4534. PubSubLogicalOperator logical_operator = 1;
  4535. // Conditions to apply to the expression.
  4536. repeated PubSubCondition conditions = 2;
  4537. }
  4538. // An expression.
  4539. PubSubExpressions expressions = 1;
  4540. }
  4541. // Pub/Sub topic message for a DataProfileAction.PubSubNotification event.
  4542. // To receive a message of protocol buffer schema type, convert the message data
  4543. // to an object of this proto class.
  4544. message DataProfilePubSubMessage {
  4545. // If `DetailLevel` is `TABLE_PROFILE` this will be fully populated.
  4546. // Otherwise, if `DetailLevel` is `RESOURCE_NAME`, then only `name` and
  4547. // `full_resource` will be populated.
  4548. TableDataProfile profile = 1;
  4549. // The event that caused the Pub/Sub message to be sent.
  4550. DataProfileAction.EventType event = 2;
  4551. }