dlp.proto 157 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379
  1. // Copyright 2020 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/client.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/api/resource.proto";
  19. import "google/privacy/dlp/v2/storage.proto";
  20. import "google/protobuf/duration.proto";
  21. import "google/protobuf/empty.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/protobuf/timestamp.proto";
  24. import "google/rpc/status.proto";
  25. import "google/type/date.proto";
  26. import "google/type/dayofweek.proto";
  27. import "google/type/timeofday.proto";
  28. import "google/api/annotations.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 the 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 re-using 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 re-using 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. };
  343. option (google.api.method_signature) = "parent,job_trigger";
  344. }
  345. // Updates a job trigger.
  346. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  347. rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) {
  348. option (google.api.http) = {
  349. patch: "/v2/{name=projects/*/jobTriggers/*}"
  350. body: "*"
  351. additional_bindings {
  352. patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
  353. body: "*"
  354. }
  355. };
  356. option (google.api.method_signature) = "name,job_trigger,update_mask";
  357. }
  358. // Inspect hybrid content and store findings to a trigger. The inspection
  359. // will be processed asynchronously. To review the findings monitor the
  360. // jobs within the trigger.
  361. // Early access feature is in a pre-release state and might change or have
  362. // limited support. For more information, see
  363. // https://cloud.google.com/products#product-launch-stages.
  364. rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) {
  365. option (google.api.http) = {
  366. post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect"
  367. body: "*"
  368. };
  369. option (google.api.method_signature) = "name";
  370. }
  371. // Gets a job trigger.
  372. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  373. rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) {
  374. option (google.api.http) = {
  375. get: "/v2/{name=projects/*/jobTriggers/*}"
  376. additional_bindings {
  377. get: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
  378. }
  379. };
  380. option (google.api.method_signature) = "name";
  381. }
  382. // Lists job triggers.
  383. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  384. rpc ListJobTriggers(ListJobTriggersRequest) returns (ListJobTriggersResponse) {
  385. option (google.api.http) = {
  386. get: "/v2/{parent=projects/*}/jobTriggers"
  387. additional_bindings {
  388. get: "/v2/{parent=projects/*/locations/*}/jobTriggers"
  389. }
  390. };
  391. option (google.api.method_signature) = "parent";
  392. }
  393. // Deletes a job trigger.
  394. // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
  395. rpc DeleteJobTrigger(DeleteJobTriggerRequest) returns (google.protobuf.Empty) {
  396. option (google.api.http) = {
  397. delete: "/v2/{name=projects/*/jobTriggers/*}"
  398. additional_bindings {
  399. delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
  400. }
  401. };
  402. option (google.api.method_signature) = "name";
  403. }
  404. // Activate a job trigger. Causes the immediate execute of a trigger
  405. // instead of waiting on the trigger event to occur.
  406. rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) {
  407. option (google.api.http) = {
  408. post: "/v2/{name=projects/*/jobTriggers/*}:activate"
  409. body: "*"
  410. additional_bindings {
  411. post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate"
  412. body: "*"
  413. }
  414. };
  415. }
  416. // Creates a new job to inspect storage or calculate risk metrics.
  417. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  418. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  419. //
  420. // When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
  421. // system will automatically choose what detectors to run. By default this may
  422. // be all types, but may change over time as detectors are updated.
  423. rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) {
  424. option (google.api.http) = {
  425. post: "/v2/{parent=projects/*}/dlpJobs"
  426. body: "*"
  427. additional_bindings {
  428. post: "/v2/{parent=projects/*/locations/*}/dlpJobs"
  429. body: "*"
  430. }
  431. };
  432. option (google.api.method_signature) = "parent,inspect_job";
  433. option (google.api.method_signature) = "parent,risk_job";
  434. }
  435. // Lists DlpJobs that match the specified filter in the request.
  436. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  437. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  438. rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) {
  439. option (google.api.http) = {
  440. get: "/v2/{parent=projects/*}/dlpJobs"
  441. additional_bindings {
  442. get: "/v2/{parent=projects/*/locations/*}/dlpJobs"
  443. }
  444. };
  445. option (google.api.method_signature) = "parent";
  446. }
  447. // Gets the latest state of a long-running DlpJob.
  448. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  449. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  450. rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) {
  451. option (google.api.http) = {
  452. get: "/v2/{name=projects/*/dlpJobs/*}"
  453. additional_bindings {
  454. get: "/v2/{name=projects/*/locations/*/dlpJobs/*}"
  455. }
  456. };
  457. option (google.api.method_signature) = "name";
  458. }
  459. // Deletes a long-running DlpJob. This method indicates that the client is
  460. // no longer interested in the DlpJob result. The job will be cancelled if
  461. // possible.
  462. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  463. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  464. rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) {
  465. option (google.api.http) = {
  466. delete: "/v2/{name=projects/*/dlpJobs/*}"
  467. additional_bindings {
  468. delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}"
  469. }
  470. };
  471. option (google.api.method_signature) = "name";
  472. }
  473. // Starts asynchronous cancellation on a long-running DlpJob. The server
  474. // makes a best effort to cancel the DlpJob, but success is not
  475. // guaranteed.
  476. // See https://cloud.google.com/dlp/docs/inspecting-storage and
  477. // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
  478. rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) {
  479. option (google.api.http) = {
  480. post: "/v2/{name=projects/*/dlpJobs/*}:cancel"
  481. body: "*"
  482. additional_bindings {
  483. post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel"
  484. body: "*"
  485. }
  486. };
  487. }
  488. // Creates a pre-built stored infoType to be used for inspection.
  489. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  490. // learn more.
  491. rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) {
  492. option (google.api.http) = {
  493. post: "/v2/{parent=organizations/*}/storedInfoTypes"
  494. body: "*"
  495. additional_bindings {
  496. post: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes"
  497. body: "*"
  498. }
  499. additional_bindings {
  500. post: "/v2/{parent=projects/*}/storedInfoTypes"
  501. body: "*"
  502. }
  503. additional_bindings {
  504. post: "/v2/{parent=projects/*/locations/*}/storedInfoTypes"
  505. body: "*"
  506. }
  507. };
  508. option (google.api.method_signature) = "parent,config";
  509. }
  510. // Updates the stored infoType by creating a new version. The existing version
  511. // will continue to be used until the new version is ready.
  512. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  513. // learn more.
  514. rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) {
  515. option (google.api.http) = {
  516. patch: "/v2/{name=organizations/*/storedInfoTypes/*}"
  517. body: "*"
  518. additional_bindings {
  519. patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
  520. body: "*"
  521. }
  522. additional_bindings {
  523. patch: "/v2/{name=projects/*/storedInfoTypes/*}"
  524. body: "*"
  525. }
  526. additional_bindings {
  527. patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
  528. body: "*"
  529. }
  530. };
  531. option (google.api.method_signature) = "name,config,update_mask";
  532. }
  533. // Gets a stored infoType.
  534. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  535. // learn more.
  536. rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) {
  537. option (google.api.http) = {
  538. get: "/v2/{name=organizations/*/storedInfoTypes/*}"
  539. additional_bindings {
  540. get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
  541. }
  542. additional_bindings {
  543. get: "/v2/{name=projects/*/storedInfoTypes/*}"
  544. }
  545. additional_bindings {
  546. get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
  547. }
  548. };
  549. option (google.api.method_signature) = "name";
  550. }
  551. // Lists stored infoTypes.
  552. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  553. // learn more.
  554. rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) {
  555. option (google.api.http) = {
  556. get: "/v2/{parent=organizations/*}/storedInfoTypes"
  557. additional_bindings {
  558. get: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes"
  559. }
  560. additional_bindings {
  561. get: "/v2/{parent=projects/*}/storedInfoTypes"
  562. }
  563. additional_bindings {
  564. get: "/v2/{parent=projects/*/locations/*}/storedInfoTypes"
  565. }
  566. };
  567. option (google.api.method_signature) = "parent";
  568. }
  569. // Deletes a stored infoType.
  570. // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
  571. // learn more.
  572. rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) {
  573. option (google.api.http) = {
  574. delete: "/v2/{name=organizations/*/storedInfoTypes/*}"
  575. additional_bindings {
  576. delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
  577. }
  578. additional_bindings {
  579. delete: "/v2/{name=projects/*/storedInfoTypes/*}"
  580. }
  581. additional_bindings {
  582. delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
  583. }
  584. };
  585. option (google.api.method_signature) = "name";
  586. }
  587. // Inspect hybrid content and store findings to a job.
  588. // To review the findings inspect the job. Inspection will occur
  589. // asynchronously.
  590. // Early access feature is in a pre-release state and might change or have
  591. // limited support. For more information, see
  592. // https://cloud.google.com/products#product-launch-stages.
  593. rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) {
  594. option (google.api.http) = {
  595. post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect"
  596. body: "*"
  597. };
  598. option (google.api.method_signature) = "name";
  599. }
  600. // Finish a running hybrid DlpJob. Triggers the finalization steps and running
  601. // of any enabled actions that have not yet run.
  602. // Early access feature is in a pre-release state and might change or have
  603. // limited support. For more information, see
  604. // https://cloud.google.com/products#product-launch-stages.
  605. rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) {
  606. option (google.api.http) = {
  607. post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish"
  608. body: "*"
  609. };
  610. }
  611. }
  612. // List of exclude infoTypes.
  613. message ExcludeInfoTypes {
  614. // InfoType list in ExclusionRule rule drops a finding when it overlaps or
  615. // contained within with a finding of an infoType from this list. For
  616. // example, for `InspectionRuleSet.info_types` containing "PHONE_NUMBER"` and
  617. // `exclusion_rule` containing `exclude_info_types.info_types` with
  618. // "EMAIL_ADDRESS" the phone number findings are dropped if they overlap
  619. // with EMAIL_ADDRESS finding.
  620. // That leads to "555-222-2222@example.org" to generate only a single
  621. // finding, namely email address.
  622. repeated InfoType info_types = 1;
  623. }
  624. // The rule that specifies conditions when findings of infoTypes specified in
  625. // `InspectionRuleSet` are removed from results.
  626. message ExclusionRule {
  627. // Exclusion rule types.
  628. oneof type {
  629. // Dictionary which defines the rule.
  630. CustomInfoType.Dictionary dictionary = 1;
  631. // Regular expression which defines the rule.
  632. CustomInfoType.Regex regex = 2;
  633. // Set of infoTypes for which findings would affect this rule.
  634. ExcludeInfoTypes exclude_info_types = 3;
  635. }
  636. // How the rule is applied, see MatchingType documentation for details.
  637. MatchingType matching_type = 4;
  638. }
  639. // A single inspection rule to be applied to infoTypes, specified in
  640. // `InspectionRuleSet`.
  641. message InspectionRule {
  642. // Inspection rule types.
  643. oneof type {
  644. // Hotword-based detection rule.
  645. CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;
  646. // Exclusion rule.
  647. ExclusionRule exclusion_rule = 2;
  648. }
  649. }
  650. // Rule set for modifying a set of infoTypes to alter behavior under certain
  651. // circumstances, depending on the specific details of the rules within the set.
  652. message InspectionRuleSet {
  653. // List of infoTypes this rule set is applied to.
  654. repeated InfoType info_types = 1;
  655. // Set of rules to be applied to infoTypes. The rules are applied in order.
  656. repeated InspectionRule rules = 2;
  657. }
  658. // Configuration description of the scanning process.
  659. // When used with redactContent only info_types and min_likelihood are currently
  660. // used.
  661. message InspectConfig {
  662. // Configuration to control the number of findings returned.
  663. message FindingLimits {
  664. // Max findings configuration per infoType, per content item or long
  665. // running DlpJob.
  666. message InfoTypeLimit {
  667. // Type of information the findings limit applies to. Only one limit per
  668. // info_type should be provided. If InfoTypeLimit does not have an
  669. // info_type, the DLP API applies the limit against all info_types that
  670. // are found but not specified in another InfoTypeLimit.
  671. InfoType info_type = 1;
  672. // Max findings limit for the given infoType.
  673. int32 max_findings = 2;
  674. }
  675. // Max number of findings that will be returned for each item scanned.
  676. // When set within `InspectJobConfig`,
  677. // the maximum returned is 2000 regardless if this is set higher.
  678. // When set within `InspectContentRequest`, this field is ignored.
  679. int32 max_findings_per_item = 1;
  680. // Max number of findings that will be returned per request/job.
  681. // When set within `InspectContentRequest`, the maximum returned is 2000
  682. // regardless if this is set higher.
  683. int32 max_findings_per_request = 2;
  684. // Configuration of findings limit given for specified infoTypes.
  685. repeated InfoTypeLimit max_findings_per_info_type = 3;
  686. }
  687. // Restricts what info_types to look for. The values must correspond to
  688. // InfoType values returned by ListInfoTypes or listed at
  689. // https://cloud.google.com/dlp/docs/infotypes-reference.
  690. //
  691. // When no InfoTypes or CustomInfoTypes are specified in a request, the
  692. // system may automatically choose what detectors to run. By default this may
  693. // be all types, but may change over time as detectors are updated.
  694. //
  695. // If you need precise control and predictability as to what detectors are
  696. // run you should specify specific InfoTypes listed in the reference,
  697. // otherwise a default list will be used, which may change over time.
  698. repeated InfoType info_types = 1;
  699. // Only returns findings equal or above this threshold. The default is
  700. // POSSIBLE.
  701. // See https://cloud.google.com/dlp/docs/likelihood to learn more.
  702. Likelihood min_likelihood = 2;
  703. // Configuration to control the number of findings returned.
  704. FindingLimits limits = 3;
  705. // When true, a contextual quote from the data that triggered a finding is
  706. // included in the response; see Finding.quote.
  707. bool include_quote = 4;
  708. // When true, excludes type information of the findings.
  709. bool exclude_info_types = 5;
  710. // CustomInfoTypes provided by the user. See
  711. // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more.
  712. repeated CustomInfoType custom_info_types = 6;
  713. // List of options defining data content to scan.
  714. // If empty, text, images, and other content will be included.
  715. repeated ContentOption content_options = 8;
  716. // Set of rules to apply to the findings for this InspectConfig.
  717. // Exclusion rules, contained in the set are executed in the end, other
  718. // rules are executed in the order they are specified for each info type.
  719. repeated InspectionRuleSet rule_set = 10;
  720. }
  721. // Container for bytes to inspect or redact.
  722. message ByteContentItem {
  723. // The type of data being sent for inspection.
  724. enum BytesType {
  725. // Unused
  726. BYTES_TYPE_UNSPECIFIED = 0;
  727. // Any image type.
  728. IMAGE = 6;
  729. // jpeg
  730. IMAGE_JPEG = 1;
  731. // bmp
  732. IMAGE_BMP = 2;
  733. // png
  734. IMAGE_PNG = 3;
  735. // svg
  736. IMAGE_SVG = 4;
  737. // plain text
  738. TEXT_UTF8 = 5;
  739. // docx, docm, dotx, dotm
  740. WORD_DOCUMENT = 7;
  741. // pdf
  742. PDF = 8;
  743. // avro
  744. AVRO = 11;
  745. // csv
  746. CSV = 12;
  747. // tsv
  748. TSV = 13;
  749. }
  750. // The type of data stored in the bytes string. Default will be TEXT_UTF8.
  751. BytesType type = 1;
  752. // Content data to inspect or redact.
  753. bytes data = 2;
  754. }
  755. // Container structure for the content to inspect.
  756. message ContentItem {
  757. // Data of the item either in the byte array or UTF-8 string form, or table.
  758. oneof data_item {
  759. // String data to inspect or redact.
  760. string value = 3;
  761. // Structured content for inspection. See
  762. // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
  763. // learn more.
  764. Table table = 4;
  765. // Content data to inspect or redact. Replaces `type` and `data`.
  766. ByteContentItem byte_item = 5;
  767. }
  768. }
  769. // Structured content to inspect. Up to 50,000 `Value`s per request allowed.
  770. // See https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
  771. // learn more.
  772. message Table {
  773. // Values of the row.
  774. message Row {
  775. // Individual cells.
  776. repeated Value values = 1;
  777. }
  778. // Headers of the table.
  779. repeated FieldId headers = 1;
  780. // Rows of the table.
  781. repeated Row rows = 2;
  782. }
  783. // All the findings for a single scanned item.
  784. message InspectResult {
  785. // List of findings for an item.
  786. repeated Finding findings = 1;
  787. // If true, then this item might have more findings than were returned,
  788. // and the findings returned are an arbitrary subset of all findings.
  789. // The findings list might be truncated because the input items were too
  790. // large, or because the server reached the maximum amount of resources
  791. // allowed for a single API call. For best results, divide the input into
  792. // smaller batches.
  793. bool findings_truncated = 2;
  794. }
  795. // Represents a piece of potentially sensitive content.
  796. message Finding {
  797. option (google.api.resource) = {
  798. type: "dlp.googleapis.com/Finding"
  799. pattern: "projects/{project}/locations/{location}/findings/{finding}"
  800. };
  801. // Resource name in format
  802. // projects/{project}/locations/{location}/findings/{finding} Populated only
  803. // when viewing persisted findings.
  804. string name = 14;
  805. // The content that was found. Even if the content is not textual, it
  806. // may be converted to a textual representation here.
  807. // Provided if `include_quote` is true and the finding is
  808. // less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes
  809. // in length, the quote may be omitted.
  810. string quote = 1;
  811. // The type of content that might have been found.
  812. // Provided if `excluded_types` is false.
  813. InfoType info_type = 2;
  814. // Confidence of how likely it is that the `info_type` is correct.
  815. Likelihood likelihood = 3;
  816. // Where the content was found.
  817. Location location = 4;
  818. // Timestamp when finding was detected.
  819. google.protobuf.Timestamp create_time = 6;
  820. // Contains data parsed from quotes. Only populated if include_quote was set
  821. // to true and a supported infoType was requested. Currently supported
  822. // infoTypes: DATE, DATE_OF_BIRTH and TIME.
  823. QuoteInfo quote_info = 7;
  824. // The job that stored the finding.
  825. string resource_name = 8 [(google.api.resource_reference) = {
  826. type: "dlp.googleapis.com/DlpJob"
  827. }];
  828. // Job trigger name, if applicable, for this finding.
  829. string trigger_name = 9 [(google.api.resource_reference) = {
  830. type: "dlp.googleapis.com/JobTrigger"
  831. }];
  832. // The labels associated with this `Finding`.
  833. //
  834. // Label keys must be between 1 and 63 characters long and must conform
  835. // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
  836. //
  837. // Label values must be between 0 and 63 characters long and must conform
  838. // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
  839. //
  840. // No more than 10 labels can be associated with a given finding.
  841. //
  842. // Examples:
  843. // * `"environment" : "production"`
  844. // * `"pipeline" : "etl"`
  845. map<string, string> labels = 10;
  846. // Time the job started that produced this finding.
  847. google.protobuf.Timestamp job_create_time = 11;
  848. // The job that stored the finding.
  849. string job_name = 13 [(google.api.resource_reference) = {
  850. type: "dlp.googleapis.com/DlpJob"
  851. }];
  852. }
  853. // Specifies the location of the finding.
  854. message Location {
  855. // Zero-based byte offsets delimiting the finding.
  856. // These are relative to the finding's containing element.
  857. // Note that when the content is not textual, this references
  858. // the UTF-8 encoded textual representation of the content.
  859. // Omitted if content is an image.
  860. Range byte_range = 1;
  861. // Unicode character offsets delimiting the finding.
  862. // These are relative to the finding's containing element.
  863. // Provided when the content is text.
  864. Range codepoint_range = 2;
  865. // List of nested objects pointing to the precise location of the finding
  866. // within the file or record.
  867. repeated ContentLocation content_locations = 7;
  868. // Information about the container where this finding occurred, if available.
  869. Container container = 8;
  870. }
  871. // Precise location of the finding within a document, record, image, or metadata
  872. // container.
  873. message ContentLocation {
  874. // Name of the container where the finding is located.
  875. // The top level name is the source file name or table name. Names of some
  876. // common storage containers are formatted as follows:
  877. //
  878. // * BigQuery tables: `{project_id}:{dataset_id}.{table_id}`
  879. // * Cloud Storage files: `gs://{bucket}/{path}`
  880. // * Datastore namespace: {namespace}
  881. //
  882. // Nested names could be absent if the embedded object has no string
  883. // identifier (for an example an image contained within a document).
  884. string container_name = 1;
  885. // Type of the container within the file with location of the finding.
  886. oneof location {
  887. // Location within a row or record of a database table.
  888. RecordLocation record_location = 2;
  889. // Location within an image's pixels.
  890. ImageLocation image_location = 3;
  891. // Location data for document files.
  892. DocumentLocation document_location = 5;
  893. // Location within the metadata for inspected content.
  894. MetadataLocation metadata_location = 8;
  895. }
  896. // Findings container modification timestamp, if applicable.
  897. // For Google Cloud Storage contains last file modification timestamp.
  898. // For BigQuery table contains last_modified_time property.
  899. // For Datastore - not populated.
  900. google.protobuf.Timestamp container_timestamp = 6;
  901. // Findings container version, if available
  902. // ("generation" for Google Cloud Storage).
  903. string container_version = 7;
  904. }
  905. // Metadata Location
  906. message MetadataLocation {
  907. // Type of metadata containing the finding.
  908. MetadataType type = 1;
  909. // Label of the piece of metadata containing the finding, for example -
  910. // latitude, author, caption.
  911. oneof label {
  912. // Storage metadata.
  913. StorageMetadataLabel storage_label = 3;
  914. }
  915. }
  916. // Storage metadata label to indicate which metadata entry contains findings.
  917. message StorageMetadataLabel {
  918. string key = 1;
  919. }
  920. // Location of a finding within a document.
  921. message DocumentLocation {
  922. // Offset of the line, from the beginning of the file, where the finding
  923. // is located.
  924. int64 file_offset = 1;
  925. }
  926. // Location of a finding within a row or record.
  927. message RecordLocation {
  928. // Key of the finding.
  929. RecordKey record_key = 1;
  930. // Field id of the field containing the finding.
  931. FieldId field_id = 2;
  932. // Location within a `ContentItem.Table`.
  933. TableLocation table_location = 3;
  934. }
  935. // Location of a finding within a table.
  936. message TableLocation {
  937. // The zero-based index of the row where the finding is located. Only
  938. // populated for resources that have a natural ordering, not BigQuery. In
  939. // BigQuery, to identify the row a finding came from, populate
  940. // BigQueryOptions.identifying_fields with your primary key column names and
  941. // when you store the findings the value of those columns will be stored
  942. // inside of Finding.
  943. int64 row_index = 1;
  944. }
  945. // Represents a container that may contain DLP findings.
  946. // Examples of a container include a file, table, or database record.
  947. message Container {
  948. // Container type, for example BigQuery or Google Cloud Storage.
  949. string type = 1;
  950. // Project where the finding was found.
  951. // Can be different from the project that owns the finding.
  952. string project_id = 2;
  953. // A string representation of the full container name.
  954. // Examples:
  955. // - BigQuery: 'Project:DataSetId.TableId'
  956. // - Google Cloud Storage: 'gs://Bucket/folders/filename.txt'
  957. string full_path = 3;
  958. // The root of the container.
  959. // Examples:
  960. // - For BigQuery table `project_id:dataset_id.table_id`, the root is
  961. // `dataset_id`
  962. // - For Google Cloud Storage file `gs://bucket/folder/filename.txt`, the root
  963. // is `gs://bucket`
  964. string root_path = 4;
  965. // The rest of the path after the root.
  966. // Examples:
  967. // - For BigQuery table `project_id:dataset_id.table_id`, the relative path is
  968. // `table_id`
  969. // - Google Cloud Storage file `gs://bucket/folder/filename.txt`, the relative
  970. // path is `folder/filename.txt`
  971. string relative_path = 5;
  972. // Findings container modification timestamp, if applicable.
  973. // For Google Cloud Storage contains last file modification timestamp.
  974. // For BigQuery table contains last_modified_time property.
  975. // For Datastore - not populated.
  976. google.protobuf.Timestamp update_time = 6;
  977. // Findings container version, if available
  978. // ("generation" for Google Cloud Storage).
  979. string version = 7;
  980. }
  981. // Generic half-open interval [start, end)
  982. message Range {
  983. // Index of the first character of the range (inclusive).
  984. int64 start = 1;
  985. // Index of the last character of the range (exclusive).
  986. int64 end = 2;
  987. }
  988. // Location of the finding within an image.
  989. message ImageLocation {
  990. // Bounding boxes locating the pixels within the image containing the finding.
  991. repeated BoundingBox bounding_boxes = 1;
  992. }
  993. // Bounding box encompassing detected text within an image.
  994. message BoundingBox {
  995. // Top coordinate of the bounding box. (0,0) is upper left.
  996. int32 top = 1;
  997. // Left coordinate of the bounding box. (0,0) is upper left.
  998. int32 left = 2;
  999. // Width of the bounding box in pixels.
  1000. int32 width = 3;
  1001. // Height of the bounding box in pixels.
  1002. int32 height = 4;
  1003. }
  1004. // Request to search for potentially sensitive info in an image and redact it
  1005. // by covering it with a colored rectangle.
  1006. message RedactImageRequest {
  1007. // Configuration for determining how redaction of images should occur.
  1008. message ImageRedactionConfig {
  1009. // Type of information to redact from images.
  1010. oneof target {
  1011. // Only one per info_type should be provided per request. If not
  1012. // specified, and redact_all_text is false, the DLP API will redact all
  1013. // text that it matches against all info_types that are found, but not
  1014. // specified in another ImageRedactionConfig.
  1015. InfoType info_type = 1;
  1016. // If true, all text found in the image, regardless whether it matches an
  1017. // info_type, is redacted. Only one should be provided.
  1018. bool redact_all_text = 2;
  1019. }
  1020. // The color to use when redacting content from an image. If not specified,
  1021. // the default is black.
  1022. Color redaction_color = 3;
  1023. }
  1024. // Parent resource name.
  1025. //
  1026. // The format of this value varies depending on whether you have [specified a
  1027. // processing
  1028. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1029. //
  1030. // + Projects scope, location specified:<br/>
  1031. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1032. // + Projects scope, no location specified (defaults to global):<br/>
  1033. // `projects/`<var>PROJECT_ID</var>
  1034. //
  1035. // The following example `parent` string specifies a parent project with the
  1036. // identifier `example-project`, and specifies the `europe-west3` location
  1037. // for processing data:
  1038. //
  1039. // parent=projects/example-project/locations/europe-west3
  1040. string parent = 1 [(google.api.resource_reference) = {
  1041. child_type: "dlp.googleapis.com/DlpContent"
  1042. }];
  1043. // Deprecated. This field has no effect.
  1044. string location_id = 8;
  1045. // Configuration for the inspector.
  1046. InspectConfig inspect_config = 2;
  1047. // The configuration for specifying what content to redact from images.
  1048. repeated ImageRedactionConfig image_redaction_configs = 5;
  1049. // Whether the response should include findings along with the redacted
  1050. // image.
  1051. bool include_findings = 6;
  1052. // The content must be PNG, JPEG, SVG or BMP.
  1053. ByteContentItem byte_item = 7;
  1054. }
  1055. // Represents a color in the RGB color space.
  1056. message Color {
  1057. // The amount of red in the color as a value in the interval [0, 1].
  1058. float red = 1;
  1059. // The amount of green in the color as a value in the interval [0, 1].
  1060. float green = 2;
  1061. // The amount of blue in the color as a value in the interval [0, 1].
  1062. float blue = 3;
  1063. }
  1064. // Results of redacting an image.
  1065. message RedactImageResponse {
  1066. // The redacted image. The type will be the same as the original image.
  1067. bytes redacted_image = 1;
  1068. // If an image was being inspected and the InspectConfig's include_quote was
  1069. // set to true, then this field will include all text, if any, that was found
  1070. // in the image.
  1071. string extracted_text = 2;
  1072. // The findings. Populated when include_findings in the request is true.
  1073. InspectResult inspect_result = 3;
  1074. }
  1075. // Request to de-identify a list of items.
  1076. message DeidentifyContentRequest {
  1077. // Parent resource name.
  1078. //
  1079. // The format of this value varies depending on whether you have [specified a
  1080. // processing
  1081. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1082. //
  1083. // + Projects scope, location specified:<br/>
  1084. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1085. // + Projects scope, no location specified (defaults to global):<br/>
  1086. // `projects/`<var>PROJECT_ID</var>
  1087. //
  1088. // The following example `parent` string specifies a parent project with the
  1089. // identifier `example-project`, and specifies the `europe-west3` location
  1090. // for processing data:
  1091. //
  1092. // parent=projects/example-project/locations/europe-west3
  1093. string parent = 1 [(google.api.resource_reference) = {
  1094. child_type: "dlp.googleapis.com/DlpContent"
  1095. }];
  1096. // Configuration for the de-identification of the content item.
  1097. // Items specified here will override the template referenced by the
  1098. // deidentify_template_name argument.
  1099. DeidentifyConfig deidentify_config = 2;
  1100. // Configuration for the inspector.
  1101. // Items specified here will override the template referenced by the
  1102. // inspect_template_name argument.
  1103. InspectConfig inspect_config = 3;
  1104. // The item to de-identify. Will be treated as text.
  1105. ContentItem item = 4;
  1106. // Template to use. Any configuration directly specified in
  1107. // inspect_config will override those set in the template. Singular fields
  1108. // that are set in this request will replace their corresponding fields in the
  1109. // template. Repeated fields are appended. Singular sub-messages and groups
  1110. // are recursively merged.
  1111. string inspect_template_name = 5;
  1112. // Template to use. Any configuration directly specified in
  1113. // deidentify_config will override those set in the template. Singular fields
  1114. // that are set in this request will replace their corresponding fields in the
  1115. // template. Repeated fields are appended. Singular sub-messages and groups
  1116. // are recursively merged.
  1117. string deidentify_template_name = 6;
  1118. // Deprecated. This field has no effect.
  1119. string location_id = 7;
  1120. }
  1121. // Results of de-identifying a ContentItem.
  1122. message DeidentifyContentResponse {
  1123. // The de-identified item.
  1124. ContentItem item = 1;
  1125. // An overview of the changes that were made on the `item`.
  1126. TransformationOverview overview = 2;
  1127. }
  1128. // Request to re-identify an item.
  1129. message ReidentifyContentRequest {
  1130. // Required. Parent resource name.
  1131. //
  1132. // The format of this value varies depending on whether you have [specified a
  1133. // processing
  1134. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1135. //
  1136. // + Projects scope, location specified:<br/>
  1137. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1138. // + Projects scope, no location specified (defaults to global):<br/>
  1139. // `projects/`<var>PROJECT_ID</var>
  1140. //
  1141. // The following example `parent` string specifies a parent project with the
  1142. // identifier `example-project`, and specifies the `europe-west3` location
  1143. // for processing data:
  1144. //
  1145. // parent=projects/example-project/locations/europe-west3
  1146. string parent = 1 [
  1147. (google.api.field_behavior) = REQUIRED,
  1148. (google.api.resource_reference) = {
  1149. child_type: "dlp.googleapis.com/DlpContent"
  1150. }
  1151. ];
  1152. // Configuration for the re-identification of the content item.
  1153. // This field shares the same proto message type that is used for
  1154. // de-identification, however its usage here is for the reversal of the
  1155. // previous de-identification. Re-identification is performed by examining
  1156. // the transformations used to de-identify the items and executing the
  1157. // reverse. This requires that only reversible transformations
  1158. // be provided here. The reversible transformations are:
  1159. //
  1160. // - `CryptoDeterministicConfig`
  1161. // - `CryptoReplaceFfxFpeConfig`
  1162. DeidentifyConfig reidentify_config = 2;
  1163. // Configuration for the inspector.
  1164. InspectConfig inspect_config = 3;
  1165. // The item to re-identify. Will be treated as text.
  1166. ContentItem item = 4;
  1167. // Template to use. Any configuration directly specified in
  1168. // `inspect_config` will override those set in the template. Singular fields
  1169. // that are set in this request will replace their corresponding fields in the
  1170. // template. Repeated fields are appended. Singular sub-messages and groups
  1171. // are recursively merged.
  1172. string inspect_template_name = 5;
  1173. // Template to use. References an instance of `DeidentifyTemplate`.
  1174. // Any configuration directly specified in `reidentify_config` or
  1175. // `inspect_config` will override those set in the template. The
  1176. // `DeidentifyTemplate` used must include only reversible transformations.
  1177. // Singular fields that are set in this request will replace their
  1178. // corresponding fields in the template. Repeated fields are appended.
  1179. // Singular sub-messages and groups are recursively merged.
  1180. string reidentify_template_name = 6;
  1181. // Deprecated. This field has no effect.
  1182. string location_id = 7;
  1183. }
  1184. // Results of re-identifying a item.
  1185. message ReidentifyContentResponse {
  1186. // The re-identified item.
  1187. ContentItem item = 1;
  1188. // An overview of the changes that were made to the `item`.
  1189. TransformationOverview overview = 2;
  1190. }
  1191. // Request to search for potentially sensitive info in a ContentItem.
  1192. message InspectContentRequest {
  1193. // Parent resource name.
  1194. //
  1195. // The format of this value varies depending on whether you have [specified a
  1196. // processing
  1197. // location](https://cloud.google.com/dlp/docs/specifying-location):
  1198. //
  1199. // + Projects scope, location specified:<br/>
  1200. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1201. // + Projects scope, no location specified (defaults to global):<br/>
  1202. // `projects/`<var>PROJECT_ID</var>
  1203. //
  1204. // The following example `parent` string specifies a parent project with the
  1205. // identifier `example-project`, and specifies the `europe-west3` location
  1206. // for processing data:
  1207. //
  1208. // parent=projects/example-project/locations/europe-west3
  1209. string parent = 1 [(google.api.resource_reference) = {
  1210. child_type: "dlp.googleapis.com/DlpContent"
  1211. }];
  1212. // Configuration for the inspector. What specified here will override
  1213. // the template referenced by the inspect_template_name argument.
  1214. InspectConfig inspect_config = 2;
  1215. // The item to inspect.
  1216. ContentItem item = 3;
  1217. // Template to use. Any configuration directly specified in
  1218. // inspect_config will override those set in the template. Singular fields
  1219. // that are set in this request will replace their corresponding fields in the
  1220. // template. Repeated fields are appended. Singular sub-messages and groups
  1221. // are recursively merged.
  1222. string inspect_template_name = 4;
  1223. // Deprecated. This field has no effect.
  1224. string location_id = 5;
  1225. }
  1226. // Results of inspecting an item.
  1227. message InspectContentResponse {
  1228. // The findings.
  1229. InspectResult result = 1;
  1230. }
  1231. // Cloud repository for storing output.
  1232. message OutputStorageConfig {
  1233. // Predefined schemas for storing findings.
  1234. // Only for use with external storage.
  1235. enum OutputSchema {
  1236. // Unused.
  1237. OUTPUT_SCHEMA_UNSPECIFIED = 0;
  1238. // Basic schema including only `info_type`, `quote`, `certainty`, and
  1239. // `timestamp`.
  1240. BASIC_COLUMNS = 1;
  1241. // Schema tailored to findings from scanning Google Cloud Storage.
  1242. GCS_COLUMNS = 2;
  1243. // Schema tailored to findings from scanning Google Datastore.
  1244. DATASTORE_COLUMNS = 3;
  1245. // Schema tailored to findings from scanning Google BigQuery.
  1246. BIG_QUERY_COLUMNS = 4;
  1247. // Schema containing all columns.
  1248. ALL_COLUMNS = 5;
  1249. }
  1250. // Output storage types.
  1251. oneof type {
  1252. // Store findings in an existing table or a new table in an existing
  1253. // dataset. If table_id is not set a new one will be generated
  1254. // for you with the following format:
  1255. // dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for
  1256. // generating the date details.
  1257. //
  1258. // For Inspect, each column in an existing output table must have the same
  1259. // name, type, and mode of a field in the `Finding` object.
  1260. //
  1261. // For Risk, an existing output table should be the output of a previous
  1262. // Risk analysis job run on the same source table, with the same privacy
  1263. // metric and quasi-identifiers. Risk jobs that analyze the same table but
  1264. // compute a different privacy metric, or use different sets of
  1265. // quasi-identifiers, cannot store their results in the same table.
  1266. BigQueryTable table = 1;
  1267. }
  1268. // Schema used for writing the findings for Inspect jobs. This field is only
  1269. // used for Inspect and must be unspecified for Risk jobs. Columns are derived
  1270. // from the `Finding` object. If appending to an existing table, any columns
  1271. // from the predefined schema that are missing will be added. No columns in
  1272. // the existing table will be deleted.
  1273. //
  1274. // If unspecified, then all available columns will be used for a new table or
  1275. // an (existing) table with no schema, and no changes will be made to an
  1276. // existing table that has a schema.
  1277. // Only for use with external storage.
  1278. OutputSchema output_schema = 3;
  1279. }
  1280. // Statistics regarding a specific InfoType.
  1281. message InfoTypeStats {
  1282. // The type of finding this stat is for.
  1283. InfoType info_type = 1;
  1284. // Number of findings for this infoType.
  1285. int64 count = 2;
  1286. }
  1287. // The results of an inspect DataSource job.
  1288. message InspectDataSourceDetails {
  1289. // Snapshot of the inspection configuration.
  1290. message RequestedOptions {
  1291. // If run with an InspectTemplate, a snapshot of its state at the time of
  1292. // this run.
  1293. InspectTemplate snapshot_inspect_template = 1;
  1294. // Inspect config.
  1295. InspectJobConfig job_config = 3;
  1296. }
  1297. // All result fields mentioned below are updated while the job is processing.
  1298. message Result {
  1299. // Total size in bytes that were processed.
  1300. int64 processed_bytes = 1;
  1301. // Estimate of the number of bytes to process.
  1302. int64 total_estimated_bytes = 2;
  1303. // Statistics of how many instances of each info type were found during
  1304. // inspect job.
  1305. repeated InfoTypeStats info_type_stats = 3;
  1306. // Statistics related to the processing of hybrid inspect.
  1307. // Early access feature is in a pre-release state and might change or have
  1308. // limited support. For more information, see
  1309. // https://cloud.google.com/products#product-launch-stages.
  1310. HybridInspectStatistics hybrid_stats = 7;
  1311. }
  1312. // The configuration used for this job.
  1313. RequestedOptions requested_options = 2;
  1314. // A summary of the outcome of this inspect job.
  1315. Result result = 3;
  1316. }
  1317. // Statistics related to processing hybrid inspect requests.
  1318. message HybridInspectStatistics {
  1319. // The number of hybrid inspection requests processed within this job.
  1320. int64 processed_count = 1;
  1321. // The number of hybrid inspection requests aborted because the job ran
  1322. // out of quota or was ended before they could be processed.
  1323. int64 aborted_count = 2;
  1324. // The number of hybrid requests currently being processed. Only populated
  1325. // when called via method `getDlpJob`.
  1326. // A burst of traffic may cause hybrid inspect requests to be enqueued.
  1327. // Processing will take place as quickly as possible, but resource limitations
  1328. // may impact how long a request is enqueued for.
  1329. int64 pending_count = 3;
  1330. }
  1331. // InfoType description.
  1332. message InfoTypeDescription {
  1333. // Internal name of the infoType.
  1334. string name = 1;
  1335. // Human readable form of the infoType name.
  1336. string display_name = 2;
  1337. // Which parts of the API supports this InfoType.
  1338. repeated InfoTypeSupportedBy supported_by = 3;
  1339. // Description of the infotype. Translated when language is provided in the
  1340. // request.
  1341. string description = 4;
  1342. }
  1343. // Request for the list of infoTypes.
  1344. message ListInfoTypesRequest {
  1345. // The parent resource name.
  1346. //
  1347. // The format of this value is as follows:
  1348. //
  1349. // locations/<var>LOCATION_ID</var>
  1350. string parent = 4;
  1351. // BCP-47 language code for localized infoType friendly
  1352. // names. If omitted, or if localized strings are not available,
  1353. // en-US strings will be returned.
  1354. string language_code = 1;
  1355. // filter to only return infoTypes supported by certain parts of the
  1356. // API. Defaults to supported_by=INSPECT.
  1357. string filter = 2;
  1358. // Deprecated. This field has no effect.
  1359. string location_id = 3;
  1360. }
  1361. // Response to the ListInfoTypes request.
  1362. message ListInfoTypesResponse {
  1363. // Set of sensitive infoTypes.
  1364. repeated InfoTypeDescription info_types = 1;
  1365. }
  1366. // Configuration for a risk analysis job. See
  1367. // https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more.
  1368. message RiskAnalysisJobConfig {
  1369. // Privacy metric to compute.
  1370. PrivacyMetric privacy_metric = 1;
  1371. // Input dataset to compute metrics over.
  1372. BigQueryTable source_table = 2;
  1373. // Actions to execute at the completion of the job. Are executed in the order
  1374. // provided.
  1375. repeated Action actions = 3;
  1376. }
  1377. // A column with a semantic tag attached.
  1378. message QuasiId {
  1379. // Required. Identifies the column.
  1380. FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  1381. // Semantic tag that identifies what a column contains, to determine which
  1382. // statistical model to use to estimate the reidentifiability of each
  1383. // value. [required]
  1384. oneof tag {
  1385. // A column can be tagged with a InfoType to use the relevant public
  1386. // dataset as a statistical model of population, if available. We
  1387. // currently support US ZIP codes, region codes, ages and genders.
  1388. // To programmatically obtain the list of supported InfoTypes, use
  1389. // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  1390. InfoType info_type = 2;
  1391. // A column can be tagged with a custom tag. In this case, the user must
  1392. // indicate an auxiliary table that contains statistical information on
  1393. // the possible values of this column (below).
  1394. string custom_tag = 3;
  1395. // If no semantic tag is indicated, we infer the statistical model from
  1396. // the distribution of values in the input data
  1397. google.protobuf.Empty inferred = 4;
  1398. }
  1399. }
  1400. // An auxiliary table containing statistical information on the relative
  1401. // frequency of different quasi-identifiers values. It has one or several
  1402. // quasi-identifiers columns, and one column that indicates the relative
  1403. // frequency of each quasi-identifier tuple.
  1404. // If a tuple is present in the data but not in the auxiliary table, the
  1405. // corresponding relative frequency is assumed to be zero (and thus, the
  1406. // tuple is highly reidentifiable).
  1407. message StatisticalTable {
  1408. // A quasi-identifier column has a custom_tag, used to know which column
  1409. // in the data corresponds to which column in the statistical model.
  1410. message QuasiIdentifierField {
  1411. // Identifies the column.
  1412. FieldId field = 1;
  1413. // A column can be tagged with a custom tag. In this case, the user must
  1414. // indicate an auxiliary table that contains statistical information on
  1415. // the possible values of this column (below).
  1416. string custom_tag = 2;
  1417. }
  1418. // Required. Auxiliary table location.
  1419. BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED];
  1420. // Required. Quasi-identifier columns.
  1421. repeated QuasiIdentifierField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1422. // Required. The relative frequency column must contain a floating-point number
  1423. // between 0 and 1 (inclusive). Null values are assumed to be zero.
  1424. FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED];
  1425. }
  1426. // Privacy metric to compute for reidentification risk analysis.
  1427. message PrivacyMetric {
  1428. // Compute numerical stats over an individual column, including
  1429. // min, max, and quantiles.
  1430. message NumericalStatsConfig {
  1431. // Field to compute numerical stats on. Supported types are
  1432. // integer, float, date, datetime, timestamp, time.
  1433. FieldId field = 1;
  1434. }
  1435. // Compute numerical stats over an individual column, including
  1436. // number of distinct values and value count distribution.
  1437. message CategoricalStatsConfig {
  1438. // Field to compute categorical stats on. All column types are
  1439. // supported except for arrays and structs. However, it may be more
  1440. // informative to use NumericalStats when the field type is supported,
  1441. // depending on the data.
  1442. FieldId field = 1;
  1443. }
  1444. // k-anonymity metric, used for analysis of reidentification risk.
  1445. message KAnonymityConfig {
  1446. // Set of fields to compute k-anonymity over. When multiple fields are
  1447. // specified, they are considered a single composite key. Structs and
  1448. // repeated data types are not supported; however, nested fields are
  1449. // supported so long as they are not structs themselves or nested within
  1450. // a repeated field.
  1451. repeated FieldId quasi_ids = 1;
  1452. // Message indicating that multiple rows might be associated to a
  1453. // single individual. If the same entity_id is associated to multiple
  1454. // quasi-identifier tuples over distinct rows, we consider the entire
  1455. // collection of tuples as the composite quasi-identifier. This collection
  1456. // is a multiset: the order in which the different tuples appear in the
  1457. // dataset is ignored, but their frequency is taken into account.
  1458. //
  1459. // Important note: a maximum of 1000 rows can be associated to a single
  1460. // entity ID. If more rows are associated with the same entity ID, some
  1461. // might be ignored.
  1462. EntityId entity_id = 2;
  1463. }
  1464. // l-diversity metric, used for analysis of reidentification risk.
  1465. message LDiversityConfig {
  1466. // Set of quasi-identifiers indicating how equivalence classes are
  1467. // defined for the l-diversity computation. When multiple fields are
  1468. // specified, they are considered a single composite key.
  1469. repeated FieldId quasi_ids = 1;
  1470. // Sensitive field for computing the l-value.
  1471. FieldId sensitive_attribute = 2;
  1472. }
  1473. // Reidentifiability metric. This corresponds to a risk model similar to what
  1474. // is called "journalist risk" in the literature, except the attack dataset is
  1475. // statistically modeled instead of being perfectly known. This can be done
  1476. // using publicly available data (like the US Census), or using a custom
  1477. // statistical model (indicated as one or several BigQuery tables), or by
  1478. // extrapolating from the distribution of values in the input dataset.
  1479. message KMapEstimationConfig {
  1480. // A column with a semantic tag attached.
  1481. message TaggedField {
  1482. // Required. Identifies the column.
  1483. FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  1484. // Semantic tag that identifies what a column contains, to determine which
  1485. // statistical model to use to estimate the reidentifiability of each
  1486. // value. [required]
  1487. oneof tag {
  1488. // A column can be tagged with a InfoType to use the relevant public
  1489. // dataset as a statistical model of population, if available. We
  1490. // currently support US ZIP codes, region codes, ages and genders.
  1491. // To programmatically obtain the list of supported InfoTypes, use
  1492. // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  1493. InfoType info_type = 2;
  1494. // A column can be tagged with a custom tag. In this case, the user must
  1495. // indicate an auxiliary table that contains statistical information on
  1496. // the possible values of this column (below).
  1497. string custom_tag = 3;
  1498. // If no semantic tag is indicated, we infer the statistical model from
  1499. // the distribution of values in the input data
  1500. google.protobuf.Empty inferred = 4;
  1501. }
  1502. }
  1503. // An auxiliary table contains statistical information on the relative
  1504. // frequency of different quasi-identifiers values. It has one or several
  1505. // quasi-identifiers columns, and one column that indicates the relative
  1506. // frequency of each quasi-identifier tuple.
  1507. // If a tuple is present in the data but not in the auxiliary table, the
  1508. // corresponding relative frequency is assumed to be zero (and thus, the
  1509. // tuple is highly reidentifiable).
  1510. message AuxiliaryTable {
  1511. // A quasi-identifier column has a custom_tag, used to know which column
  1512. // in the data corresponds to which column in the statistical model.
  1513. message QuasiIdField {
  1514. // Identifies the column.
  1515. FieldId field = 1;
  1516. // A auxiliary field.
  1517. string custom_tag = 2;
  1518. }
  1519. // Required. Auxiliary table location.
  1520. BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED];
  1521. // Required. Quasi-identifier columns.
  1522. repeated QuasiIdField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1523. // Required. The relative frequency column must contain a floating-point number
  1524. // between 0 and 1 (inclusive). Null values are assumed to be zero.
  1525. FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED];
  1526. }
  1527. // Required. Fields considered to be quasi-identifiers. No two columns can have the
  1528. // same tag.
  1529. repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1530. // ISO 3166-1 alpha-2 region code to use in the statistical modeling.
  1531. // Set if no column is tagged with a region-specific InfoType (like
  1532. // US_ZIP_5) or a region code.
  1533. string region_code = 2;
  1534. // Several auxiliary tables can be used in the analysis. Each custom_tag
  1535. // used to tag a quasi-identifiers column must appear in exactly one column
  1536. // of one auxiliary table.
  1537. repeated AuxiliaryTable auxiliary_tables = 3;
  1538. }
  1539. // δ-presence metric, used to estimate how likely it is for an attacker to
  1540. // figure out that one given individual appears in a de-identified dataset.
  1541. // Similarly to the k-map metric, we cannot compute δ-presence exactly without
  1542. // knowing the attack dataset, so we use a statistical model instead.
  1543. message DeltaPresenceEstimationConfig {
  1544. // Required. Fields considered to be quasi-identifiers. No two fields can have the
  1545. // same tag.
  1546. repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1547. // ISO 3166-1 alpha-2 region code to use in the statistical modeling.
  1548. // Set if no column is tagged with a region-specific InfoType (like
  1549. // US_ZIP_5) or a region code.
  1550. string region_code = 2;
  1551. // Several auxiliary tables can be used in the analysis. Each custom_tag
  1552. // used to tag a quasi-identifiers field must appear in exactly one
  1553. // field of one auxiliary table.
  1554. repeated StatisticalTable auxiliary_tables = 3;
  1555. }
  1556. // Types of analysis.
  1557. oneof type {
  1558. // Numerical stats
  1559. NumericalStatsConfig numerical_stats_config = 1;
  1560. // Categorical stats
  1561. CategoricalStatsConfig categorical_stats_config = 2;
  1562. // K-anonymity
  1563. KAnonymityConfig k_anonymity_config = 3;
  1564. // l-diversity
  1565. LDiversityConfig l_diversity_config = 4;
  1566. // k-map
  1567. KMapEstimationConfig k_map_estimation_config = 5;
  1568. // delta-presence
  1569. DeltaPresenceEstimationConfig delta_presence_estimation_config = 6;
  1570. }
  1571. }
  1572. // Result of a risk analysis operation request.
  1573. message AnalyzeDataSourceRiskDetails {
  1574. // Result of the numerical stats computation.
  1575. message NumericalStatsResult {
  1576. // Minimum value appearing in the column.
  1577. Value min_value = 1;
  1578. // Maximum value appearing in the column.
  1579. Value max_value = 2;
  1580. // List of 99 values that partition the set of field values into 100 equal
  1581. // sized buckets.
  1582. repeated Value quantile_values = 4;
  1583. }
  1584. // Result of the categorical stats computation.
  1585. message CategoricalStatsResult {
  1586. // Histogram of value frequencies in the column.
  1587. message CategoricalStatsHistogramBucket {
  1588. // Lower bound on the value frequency of the values in this bucket.
  1589. int64 value_frequency_lower_bound = 1;
  1590. // Upper bound on the value frequency of the values in this bucket.
  1591. int64 value_frequency_upper_bound = 2;
  1592. // Total number of values in this bucket.
  1593. int64 bucket_size = 3;
  1594. // Sample of value frequencies in this bucket. The total number of
  1595. // values returned per bucket is capped at 20.
  1596. repeated ValueFrequency bucket_values = 4;
  1597. // Total number of distinct values in this bucket.
  1598. int64 bucket_value_count = 5;
  1599. }
  1600. // Histogram of value frequencies in the column.
  1601. repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 5;
  1602. }
  1603. // Result of the k-anonymity computation.
  1604. message KAnonymityResult {
  1605. // The set of columns' values that share the same ldiversity value
  1606. message KAnonymityEquivalenceClass {
  1607. // Set of values defining the equivalence class. One value per
  1608. // quasi-identifier column in the original KAnonymity metric message.
  1609. // The order is always the same as the original request.
  1610. repeated Value quasi_ids_values = 1;
  1611. // Size of the equivalence class, for example number of rows with the
  1612. // above set of values.
  1613. int64 equivalence_class_size = 2;
  1614. }
  1615. // Histogram of k-anonymity equivalence classes.
  1616. message KAnonymityHistogramBucket {
  1617. // Lower bound on the size of the equivalence classes in this bucket.
  1618. int64 equivalence_class_size_lower_bound = 1;
  1619. // Upper bound on the size of the equivalence classes in this bucket.
  1620. int64 equivalence_class_size_upper_bound = 2;
  1621. // Total number of equivalence classes in this bucket.
  1622. int64 bucket_size = 3;
  1623. // Sample of equivalence classes in this bucket. The total number of
  1624. // classes returned per bucket is capped at 20.
  1625. repeated KAnonymityEquivalenceClass bucket_values = 4;
  1626. // Total number of distinct equivalence classes in this bucket.
  1627. int64 bucket_value_count = 5;
  1628. }
  1629. // Histogram of k-anonymity equivalence classes.
  1630. repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5;
  1631. }
  1632. // Result of the l-diversity computation.
  1633. message LDiversityResult {
  1634. // The set of columns' values that share the same ldiversity value.
  1635. message LDiversityEquivalenceClass {
  1636. // Quasi-identifier values defining the k-anonymity equivalence
  1637. // class. The order is always the same as the original request.
  1638. repeated Value quasi_ids_values = 1;
  1639. // Size of the k-anonymity equivalence class.
  1640. int64 equivalence_class_size = 2;
  1641. // Number of distinct sensitive values in this equivalence class.
  1642. int64 num_distinct_sensitive_values = 3;
  1643. // Estimated frequencies of top sensitive values.
  1644. repeated ValueFrequency top_sensitive_values = 4;
  1645. }
  1646. // Histogram of l-diversity equivalence class sensitive value frequencies.
  1647. message LDiversityHistogramBucket {
  1648. // Lower bound on the sensitive value frequencies of the equivalence
  1649. // classes in this bucket.
  1650. int64 sensitive_value_frequency_lower_bound = 1;
  1651. // Upper bound on the sensitive value frequencies of the equivalence
  1652. // classes in this bucket.
  1653. int64 sensitive_value_frequency_upper_bound = 2;
  1654. // Total number of equivalence classes in this bucket.
  1655. int64 bucket_size = 3;
  1656. // Sample of equivalence classes in this bucket. The total number of
  1657. // classes returned per bucket is capped at 20.
  1658. repeated LDiversityEquivalenceClass bucket_values = 4;
  1659. // Total number of distinct equivalence classes in this bucket.
  1660. int64 bucket_value_count = 5;
  1661. }
  1662. // Histogram of l-diversity equivalence class sensitive value frequencies.
  1663. repeated LDiversityHistogramBucket sensitive_value_frequency_histogram_buckets = 5;
  1664. }
  1665. // Result of the reidentifiability analysis. Note that these results are an
  1666. // estimation, not exact values.
  1667. message KMapEstimationResult {
  1668. // A tuple of values for the quasi-identifier columns.
  1669. message KMapEstimationQuasiIdValues {
  1670. // The quasi-identifier values.
  1671. repeated Value quasi_ids_values = 1;
  1672. // The estimated anonymity for these quasi-identifier values.
  1673. int64 estimated_anonymity = 2;
  1674. }
  1675. // A KMapEstimationHistogramBucket message with the following values:
  1676. // min_anonymity: 3
  1677. // max_anonymity: 5
  1678. // frequency: 42
  1679. // means that there are 42 records whose quasi-identifier values correspond
  1680. // to 3, 4 or 5 people in the overlying population. An important particular
  1681. // case is when min_anonymity = max_anonymity = 1: the frequency field then
  1682. // corresponds to the number of uniquely identifiable records.
  1683. message KMapEstimationHistogramBucket {
  1684. // Always positive.
  1685. int64 min_anonymity = 1;
  1686. // Always greater than or equal to min_anonymity.
  1687. int64 max_anonymity = 2;
  1688. // Number of records within these anonymity bounds.
  1689. int64 bucket_size = 5;
  1690. // Sample of quasi-identifier tuple values in this bucket. The total
  1691. // number of classes returned per bucket is capped at 20.
  1692. repeated KMapEstimationQuasiIdValues bucket_values = 6;
  1693. // Total number of distinct quasi-identifier tuple values in this bucket.
  1694. int64 bucket_value_count = 7;
  1695. }
  1696. // The intervals [min_anonymity, max_anonymity] do not overlap. If a value
  1697. // doesn't correspond to any such interval, the associated frequency is
  1698. // zero. For example, the following records:
  1699. // {min_anonymity: 1, max_anonymity: 1, frequency: 17}
  1700. // {min_anonymity: 2, max_anonymity: 3, frequency: 42}
  1701. // {min_anonymity: 5, max_anonymity: 10, frequency: 99}
  1702. // mean that there are no record with an estimated anonymity of 4, 5, or
  1703. // larger than 10.
  1704. repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1;
  1705. }
  1706. // Result of the δ-presence computation. Note that these results are an
  1707. // estimation, not exact values.
  1708. message DeltaPresenceEstimationResult {
  1709. // A tuple of values for the quasi-identifier columns.
  1710. message DeltaPresenceEstimationQuasiIdValues {
  1711. // The quasi-identifier values.
  1712. repeated Value quasi_ids_values = 1;
  1713. // The estimated probability that a given individual sharing these
  1714. // quasi-identifier values is in the dataset. This value, typically called
  1715. // δ, is the ratio between the number of records in the dataset with these
  1716. // quasi-identifier values, and the total number of individuals (inside
  1717. // *and* outside the dataset) with these quasi-identifier values.
  1718. // For example, if there are 15 individuals in the dataset who share the
  1719. // same quasi-identifier values, and an estimated 100 people in the entire
  1720. // population with these values, then δ is 0.15.
  1721. double estimated_probability = 2;
  1722. }
  1723. // A DeltaPresenceEstimationHistogramBucket message with the following
  1724. // values:
  1725. // min_probability: 0.1
  1726. // max_probability: 0.2
  1727. // frequency: 42
  1728. // means that there are 42 records for which δ is in [0.1, 0.2). An
  1729. // important particular case is when min_probability = max_probability = 1:
  1730. // then, every individual who shares this quasi-identifier combination is in
  1731. // the dataset.
  1732. message DeltaPresenceEstimationHistogramBucket {
  1733. // Between 0 and 1.
  1734. double min_probability = 1;
  1735. // Always greater than or equal to min_probability.
  1736. double max_probability = 2;
  1737. // Number of records within these probability bounds.
  1738. int64 bucket_size = 5;
  1739. // Sample of quasi-identifier tuple values in this bucket. The total
  1740. // number of classes returned per bucket is capped at 20.
  1741. repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6;
  1742. // Total number of distinct quasi-identifier tuple values in this bucket.
  1743. int64 bucket_value_count = 7;
  1744. }
  1745. // The intervals [min_probability, max_probability) do not overlap. If a
  1746. // value doesn't correspond to any such interval, the associated frequency
  1747. // is zero. For example, the following records:
  1748. // {min_probability: 0, max_probability: 0.1, frequency: 17}
  1749. // {min_probability: 0.2, max_probability: 0.3, frequency: 42}
  1750. // {min_probability: 0.3, max_probability: 0.4, frequency: 99}
  1751. // mean that there are no record with an estimated probability in [0.1, 0.2)
  1752. // nor larger or equal to 0.4.
  1753. repeated DeltaPresenceEstimationHistogramBucket delta_presence_estimation_histogram = 1;
  1754. }
  1755. // Risk analysis options.
  1756. message RequestedRiskAnalysisOptions {
  1757. // The job config for the risk job.
  1758. RiskAnalysisJobConfig job_config = 1;
  1759. }
  1760. // Privacy metric to compute.
  1761. PrivacyMetric requested_privacy_metric = 1;
  1762. // Input dataset to compute metrics over.
  1763. BigQueryTable requested_source_table = 2;
  1764. // Values associated with this metric.
  1765. oneof result {
  1766. // Numerical stats result
  1767. NumericalStatsResult numerical_stats_result = 3;
  1768. // Categorical stats result
  1769. CategoricalStatsResult categorical_stats_result = 4;
  1770. // K-anonymity result
  1771. KAnonymityResult k_anonymity_result = 5;
  1772. // L-divesity result
  1773. LDiversityResult l_diversity_result = 6;
  1774. // K-map result
  1775. KMapEstimationResult k_map_estimation_result = 7;
  1776. // Delta-presence result
  1777. DeltaPresenceEstimationResult delta_presence_estimation_result = 9;
  1778. }
  1779. // The configuration used for this job.
  1780. RequestedRiskAnalysisOptions requested_options = 10;
  1781. }
  1782. // A value of a field, including its frequency.
  1783. message ValueFrequency {
  1784. // A value contained in the field in question.
  1785. Value value = 1;
  1786. // How many times the value is contained in the field.
  1787. int64 count = 2;
  1788. }
  1789. // Set of primitive values supported by the system.
  1790. // Note that for the purposes of inspection or transformation, the number
  1791. // of bytes considered to comprise a 'Value' is based on its representation
  1792. // as a UTF-8 encoded string. For example, if 'integer_value' is set to
  1793. // 123456789, the number of bytes would be counted as 9, even though an
  1794. // int64 only holds up to 8 bytes of data.
  1795. message Value {
  1796. // Value types
  1797. oneof type {
  1798. // integer
  1799. int64 integer_value = 1;
  1800. // float
  1801. double float_value = 2;
  1802. // string
  1803. string string_value = 3;
  1804. // boolean
  1805. bool boolean_value = 4;
  1806. // timestamp
  1807. google.protobuf.Timestamp timestamp_value = 5;
  1808. // time of day
  1809. google.type.TimeOfDay time_value = 6;
  1810. // date
  1811. google.type.Date date_value = 7;
  1812. // day of week
  1813. google.type.DayOfWeek day_of_week_value = 8;
  1814. }
  1815. }
  1816. // Message for infoType-dependent details parsed from quote.
  1817. message QuoteInfo {
  1818. // Object representation of the quote.
  1819. oneof parsed_quote {
  1820. // The date time indicated by the quote.
  1821. DateTime date_time = 2;
  1822. }
  1823. }
  1824. // Message for a date time object.
  1825. // e.g. 2018-01-01, 5th August.
  1826. message DateTime {
  1827. // Time zone of the date time object.
  1828. message TimeZone {
  1829. // Set only if the offset can be determined. Positive for time ahead of UTC.
  1830. // E.g. For "UTC-9", this value is -540.
  1831. int32 offset_minutes = 1;
  1832. }
  1833. // One or more of the following must be set.
  1834. // Must be a valid date or time value.
  1835. google.type.Date date = 1;
  1836. // Day of week
  1837. google.type.DayOfWeek day_of_week = 2;
  1838. // Time of day
  1839. google.type.TimeOfDay time = 3;
  1840. // Time zone
  1841. TimeZone time_zone = 4;
  1842. }
  1843. // The configuration that controls how the data will change.
  1844. message DeidentifyConfig {
  1845. oneof transformation {
  1846. // Treat the dataset as free-form text and apply the same free text
  1847. // transformation everywhere.
  1848. InfoTypeTransformations info_type_transformations = 1;
  1849. // Treat the dataset as structured. Transformations can be applied to
  1850. // specific locations within structured datasets, such as transforming
  1851. // a column within a table.
  1852. RecordTransformations record_transformations = 2;
  1853. }
  1854. // Mode for handling transformation errors. If left unspecified, the default
  1855. // mode is `TransformationErrorHandling.ThrowError`.
  1856. TransformationErrorHandling transformation_error_handling = 3;
  1857. }
  1858. // How to handle transformation errors during de-identification. A
  1859. // transformation error occurs when the requested transformation is incompatible
  1860. // with the data. For example, trying to de-identify an IP address using a
  1861. // `DateShift` transformation would result in a transformation error, since date
  1862. // info cannot be extracted from an IP address.
  1863. // Information about any incompatible transformations, and how they were
  1864. // handled, is returned in the response as part of the
  1865. // `TransformationOverviews`.
  1866. message TransformationErrorHandling {
  1867. // Throw an error and fail the request when a transformation error occurs.
  1868. message ThrowError {
  1869. }
  1870. // Skips the data without modifying it if the requested transformation would
  1871. // cause an error. For example, if a `DateShift` transformation were applied
  1872. // an an IP address, this mode would leave the IP address unchanged in the
  1873. // response.
  1874. message LeaveUntransformed {
  1875. }
  1876. // How transformation errors should be handled.
  1877. oneof mode {
  1878. // Throw an error
  1879. ThrowError throw_error = 1;
  1880. // Ignore errors
  1881. LeaveUntransformed leave_untransformed = 2;
  1882. }
  1883. }
  1884. // A rule for transforming a value.
  1885. message PrimitiveTransformation {
  1886. oneof transformation {
  1887. // Replace
  1888. ReplaceValueConfig replace_config = 1;
  1889. // Redact
  1890. RedactConfig redact_config = 2;
  1891. // Mask
  1892. CharacterMaskConfig character_mask_config = 3;
  1893. // Ffx-Fpe
  1894. CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4;
  1895. // Fixed size bucketing
  1896. FixedSizeBucketingConfig fixed_size_bucketing_config = 5;
  1897. // Bucketing
  1898. BucketingConfig bucketing_config = 6;
  1899. // Replace with infotype
  1900. ReplaceWithInfoTypeConfig replace_with_info_type_config = 7;
  1901. // Time extraction
  1902. TimePartConfig time_part_config = 8;
  1903. // Crypto
  1904. CryptoHashConfig crypto_hash_config = 9;
  1905. // Date Shift
  1906. DateShiftConfig date_shift_config = 11;
  1907. // Deterministic Crypto
  1908. CryptoDeterministicConfig crypto_deterministic_config = 12;
  1909. }
  1910. }
  1911. // For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a
  1912. // portion of the value.
  1913. message TimePartConfig {
  1914. // Components that make up time.
  1915. enum TimePart {
  1916. // Unused
  1917. TIME_PART_UNSPECIFIED = 0;
  1918. // [0-9999]
  1919. YEAR = 1;
  1920. // [1-12]
  1921. MONTH = 2;
  1922. // [1-31]
  1923. DAY_OF_MONTH = 3;
  1924. // [1-7]
  1925. DAY_OF_WEEK = 4;
  1926. // [1-53]
  1927. WEEK_OF_YEAR = 5;
  1928. // [0-23]
  1929. HOUR_OF_DAY = 6;
  1930. }
  1931. // The part of the time to keep.
  1932. TimePart part_to_extract = 1;
  1933. }
  1934. // Pseudonymization method that generates surrogates via cryptographic hashing.
  1935. // Uses SHA-256.
  1936. // The key size must be either 32 or 64 bytes.
  1937. // Outputs a base64 encoded representation of the hashed output
  1938. // (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=).
  1939. // Currently, only string and integer values can be hashed.
  1940. // See https://cloud.google.com/dlp/docs/pseudonymization to learn more.
  1941. message CryptoHashConfig {
  1942. // The key used by the hash function.
  1943. CryptoKey crypto_key = 1;
  1944. }
  1945. // Pseudonymization method that generates deterministic encryption for the given
  1946. // input. Outputs a base64 encoded representation of the encrypted output.
  1947. // Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
  1948. message CryptoDeterministicConfig {
  1949. // The key used by the encryption function.
  1950. CryptoKey crypto_key = 1;
  1951. // The custom info type to annotate the surrogate with.
  1952. // This annotation will be applied to the surrogate by prefixing it with
  1953. // the name of the custom info type followed by the number of
  1954. // characters comprising the surrogate. The following scheme defines the
  1955. // format: {info type name}({surrogate character count}):{surrogate}
  1956. //
  1957. // For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
  1958. // the surrogate is 'abc', the full replacement value
  1959. // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  1960. //
  1961. // This annotation identifies the surrogate when inspecting content using the
  1962. // custom info type 'Surrogate'. This facilitates reversal of the
  1963. // surrogate when it occurs in free text.
  1964. //
  1965. // Note: For record transformations where the entire cell in a table is being
  1966. // transformed, surrogates are not mandatory. Surrogates are used to denote
  1967. // the location of the token and are necessary for re-identification in free
  1968. // form text.
  1969. //
  1970. // In order for inspection to work properly, the name of this info type must
  1971. // not occur naturally anywhere in your data; otherwise, inspection may either
  1972. //
  1973. // - reverse a surrogate that does not correspond to an actual identifier
  1974. // - be unable to parse the surrogate and result in an error
  1975. //
  1976. // Therefore, choose your custom info type name carefully after considering
  1977. // what your data looks like. One way to select a name that has a high chance
  1978. // of yielding reliable detection is to include one or more unicode characters
  1979. // that are highly improbable to exist in your data.
  1980. // For example, assuming your data is entered from a regular ASCII keyboard,
  1981. // the symbol with the hex code point 29DD might be used like so:
  1982. // ⧝MY_TOKEN_TYPE.
  1983. InfoType surrogate_info_type = 2;
  1984. // A context may be used for higher security and maintaining
  1985. // referential integrity such that the same identifier in two different
  1986. // contexts will be given a distinct surrogate. The context is appended to
  1987. // plaintext value being encrypted. On decryption the provided context is
  1988. // validated against the value used during encryption. If a context was
  1989. // provided during encryption, same context must be provided during decryption
  1990. // as well.
  1991. //
  1992. // If the context is not set, plaintext would be used as is for encryption.
  1993. // If the context is set but:
  1994. //
  1995. // 1. there is no record present when transforming a given value or
  1996. // 2. the field is not present when transforming a given value,
  1997. //
  1998. // plaintext would be used as is for encryption.
  1999. //
  2000. // Note that case (1) is expected when an `InfoTypeTransformation` is
  2001. // applied to both structured and non-structured `ContentItem`s.
  2002. FieldId context = 3;
  2003. }
  2004. // Replace each input value with a given `Value`.
  2005. message ReplaceValueConfig {
  2006. // Value to replace it with.
  2007. Value new_value = 1;
  2008. }
  2009. // Replace each matching finding with the name of the info_type.
  2010. message ReplaceWithInfoTypeConfig {
  2011. }
  2012. // Redact a given value. For example, if used with an `InfoTypeTransformation`
  2013. // transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the
  2014. // output would be 'My phone number is '.
  2015. message RedactConfig {
  2016. }
  2017. // Characters to skip when doing deidentification of a value. These will be left
  2018. // alone and skipped.
  2019. message CharsToIgnore {
  2020. // Convenience enum for indication common characters to not transform.
  2021. enum CommonCharsToIgnore {
  2022. // Unused.
  2023. COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0;
  2024. // 0-9
  2025. NUMERIC = 1;
  2026. // A-Z
  2027. ALPHA_UPPER_CASE = 2;
  2028. // a-z
  2029. ALPHA_LOWER_CASE = 3;
  2030. // US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
  2031. PUNCTUATION = 4;
  2032. // Whitespace character, one of [ \t\n\x0B\f\r]
  2033. WHITESPACE = 5;
  2034. }
  2035. oneof characters {
  2036. // Characters to not transform when masking.
  2037. string characters_to_skip = 1;
  2038. // Common characters to not transform when masking. Useful to avoid removing
  2039. // punctuation.
  2040. CommonCharsToIgnore common_characters_to_ignore = 2;
  2041. }
  2042. }
  2043. // Partially mask a string by replacing a given number of characters with a
  2044. // fixed character. Masking can start from the beginning or end of the string.
  2045. // This can be used on data of any type (numbers, longs, and so on) and when
  2046. // de-identifying structured data we'll attempt to preserve the original data's
  2047. // type. (This allows you to take a long like 123 and modify it to a string like
  2048. // **3.
  2049. message CharacterMaskConfig {
  2050. // Character to use to mask the sensitive values&mdash;for example, `*` for an
  2051. // alphabetic string such as a name, or `0` for a numeric string such as ZIP
  2052. // code or credit card number. This string must have a length of 1. If not
  2053. // supplied, this value defaults to `*` for strings, and `0` for digits.
  2054. string masking_character = 1;
  2055. // Number of characters to mask. If not set, all matching chars will be
  2056. // masked. Skipped characters do not count towards this tally.
  2057. int32 number_to_mask = 2;
  2058. // Mask characters in reverse order. For example, if `masking_character` is
  2059. // `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the
  2060. // input string `1234-5678-9012-3456` is masked as `00000000000000-3456`.
  2061. // If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order`
  2062. // is `true`, then the string `12345` is masked as `12***`.
  2063. bool reverse_order = 3;
  2064. // When masking a string, items in this list will be skipped when replacing
  2065. // characters. For example, if the input string is `555-555-5555` and you
  2066. // instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP
  2067. // returns `***-**5-5555`.
  2068. repeated CharsToIgnore characters_to_ignore = 4;
  2069. }
  2070. // Buckets values based on fixed size ranges. The
  2071. // Bucketing transformation can provide all of this functionality,
  2072. // but requires more configuration. This message is provided as a convenience to
  2073. // the user for simple bucketing strategies.
  2074. //
  2075. // The transformed value will be a hyphenated string of
  2076. // {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20
  2077. // all values that are within this bucket will be replaced with "10-20".
  2078. //
  2079. // This can be used on data of type: double, long.
  2080. //
  2081. // If the bound Value type differs from the type of data
  2082. // being transformed, we will first attempt converting the type of the data to
  2083. // be transformed to match the type of the bound before comparing.
  2084. //
  2085. // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more.
  2086. message FixedSizeBucketingConfig {
  2087. // Required. Lower bound value of buckets. All values less than `lower_bound` are
  2088. // grouped together into a single bucket; for example if `lower_bound` = 10,
  2089. // then all values less than 10 are replaced with the value "-10".
  2090. Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED];
  2091. // Required. Upper bound value of buckets. All values greater than upper_bound are
  2092. // grouped together into a single bucket; for example if `upper_bound` = 89,
  2093. // then all values greater than 89 are replaced with the value "89+".
  2094. Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED];
  2095. // Required. Size of each bucket (except for minimum and maximum buckets). So if
  2096. // `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the
  2097. // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60,
  2098. // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works.
  2099. double bucket_size = 3 [(google.api.field_behavior) = REQUIRED];
  2100. }
  2101. // Generalization function that buckets values based on ranges. The ranges and
  2102. // replacement values are dynamically provided by the user for custom behavior,
  2103. // such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH
  2104. // This can be used on
  2105. // data of type: number, long, string, timestamp.
  2106. // If the bound `Value` type differs from the type of data being transformed, we
  2107. // will first attempt converting the type of the data to be transformed to match
  2108. // the type of the bound before comparing.
  2109. // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more.
  2110. message BucketingConfig {
  2111. // Bucket is represented as a range, along with replacement values.
  2112. message Bucket {
  2113. // Lower bound of the range, inclusive. Type should be the same as max if
  2114. // used.
  2115. Value min = 1;
  2116. // Upper bound of the range, exclusive; type must match min.
  2117. Value max = 2;
  2118. // Required. Replacement value for this bucket.
  2119. Value replacement_value = 3 [(google.api.field_behavior) = REQUIRED];
  2120. }
  2121. // Set of buckets. Ranges must be non-overlapping.
  2122. repeated Bucket buckets = 1;
  2123. }
  2124. // Replaces an identifier with a surrogate using Format Preserving Encryption
  2125. // (FPE) with the FFX mode of operation; however when used in the
  2126. // `ReidentifyContent` API method, it serves the opposite function by reversing
  2127. // the surrogate back into the original identifier. The identifier must be
  2128. // encoded as ASCII. For a given crypto key and context, the same identifier
  2129. // will be replaced with the same surrogate. Identifiers must be at least two
  2130. // characters long. In the case that the identifier is the empty string, it will
  2131. // be skipped. See https://cloud.google.com/dlp/docs/pseudonymization to learn
  2132. // more.
  2133. //
  2134. // Note: We recommend using CryptoDeterministicConfig for all use cases which
  2135. // do not require preserving the input alphabet space and size, plus warrant
  2136. // referential integrity.
  2137. message CryptoReplaceFfxFpeConfig {
  2138. // These are commonly used subsets of the alphabet that the FFX mode
  2139. // natively supports. In the algorithm, the alphabet is selected using
  2140. // the "radix". Therefore each corresponds to particular radix.
  2141. enum FfxCommonNativeAlphabet {
  2142. // Unused.
  2143. FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;
  2144. // `[0-9]` (radix of 10)
  2145. NUMERIC = 1;
  2146. // `[0-9A-F]` (radix of 16)
  2147. HEXADECIMAL = 2;
  2148. // `[0-9A-Z]` (radix of 36)
  2149. UPPER_CASE_ALPHA_NUMERIC = 3;
  2150. // `[0-9A-Za-z]` (radix of 62)
  2151. ALPHA_NUMERIC = 4;
  2152. }
  2153. // Required. The key used by the encryption algorithm.
  2154. CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED];
  2155. // The 'tweak', a context may be used for higher security since the same
  2156. // identifier in two different contexts won't be given the same surrogate. If
  2157. // the context is not set, a default tweak will be used.
  2158. //
  2159. // If the context is set but:
  2160. //
  2161. // 1. there is no record present when transforming a given value or
  2162. // 1. the field is not present when transforming a given value,
  2163. //
  2164. // a default tweak will be used.
  2165. //
  2166. // Note that case (1) is expected when an `InfoTypeTransformation` is
  2167. // applied to both structured and non-structured `ContentItem`s.
  2168. // Currently, the referenced field may be of value type integer or string.
  2169. //
  2170. // The tweak is constructed as a sequence of bytes in big endian byte order
  2171. // such that:
  2172. //
  2173. // - a 64 bit integer is encoded followed by a single byte of value 1
  2174. // - a string is encoded in UTF-8 format followed by a single byte of value 2
  2175. FieldId context = 2;
  2176. // Choose an alphabet which the data being transformed will be made up of.
  2177. oneof alphabet {
  2178. // Common alphabets.
  2179. FfxCommonNativeAlphabet common_alphabet = 4;
  2180. // This is supported by mapping these to the alphanumeric characters
  2181. // that the FFX mode natively supports. This happens before/after
  2182. // encryption/decryption.
  2183. // Each character listed must appear only once.
  2184. // Number of characters must be in the range [2, 95].
  2185. // This must be encoded as ASCII.
  2186. // The order of characters does not matter.
  2187. // The full list of allowed characters is:
  2188. // <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
  2189. // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/</code>
  2190. string custom_alphabet = 5;
  2191. // The native way to select the alphabet. Must be in the range [2, 95].
  2192. int32 radix = 6;
  2193. }
  2194. // The custom infoType to annotate the surrogate with.
  2195. // This annotation will be applied to the surrogate by prefixing it with
  2196. // the name of the custom infoType followed by the number of
  2197. // characters comprising the surrogate. The following scheme defines the
  2198. // format: info_type_name(surrogate_character_count):surrogate
  2199. //
  2200. // For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE' and
  2201. // the surrogate is 'abc', the full replacement value
  2202. // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  2203. //
  2204. // This annotation identifies the surrogate when inspecting content using the
  2205. // custom infoType
  2206. // [`SurrogateType`](https://cloud.google.com/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype).
  2207. // This facilitates reversal of the surrogate when it occurs in free text.
  2208. //
  2209. // In order for inspection to work properly, the name of this infoType must
  2210. // not occur naturally anywhere in your data; otherwise, inspection may
  2211. // find a surrogate that does not correspond to an actual identifier.
  2212. // Therefore, choose your custom infoType name carefully after considering
  2213. // what your data looks like. One way to select a name that has a high chance
  2214. // of yielding reliable detection is to include one or more unicode characters
  2215. // that are highly improbable to exist in your data.
  2216. // For example, assuming your data is entered from a regular ASCII keyboard,
  2217. // the symbol with the hex code point 29DD might be used like so:
  2218. // ⧝MY_TOKEN_TYPE
  2219. InfoType surrogate_info_type = 8;
  2220. }
  2221. // This is a data encryption key (DEK) (as opposed to
  2222. // a key encryption key (KEK) stored by KMS).
  2223. // When using KMS to wrap/unwrap DEKs, be sure to set an appropriate
  2224. // IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot
  2225. // unwrap the data crypto key.
  2226. message CryptoKey {
  2227. // Sources of crypto keys.
  2228. oneof source {
  2229. // Transient crypto key
  2230. TransientCryptoKey transient = 1;
  2231. // Unwrapped crypto key
  2232. UnwrappedCryptoKey unwrapped = 2;
  2233. // Kms wrapped key
  2234. KmsWrappedCryptoKey kms_wrapped = 3;
  2235. }
  2236. }
  2237. // Use this to have a random data crypto key generated.
  2238. // It will be discarded after the request finishes.
  2239. message TransientCryptoKey {
  2240. // Required. Name of the key.
  2241. // This is an arbitrary string used to differentiate different keys.
  2242. // A unique key is generated per name: two separate `TransientCryptoKey`
  2243. // protos share the same generated key if their names are the same.
  2244. // When the data crypto key is generated, this name is not used in any way
  2245. // (repeating the api call will result in a different key being generated).
  2246. string name = 1 [(google.api.field_behavior) = REQUIRED];
  2247. }
  2248. // Using raw keys is prone to security risks due to accidentally
  2249. // leaking the key. Choose another type of key if possible.
  2250. message UnwrappedCryptoKey {
  2251. // Required. A 128/192/256 bit key.
  2252. bytes key = 1 [(google.api.field_behavior) = REQUIRED];
  2253. }
  2254. // Include to use an existing data crypto key wrapped by KMS.
  2255. // The wrapped key must be a 128/192/256 bit key.
  2256. // Authorization requires the following IAM permissions when sending a request
  2257. // to perform a crypto transformation using a kms-wrapped crypto key:
  2258. // dlp.kms.encrypt
  2259. message KmsWrappedCryptoKey {
  2260. // Required. The wrapped data crypto key.
  2261. bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED];
  2262. // Required. The resource name of the KMS CryptoKey to use for unwrapping.
  2263. string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED];
  2264. }
  2265. // Shifts dates by random number of days, with option to be consistent for the
  2266. // same context. See https://cloud.google.com/dlp/docs/concepts-date-shifting
  2267. // to learn more.
  2268. message DateShiftConfig {
  2269. // Required. Range of shift in days. Actual shift will be selected at random within this
  2270. // range (inclusive ends). Negative means shift to earlier in time. Must not
  2271. // be more than 365250 days (1000 years) each direction.
  2272. //
  2273. // For example, 3 means shift date to at most 3 days into the future.
  2274. int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED];
  2275. // Required. For example, -5 means shift date to at most 5 days back in the past.
  2276. int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED];
  2277. // Points to the field that contains the context, for example, an entity id.
  2278. // If set, must also set cryptoKey. If set, shift will be consistent for the
  2279. // given context.
  2280. FieldId context = 3;
  2281. // Method for calculating shift that takes context into consideration. If
  2282. // set, must also set context. Can only be applied to table items.
  2283. oneof method {
  2284. // Causes the shift to be computed based on this key and the context. This
  2285. // results in the same shift for the same context and crypto_key. If
  2286. // set, must also set context. Can only be applied to table items.
  2287. CryptoKey crypto_key = 4;
  2288. }
  2289. }
  2290. // A type of transformation that will scan unstructured text and
  2291. // apply various `PrimitiveTransformation`s to each finding, where the
  2292. // transformation is applied to only values that were identified as a specific
  2293. // info_type.
  2294. message InfoTypeTransformations {
  2295. // A transformation to apply to text that is identified as a specific
  2296. // info_type.
  2297. message InfoTypeTransformation {
  2298. // InfoTypes to apply the transformation to. An empty list will cause
  2299. // this transformation to apply to all findings that correspond to
  2300. // infoTypes that were requested in `InspectConfig`.
  2301. repeated InfoType info_types = 1;
  2302. // Required. Primitive transformation to apply to the infoType.
  2303. PrimitiveTransformation primitive_transformation = 2 [(google.api.field_behavior) = REQUIRED];
  2304. }
  2305. // Required. Transformation for each infoType. Cannot specify more than one
  2306. // for a given infoType.
  2307. repeated InfoTypeTransformation transformations = 1 [(google.api.field_behavior) = REQUIRED];
  2308. }
  2309. // The transformation to apply to the field.
  2310. message FieldTransformation {
  2311. // Required. Input field(s) to apply the transformation to.
  2312. repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED];
  2313. // Only apply the transformation if the condition evaluates to true for the
  2314. // given `RecordCondition`. The conditions are allowed to reference fields
  2315. // that are not used in the actual transformation.
  2316. //
  2317. // Example Use Cases:
  2318. //
  2319. // - Apply a different bucket transformation to an age column if the zip code
  2320. // column for the same record is within a specific range.
  2321. // - Redact a field if the date of birth field is greater than 85.
  2322. RecordCondition condition = 3;
  2323. // Transformation to apply. [required]
  2324. oneof transformation {
  2325. // Apply the transformation to the entire field.
  2326. PrimitiveTransformation primitive_transformation = 4;
  2327. // Treat the contents of the field as free text, and selectively
  2328. // transform content that matches an `InfoType`.
  2329. InfoTypeTransformations info_type_transformations = 5;
  2330. }
  2331. }
  2332. // A type of transformation that is applied over structured data such as a
  2333. // table.
  2334. message RecordTransformations {
  2335. // Transform the record by applying various field transformations.
  2336. repeated FieldTransformation field_transformations = 1;
  2337. // Configuration defining which records get suppressed entirely. Records that
  2338. // match any suppression rule are omitted from the output.
  2339. repeated RecordSuppression record_suppressions = 2;
  2340. }
  2341. // Configuration to suppress records whose suppression conditions evaluate to
  2342. // true.
  2343. message RecordSuppression {
  2344. // A condition that when it evaluates to true will result in the record being
  2345. // evaluated to be suppressed from the transformed content.
  2346. RecordCondition condition = 1;
  2347. }
  2348. // A condition for determining whether a transformation should be applied to
  2349. // a field.
  2350. message RecordCondition {
  2351. // The field type of `value` and `field` do not need to match to be
  2352. // considered equal, but not all comparisons are possible.
  2353. // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types,
  2354. // but all other comparisons are invalid with incompatible types.
  2355. // A `value` of type:
  2356. //
  2357. // - `string` can be compared against all other types
  2358. // - `boolean` can only be compared against other booleans
  2359. // - `integer` can be compared against doubles or a string if the string value
  2360. // can be parsed as an integer.
  2361. // - `double` can be compared against integers or a string if the string can
  2362. // be parsed as a double.
  2363. // - `Timestamp` can be compared against strings in RFC 3339 date string
  2364. // format.
  2365. // - `TimeOfDay` can be compared against timestamps and strings in the format
  2366. // of 'HH:mm:ss'.
  2367. //
  2368. // If we fail to compare do to type mismatch, a warning will be given and
  2369. // the condition will evaluate to false.
  2370. message Condition {
  2371. // Required. Field within the record this condition is evaluated against.
  2372. FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  2373. // Required. Operator used to compare the field or infoType to the value.
  2374. RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED];
  2375. // Value to compare against. [Mandatory, except for `EXISTS` tests.]
  2376. Value value = 4;
  2377. }
  2378. // A collection of conditions.
  2379. message Conditions {
  2380. // A collection of conditions.
  2381. repeated Condition conditions = 1;
  2382. }
  2383. // An expression, consisting or an operator and conditions.
  2384. message Expressions {
  2385. // Logical operators for conditional checks.
  2386. enum LogicalOperator {
  2387. // Unused
  2388. LOGICAL_OPERATOR_UNSPECIFIED = 0;
  2389. // Conditional AND
  2390. AND = 1;
  2391. }
  2392. // The operator to apply to the result of conditions. Default and currently
  2393. // only supported value is `AND`.
  2394. LogicalOperator logical_operator = 1;
  2395. // Expression types.
  2396. oneof type {
  2397. // Conditions to apply to the expression.
  2398. Conditions conditions = 3;
  2399. }
  2400. }
  2401. // An expression.
  2402. Expressions expressions = 3;
  2403. }
  2404. // Overview of the modifications that occurred.
  2405. message TransformationOverview {
  2406. // Total size in bytes that were transformed in some way.
  2407. int64 transformed_bytes = 2;
  2408. // Transformations applied to the dataset.
  2409. repeated TransformationSummary transformation_summaries = 3;
  2410. }
  2411. // Summary of a single transformation.
  2412. // Only one of 'transformation', 'field_transformation', or 'record_suppress'
  2413. // will be set.
  2414. message TransformationSummary {
  2415. // A collection that informs the user the number of times a particular
  2416. // `TransformationResultCode` and error details occurred.
  2417. message SummaryResult {
  2418. // Number of transformations counted by this result.
  2419. int64 count = 1;
  2420. // Outcome of the transformation.
  2421. TransformationResultCode code = 2;
  2422. // A place for warnings or errors to show up if a transformation didn't
  2423. // work as expected.
  2424. string details = 3;
  2425. }
  2426. // Possible outcomes of transformations.
  2427. enum TransformationResultCode {
  2428. // Unused
  2429. TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0;
  2430. // Transformation completed without an error.
  2431. SUCCESS = 1;
  2432. // Transformation had an error.
  2433. ERROR = 2;
  2434. }
  2435. // Set if the transformation was limited to a specific InfoType.
  2436. InfoType info_type = 1;
  2437. // Set if the transformation was limited to a specific FieldId.
  2438. FieldId field = 2;
  2439. // The specific transformation these stats apply to.
  2440. PrimitiveTransformation transformation = 3;
  2441. // The field transformation that was applied.
  2442. // If multiple field transformations are requested for a single field,
  2443. // this list will contain all of them; otherwise, only one is supplied.
  2444. repeated FieldTransformation field_transformations = 5;
  2445. // The specific suppression option these stats apply to.
  2446. RecordSuppression record_suppress = 6;
  2447. // Collection of all transformations that took place or had an error.
  2448. repeated SummaryResult results = 4;
  2449. // Total size in bytes that were transformed in some way.
  2450. int64 transformed_bytes = 7;
  2451. }
  2452. // Schedule for triggeredJobs.
  2453. message Schedule {
  2454. oneof option {
  2455. // With this option a job is started a regular periodic basis. For
  2456. // example: every day (86400 seconds).
  2457. //
  2458. // A scheduled start time will be skipped if the previous
  2459. // execution has not ended when its scheduled time occurs.
  2460. //
  2461. // This value must be set to a time duration greater than or equal
  2462. // to 1 day and can be no longer than 60 days.
  2463. google.protobuf.Duration recurrence_period_duration = 1;
  2464. }
  2465. }
  2466. // Job trigger option for hybrid jobs. Jobs must be manually created
  2467. // and finished.
  2468. message Manual {
  2469. }
  2470. // The inspectTemplate contains a configuration (set of types of sensitive data
  2471. // to be detected) to be used anywhere you otherwise would normally specify
  2472. // InspectConfig. See https://cloud.google.com/dlp/docs/concepts-templates
  2473. // to learn more.
  2474. message InspectTemplate {
  2475. option (google.api.resource) = {
  2476. type: "dlp.googleapis.com/InspectTemplate"
  2477. pattern: "organizations/{organization}/inspectTemplates/{inspect_template}"
  2478. pattern: "projects/{project}/inspectTemplates/{inspect_template}"
  2479. pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}"
  2480. pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}"
  2481. };
  2482. // Output only. The template name.
  2483. //
  2484. // The template will have one of the following formats:
  2485. // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR
  2486. // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`;
  2487. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  2488. // Display name (max 256 chars).
  2489. string display_name = 2;
  2490. // Short description (max 256 chars).
  2491. string description = 3;
  2492. // Output only. The creation timestamp of an inspectTemplate.
  2493. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  2494. // Output only. The last update timestamp of an inspectTemplate.
  2495. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  2496. // The core content of the template. Configuration of the scanning process.
  2497. InspectConfig inspect_config = 6;
  2498. }
  2499. // DeidentifyTemplates contains instructions on how to de-identify content.
  2500. // See https://cloud.google.com/dlp/docs/concepts-templates to learn more.
  2501. message DeidentifyTemplate {
  2502. option (google.api.resource) = {
  2503. type: "dlp.googleapis.com/DeidentifyTemplate"
  2504. pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}"
  2505. pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}"
  2506. pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}"
  2507. pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}"
  2508. };
  2509. // Output only. The template name.
  2510. //
  2511. // The template will have one of the following formats:
  2512. // `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR
  2513. // `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID`
  2514. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  2515. // Display name (max 256 chars).
  2516. string display_name = 2;
  2517. // Short description (max 256 chars).
  2518. string description = 3;
  2519. // Output only. The creation timestamp of an inspectTemplate.
  2520. google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  2521. // Output only. The last update timestamp of an inspectTemplate.
  2522. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  2523. // ///////////// // The core content of the template // ///////////////
  2524. DeidentifyConfig deidentify_config = 6;
  2525. }
  2526. // Details information about an error encountered during job execution or
  2527. // the results of an unsuccessful activation of the JobTrigger.
  2528. message Error {
  2529. // Detailed error codes and messages.
  2530. google.rpc.Status details = 1;
  2531. // The times the error occurred.
  2532. repeated google.protobuf.Timestamp timestamps = 2;
  2533. }
  2534. // Contains a configuration to make dlp api calls on a repeating basis.
  2535. // See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more.
  2536. message JobTrigger {
  2537. option (google.api.resource) = {
  2538. type: "dlp.googleapis.com/JobTrigger"
  2539. pattern: "projects/{project}/jobTriggers/{job_trigger}"
  2540. pattern: "projects/{project}/locations/{location}/jobTriggers/{job_trigger}"
  2541. };
  2542. // What event needs to occur for a new job to be started.
  2543. message Trigger {
  2544. oneof trigger {
  2545. // Create a job on a repeating basis based on the elapse of time.
  2546. Schedule schedule = 1;
  2547. // For use with hybrid jobs. Jobs must be manually created and finished.
  2548. // Early access feature is in a pre-release state and might change or have
  2549. // limited support. For more information, see
  2550. // https://cloud.google.com/products#product-launch-stages.
  2551. Manual manual = 2;
  2552. }
  2553. }
  2554. // Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs
  2555. // will be created with this configuration. The service may automatically
  2556. // pause triggers experiencing frequent errors. To restart a job, set the
  2557. // status to HEALTHY after correcting user errors.
  2558. enum Status {
  2559. // Unused.
  2560. STATUS_UNSPECIFIED = 0;
  2561. // Trigger is healthy.
  2562. HEALTHY = 1;
  2563. // Trigger is temporarily paused.
  2564. PAUSED = 2;
  2565. // Trigger is cancelled and can not be resumed.
  2566. CANCELLED = 3;
  2567. }
  2568. // Unique resource name for the triggeredJob, assigned by the service when the
  2569. // triggeredJob is created, for example
  2570. // `projects/dlp-test-project/jobTriggers/53234423`.
  2571. string name = 1;
  2572. // Display name (max 100 chars)
  2573. string display_name = 2;
  2574. // User provided description (max 256 chars)
  2575. string description = 3;
  2576. // The configuration details for the specific type of job to run.
  2577. oneof job {
  2578. // For inspect jobs, a snapshot of the configuration.
  2579. InspectJobConfig inspect_job = 4;
  2580. }
  2581. // A list of triggers which will be OR'ed together. Only one in the list
  2582. // needs to trigger for a job to be started. The list may contain only
  2583. // a single Schedule trigger and must have at least one object.
  2584. repeated Trigger triggers = 5;
  2585. // Output only. A stream of errors encountered when the trigger was activated. Repeated
  2586. // errors may result in the JobTrigger automatically being paused.
  2587. // Will return the last 100 errors. Whenever the JobTrigger is modified
  2588. // this list will be cleared.
  2589. repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  2590. // Output only. The creation timestamp of a triggeredJob.
  2591. google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  2592. // Output only. The last update timestamp of a triggeredJob.
  2593. google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  2594. // Output only. The timestamp of the last time this trigger executed.
  2595. google.protobuf.Timestamp last_run_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  2596. // Required. A status for this trigger.
  2597. Status status = 10 [(google.api.field_behavior) = REQUIRED];
  2598. }
  2599. // A task to execute on the completion of a job.
  2600. // See https://cloud.google.com/dlp/docs/concepts-actions to learn more.
  2601. message Action {
  2602. // If set, the detailed findings will be persisted to the specified
  2603. // OutputStorageConfig. Only a single instance of this action can be
  2604. // specified.
  2605. // Compatible with: Inspect, Risk
  2606. message SaveFindings {
  2607. // Location to store findings outside of DLP.
  2608. OutputStorageConfig output_config = 1;
  2609. }
  2610. // Publish a message into given Pub/Sub topic when DlpJob has completed. The
  2611. // message contains a single field, `DlpJobName`, which is equal to the
  2612. // finished job's
  2613. // [`DlpJob.name`](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.dlpJobs#DlpJob).
  2614. // Compatible with: Inspect, Risk
  2615. message PublishToPubSub {
  2616. // Cloud Pub/Sub topic to send notifications to. The topic must have given
  2617. // publishing access rights to the DLP API service account executing
  2618. // the long running DlpJob sending the notifications.
  2619. // Format is projects/{project}/topics/{topic}.
  2620. string topic = 1;
  2621. }
  2622. // Publish the result summary of a DlpJob to the Cloud Security
  2623. // Command Center (CSCC Alpha).
  2624. // This action is only available for projects which are parts of
  2625. // an organization and whitelisted for the alpha Cloud Security Command
  2626. // Center.
  2627. // The action will publish count of finding instances and their info types.
  2628. // The summary of findings will be persisted in CSCC and are governed by CSCC
  2629. // service-specific policy, see https://cloud.google.com/terms/service-terms
  2630. // Only a single instance of this action can be specified.
  2631. // Compatible with: Inspect
  2632. message PublishSummaryToCscc {
  2633. }
  2634. // Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the
  2635. // results of the DlpJob will be applied to the entry for the resource scanned
  2636. // in Cloud Data Catalog. Any labels previously written by another DlpJob will
  2637. // be deleted. InfoType naming patterns are strictly enforced when using this
  2638. // feature. Note that the findings will be persisted in Cloud Data Catalog
  2639. // storage and are governed by Data Catalog service-specific policy, see
  2640. // https://cloud.google.com/terms/service-terms
  2641. // Only a single instance of this action can be specified and only allowed if
  2642. // all resources being scanned are BigQuery tables.
  2643. // Compatible with: Inspect
  2644. message PublishFindingsToCloudDataCatalog {
  2645. }
  2646. // Enable email notification to project owners and editors on jobs's
  2647. // completion/failure.
  2648. message JobNotificationEmails {
  2649. }
  2650. // Enable Stackdriver metric dlp.googleapis.com/finding_count. This
  2651. // will publish a metric to stack driver on each infotype requested and
  2652. // how many findings were found for it. CustomDetectors will be bucketed
  2653. // as 'Custom' under the Stackdriver label 'info_type'.
  2654. message PublishToStackdriver {
  2655. }
  2656. oneof action {
  2657. // Save resulting findings in a provided location.
  2658. SaveFindings save_findings = 1;
  2659. // Publish a notification to a pubsub topic.
  2660. PublishToPubSub pub_sub = 2;
  2661. // Publish summary to Cloud Security Command Center (Alpha).
  2662. PublishSummaryToCscc publish_summary_to_cscc = 3;
  2663. // Publish findings to Cloud Datahub.
  2664. PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5;
  2665. // Enable email notification for project owners and editors on job's
  2666. // completion/failure.
  2667. JobNotificationEmails job_notification_emails = 8;
  2668. // Enable Stackdriver metric dlp.googleapis.com/finding_count.
  2669. PublishToStackdriver publish_to_stackdriver = 9;
  2670. }
  2671. }
  2672. // Request message for CreateInspectTemplate.
  2673. message CreateInspectTemplateRequest {
  2674. // Required. Parent resource name.
  2675. //
  2676. // The format of this value varies depending on the scope of the request
  2677. // (project or organization) and whether you have [specified a processing
  2678. // location](https://cloud.google.com/dlp/docs/specifying-location):
  2679. //
  2680. // + Projects scope, location specified:<br/>
  2681. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  2682. // + Projects scope, no location specified (defaults to global):<br/>
  2683. // `projects/`<var>PROJECT_ID</var>
  2684. // + Organizations scope, location specified:<br/>
  2685. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  2686. // + Organizations scope, no location specified (defaults to global):<br/>
  2687. // `organizations/`<var>ORG_ID</var>
  2688. //
  2689. // The following example `parent` string specifies a parent project with the
  2690. // identifier `example-project`, and specifies the `europe-west3` location
  2691. // for processing data:
  2692. //
  2693. // parent=projects/example-project/locations/europe-west3
  2694. string parent = 1 [
  2695. (google.api.field_behavior) = REQUIRED,
  2696. (google.api.resource_reference) = {
  2697. child_type: "dlp.googleapis.com/InspectTemplate"
  2698. }
  2699. ];
  2700. // Required. The InspectTemplate to create.
  2701. InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED];
  2702. // The template id can contain uppercase and lowercase letters,
  2703. // numbers, and hyphens; that is, it must match the regular
  2704. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  2705. // characters. Can be empty to allow the system to generate one.
  2706. string template_id = 3;
  2707. // Deprecated. This field has no effect.
  2708. string location_id = 4;
  2709. }
  2710. // Request message for UpdateInspectTemplate.
  2711. message UpdateInspectTemplateRequest {
  2712. // Required. Resource name of organization and inspectTemplate to be updated, for
  2713. // example `organizations/433245324/inspectTemplates/432452342` or
  2714. // projects/project-id/inspectTemplates/432452342.
  2715. string name = 1 [
  2716. (google.api.field_behavior) = REQUIRED,
  2717. (google.api.resource_reference) = {
  2718. type: "dlp.googleapis.com/InspectTemplate"
  2719. }
  2720. ];
  2721. // New InspectTemplate value.
  2722. InspectTemplate inspect_template = 2;
  2723. // Mask to control which fields get updated.
  2724. google.protobuf.FieldMask update_mask = 3;
  2725. }
  2726. // Request message for GetInspectTemplate.
  2727. message GetInspectTemplateRequest {
  2728. // Required. Resource name of the organization and inspectTemplate to be read, for
  2729. // example `organizations/433245324/inspectTemplates/432452342` or
  2730. // projects/project-id/inspectTemplates/432452342.
  2731. string name = 1 [
  2732. (google.api.field_behavior) = REQUIRED,
  2733. (google.api.resource_reference) = {
  2734. type: "dlp.googleapis.com/InspectTemplate"
  2735. }
  2736. ];
  2737. }
  2738. // Request message for ListInspectTemplates.
  2739. message ListInspectTemplatesRequest {
  2740. // Required. Parent resource name.
  2741. //
  2742. // The format of this value varies depending on the scope of the request
  2743. // (project or organization) and whether you have [specified a processing
  2744. // location](https://cloud.google.com/dlp/docs/specifying-location):
  2745. //
  2746. // + Projects scope, location specified:<br/>
  2747. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  2748. // + Projects scope, no location specified (defaults to global):<br/>
  2749. // `projects/`<var>PROJECT_ID</var>
  2750. // + Organizations scope, location specified:<br/>
  2751. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  2752. // + Organizations scope, no location specified (defaults to global):<br/>
  2753. // `organizations/`<var>ORG_ID</var>
  2754. //
  2755. // The following example `parent` string specifies a parent project with the
  2756. // identifier `example-project`, and specifies the `europe-west3` location
  2757. // for processing data:
  2758. //
  2759. // parent=projects/example-project/locations/europe-west3
  2760. string parent = 1 [
  2761. (google.api.field_behavior) = REQUIRED,
  2762. (google.api.resource_reference) = {
  2763. child_type: "dlp.googleapis.com/InspectTemplate"
  2764. }
  2765. ];
  2766. // Page token to continue retrieval. Comes from previous call
  2767. // to `ListInspectTemplates`.
  2768. string page_token = 2;
  2769. // Size of the page, can be limited by server. If zero server returns
  2770. // a page of max size 100.
  2771. int32 page_size = 3;
  2772. // Comma separated list of fields to order by,
  2773. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  2774. // default sorting order is ascending, redundant space characters are
  2775. // insignificant.
  2776. //
  2777. // Example: `name asc,update_time, create_time desc`
  2778. //
  2779. // Supported fields are:
  2780. //
  2781. // - `create_time`: corresponds to time the template was created.
  2782. // - `update_time`: corresponds to time the template was last updated.
  2783. // - `name`: corresponds to template's name.
  2784. // - `display_name`: corresponds to template's display name.
  2785. string order_by = 4;
  2786. // Deprecated. This field has no effect.
  2787. string location_id = 5;
  2788. }
  2789. // Response message for ListInspectTemplates.
  2790. message ListInspectTemplatesResponse {
  2791. // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest.
  2792. repeated InspectTemplate inspect_templates = 1;
  2793. // If the next page is available then the next page token to be used
  2794. // in following ListInspectTemplates request.
  2795. string next_page_token = 2;
  2796. }
  2797. // Request message for DeleteInspectTemplate.
  2798. message DeleteInspectTemplateRequest {
  2799. // Required. Resource name of the organization and inspectTemplate to be deleted, for
  2800. // example `organizations/433245324/inspectTemplates/432452342` or
  2801. // projects/project-id/inspectTemplates/432452342.
  2802. string name = 1 [
  2803. (google.api.field_behavior) = REQUIRED,
  2804. (google.api.resource_reference) = {
  2805. type: "dlp.googleapis.com/InspectTemplate"
  2806. }
  2807. ];
  2808. }
  2809. // Request message for CreateJobTrigger.
  2810. message CreateJobTriggerRequest {
  2811. // Required. Parent resource name.
  2812. //
  2813. // The format of this value varies depending on whether you have [specified a
  2814. // processing
  2815. // location](https://cloud.google.com/dlp/docs/specifying-location):
  2816. //
  2817. // + Projects scope, location specified:<br/>
  2818. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  2819. // + Projects scope, no location specified (defaults to global):<br/>
  2820. // `projects/`<var>PROJECT_ID</var>
  2821. //
  2822. // The following example `parent` string specifies a parent project with the
  2823. // identifier `example-project`, and specifies the `europe-west3` location
  2824. // for processing data:
  2825. //
  2826. // parent=projects/example-project/locations/europe-west3
  2827. string parent = 1 [
  2828. (google.api.field_behavior) = REQUIRED,
  2829. (google.api.resource_reference) = {
  2830. child_type: "dlp.googleapis.com/JobTrigger"
  2831. }
  2832. ];
  2833. // Required. The JobTrigger to create.
  2834. JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED];
  2835. // The trigger id can contain uppercase and lowercase letters,
  2836. // numbers, and hyphens; that is, it must match the regular
  2837. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  2838. // characters. Can be empty to allow the system to generate one.
  2839. string trigger_id = 3;
  2840. // Deprecated. This field has no effect.
  2841. string location_id = 4;
  2842. }
  2843. // Request message for ActivateJobTrigger.
  2844. message ActivateJobTriggerRequest {
  2845. // Required. Resource name of the trigger to activate, for example
  2846. // `projects/dlp-test-project/jobTriggers/53234423`.
  2847. string name = 1 [
  2848. (google.api.field_behavior) = REQUIRED,
  2849. (google.api.resource_reference) = {
  2850. type: "dlp.googleapis.com/JobTrigger"
  2851. }
  2852. ];
  2853. }
  2854. // Request message for UpdateJobTrigger.
  2855. message UpdateJobTriggerRequest {
  2856. // Required. Resource name of the project and the triggeredJob, for example
  2857. // `projects/dlp-test-project/jobTriggers/53234423`.
  2858. string name = 1 [
  2859. (google.api.field_behavior) = REQUIRED,
  2860. (google.api.resource_reference) = {
  2861. type: "dlp.googleapis.com/JobTrigger"
  2862. }
  2863. ];
  2864. // New JobTrigger value.
  2865. JobTrigger job_trigger = 2;
  2866. // Mask to control which fields get updated.
  2867. google.protobuf.FieldMask update_mask = 3;
  2868. }
  2869. // Request message for GetJobTrigger.
  2870. message GetJobTriggerRequest {
  2871. // Required. Resource name of the project and the triggeredJob, for example
  2872. // `projects/dlp-test-project/jobTriggers/53234423`.
  2873. string name = 1 [
  2874. (google.api.field_behavior) = REQUIRED,
  2875. (google.api.resource_reference) = {
  2876. type: "dlp.googleapis.com/JobTrigger"
  2877. }
  2878. ];
  2879. }
  2880. // Request message for CreateDlpJobRequest. Used to initiate long running
  2881. // jobs such as calculating risk metrics or inspecting Google Cloud
  2882. // Storage.
  2883. message CreateDlpJobRequest {
  2884. // Required. Parent resource name.
  2885. //
  2886. // The format of this value varies depending on whether you have [specified a
  2887. // processing
  2888. // location](https://cloud.google.com/dlp/docs/specifying-location):
  2889. //
  2890. // + Projects scope, location specified:<br/>
  2891. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  2892. // + Projects scope, no location specified (defaults to global):<br/>
  2893. // `projects/`<var>PROJECT_ID</var>
  2894. //
  2895. // The following example `parent` string specifies a parent project with the
  2896. // identifier `example-project`, and specifies the `europe-west3` location
  2897. // for processing data:
  2898. //
  2899. // parent=projects/example-project/locations/europe-west3
  2900. string parent = 1 [
  2901. (google.api.field_behavior) = REQUIRED,
  2902. (google.api.resource_reference) = {
  2903. child_type: "dlp.googleapis.com/DlpJob"
  2904. }
  2905. ];
  2906. // The configuration details for the specific type of job to run.
  2907. oneof job {
  2908. // Set to control what and how to inspect.
  2909. InspectJobConfig inspect_job = 2;
  2910. // Set to choose what metric to calculate.
  2911. RiskAnalysisJobConfig risk_job = 3;
  2912. }
  2913. // The job id can contain uppercase and lowercase letters,
  2914. // numbers, and hyphens; that is, it must match the regular
  2915. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  2916. // characters. Can be empty to allow the system to generate one.
  2917. string job_id = 4;
  2918. // Deprecated. This field has no effect.
  2919. string location_id = 5;
  2920. }
  2921. // Request message for ListJobTriggers.
  2922. message ListJobTriggersRequest {
  2923. // Required. Parent resource name.
  2924. //
  2925. // The format of this value varies depending on whether you have [specified a
  2926. // processing
  2927. // location](https://cloud.google.com/dlp/docs/specifying-location):
  2928. //
  2929. // + Projects scope, location specified:<br/>
  2930. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  2931. // + Projects scope, no location specified (defaults to global):<br/>
  2932. // `projects/`<var>PROJECT_ID</var>
  2933. //
  2934. // The following example `parent` string specifies a parent project with the
  2935. // identifier `example-project`, and specifies the `europe-west3` location
  2936. // for processing data:
  2937. //
  2938. // parent=projects/example-project/locations/europe-west3
  2939. string parent = 1 [
  2940. (google.api.field_behavior) = REQUIRED,
  2941. (google.api.resource_reference) = {
  2942. child_type: "dlp.googleapis.com/JobTrigger"
  2943. }
  2944. ];
  2945. // Page token to continue retrieval. Comes from previous call
  2946. // to ListJobTriggers. `order_by` field must not
  2947. // change for subsequent calls.
  2948. string page_token = 2;
  2949. // Size of the page, can be limited by a server.
  2950. int32 page_size = 3;
  2951. // Comma separated list of triggeredJob fields to order by,
  2952. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  2953. // default sorting order is ascending, redundant space characters are
  2954. // insignificant.
  2955. //
  2956. // Example: `name asc,update_time, create_time desc`
  2957. //
  2958. // Supported fields are:
  2959. //
  2960. // - `create_time`: corresponds to time the JobTrigger was created.
  2961. // - `update_time`: corresponds to time the JobTrigger was last updated.
  2962. // - `last_run_time`: corresponds to the last time the JobTrigger ran.
  2963. // - `name`: corresponds to JobTrigger's name.
  2964. // - `display_name`: corresponds to JobTrigger's display name.
  2965. // - `status`: corresponds to JobTrigger's status.
  2966. string order_by = 4;
  2967. // Allows filtering.
  2968. //
  2969. // Supported syntax:
  2970. //
  2971. // * Filter expressions are made up of one or more restrictions.
  2972. // * Restrictions can be combined by `AND` or `OR` logical operators. A
  2973. // sequence of restrictions implicitly uses `AND`.
  2974. // * A restriction has the form of `{field} {operator} {value}`.
  2975. // * Supported fields/values for inspect jobs:
  2976. // - `status` - HEALTHY|PAUSED|CANCELLED
  2977. // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  2978. // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
  2979. // quotation marks. Nanoseconds are ignored.
  2980. // - 'error_count' - Number of errors that have occurred while running.
  2981. // * The operator must be `=` or `!=` for status and inspected_storage.
  2982. //
  2983. // Examples:
  2984. //
  2985. // * inspected_storage = cloud_storage AND status = HEALTHY
  2986. // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  2987. // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
  2988. // * last_run_time > \"2017-12-12T00:00:00+00:00\"
  2989. //
  2990. // The length of this field should be no more than 500 characters.
  2991. string filter = 5;
  2992. // Deprecated. This field has no effect.
  2993. string location_id = 7;
  2994. }
  2995. // Response message for ListJobTriggers.
  2996. message ListJobTriggersResponse {
  2997. // List of triggeredJobs, up to page_size in ListJobTriggersRequest.
  2998. repeated JobTrigger job_triggers = 1;
  2999. // If the next page is available then the next page token to be used
  3000. // in following ListJobTriggers request.
  3001. string next_page_token = 2;
  3002. }
  3003. // Request message for DeleteJobTrigger.
  3004. message DeleteJobTriggerRequest {
  3005. // Required. Resource name of the project and the triggeredJob, for example
  3006. // `projects/dlp-test-project/jobTriggers/53234423`.
  3007. string name = 1 [
  3008. (google.api.field_behavior) = REQUIRED,
  3009. (google.api.resource_reference) = {
  3010. type: "dlp.googleapis.com/JobTrigger"
  3011. }
  3012. ];
  3013. }
  3014. // Controls what and how to inspect for findings.
  3015. message InspectJobConfig {
  3016. // The data to scan.
  3017. StorageConfig storage_config = 1;
  3018. // How and what to scan for.
  3019. InspectConfig inspect_config = 2;
  3020. // If provided, will be used as the default for all values in InspectConfig.
  3021. // `inspect_config` will be merged into the values persisted as part of the
  3022. // template.
  3023. string inspect_template_name = 3;
  3024. // Actions to execute at the completion of the job.
  3025. repeated Action actions = 4;
  3026. }
  3027. // Combines all of the information about a DLP job.
  3028. message DlpJob {
  3029. option (google.api.resource) = {
  3030. type: "dlp.googleapis.com/DlpJob"
  3031. pattern: "projects/{project}/dlpJobs/{dlp_job}"
  3032. pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}"
  3033. };
  3034. // Possible states of a job. New items may be added.
  3035. enum JobState {
  3036. // Unused.
  3037. JOB_STATE_UNSPECIFIED = 0;
  3038. // The job has not yet started.
  3039. PENDING = 1;
  3040. // The job is currently running. Once a job has finished it will transition
  3041. // to FAILED or DONE.
  3042. RUNNING = 2;
  3043. // The job is no longer running.
  3044. DONE = 3;
  3045. // The job was canceled before it could complete.
  3046. CANCELED = 4;
  3047. // The job had an error and did not complete.
  3048. FAILED = 5;
  3049. // The job is currently accepting findings via hybridInspect.
  3050. // A hybrid job in ACTIVE state may continue to have findings added to it
  3051. // through calling of hybridInspect. After the job has finished no more
  3052. // calls to hybridInspect may be made. ACTIVE jobs can transition to DONE.
  3053. ACTIVE = 6;
  3054. }
  3055. // The server-assigned name.
  3056. string name = 1;
  3057. // The type of job.
  3058. DlpJobType type = 2;
  3059. // State of a job.
  3060. JobState state = 3;
  3061. oneof details {
  3062. // Results from analyzing risk of a data source.
  3063. AnalyzeDataSourceRiskDetails risk_details = 4;
  3064. // Results from inspecting a data source.
  3065. InspectDataSourceDetails inspect_details = 5;
  3066. }
  3067. // Time when the job was created.
  3068. google.protobuf.Timestamp create_time = 6;
  3069. // Time when the job started.
  3070. google.protobuf.Timestamp start_time = 7;
  3071. // Time when the job finished.
  3072. google.protobuf.Timestamp end_time = 8;
  3073. // If created by a job trigger, the resource name of the trigger that
  3074. // instantiated the job.
  3075. string job_trigger_name = 10;
  3076. // A stream of errors encountered running the job.
  3077. repeated Error errors = 11;
  3078. }
  3079. // The request message for [DlpJobs.GetDlpJob][].
  3080. message GetDlpJobRequest {
  3081. // Required. The name of the DlpJob resource.
  3082. string name = 1 [
  3083. (google.api.field_behavior) = REQUIRED,
  3084. (google.api.resource_reference) = {
  3085. type: "dlp.googleapis.com/DlpJob"
  3086. }
  3087. ];
  3088. }
  3089. // The request message for listing DLP jobs.
  3090. message ListDlpJobsRequest {
  3091. // Required. Parent resource name.
  3092. //
  3093. // The format of this value varies depending on whether you have [specified a
  3094. // processing
  3095. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3096. //
  3097. // + Projects scope, location specified:<br/>
  3098. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3099. // + Projects scope, no location specified (defaults to global):<br/>
  3100. // `projects/`<var>PROJECT_ID</var>
  3101. //
  3102. // The following example `parent` string specifies a parent project with the
  3103. // identifier `example-project`, and specifies the `europe-west3` location
  3104. // for processing data:
  3105. //
  3106. // parent=projects/example-project/locations/europe-west3
  3107. string parent = 4 [
  3108. (google.api.field_behavior) = REQUIRED,
  3109. (google.api.resource_reference) = {
  3110. child_type: "dlp.googleapis.com/DlpJob"
  3111. }
  3112. ];
  3113. // Allows filtering.
  3114. //
  3115. // Supported syntax:
  3116. //
  3117. // * Filter expressions are made up of one or more restrictions.
  3118. // * Restrictions can be combined by `AND` or `OR` logical operators. A
  3119. // sequence of restrictions implicitly uses `AND`.
  3120. // * A restriction has the form of `{field} {operator} {value}`.
  3121. // * Supported fields/values for inspect jobs:
  3122. // - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED
  3123. // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  3124. // - `trigger_name` - The resource name of the trigger that created job.
  3125. // - 'end_time` - Corresponds to time the job finished.
  3126. // - 'start_time` - Corresponds to time the job finished.
  3127. // * Supported fields for risk analysis jobs:
  3128. // - `state` - RUNNING|CANCELED|FINISHED|FAILED
  3129. // - 'end_time` - Corresponds to time the job finished.
  3130. // - 'start_time` - Corresponds to time the job finished.
  3131. // * The operator must be `=` or `!=`.
  3132. //
  3133. // Examples:
  3134. //
  3135. // * inspected_storage = cloud_storage AND state = done
  3136. // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  3137. // * inspected_storage = cloud_storage AND (state = done OR state = canceled)
  3138. // * end_time > \"2017-12-12T00:00:00+00:00\"
  3139. //
  3140. // The length of this field should be no more than 500 characters.
  3141. string filter = 1;
  3142. // The standard list page size.
  3143. int32 page_size = 2;
  3144. // The standard list page token.
  3145. string page_token = 3;
  3146. // The type of job. Defaults to `DlpJobType.INSPECT`
  3147. DlpJobType type = 5;
  3148. // Comma separated list of fields to order by,
  3149. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3150. // default sorting order is ascending, redundant space characters are
  3151. // insignificant.
  3152. //
  3153. // Example: `name asc, end_time asc, create_time desc`
  3154. //
  3155. // Supported fields are:
  3156. //
  3157. // - `create_time`: corresponds to time the job was created.
  3158. // - `end_time`: corresponds to time the job ended.
  3159. // - `name`: corresponds to job's name.
  3160. // - `state`: corresponds to `state`
  3161. string order_by = 6;
  3162. // Deprecated. This field has no effect.
  3163. string location_id = 7;
  3164. }
  3165. // The response message for listing DLP jobs.
  3166. message ListDlpJobsResponse {
  3167. // A list of DlpJobs that matches the specified filter in the request.
  3168. repeated DlpJob jobs = 1;
  3169. // The standard List next-page token.
  3170. string next_page_token = 2;
  3171. }
  3172. // The request message for canceling a DLP job.
  3173. message CancelDlpJobRequest {
  3174. // Required. The name of the DlpJob resource to be cancelled.
  3175. string name = 1 [
  3176. (google.api.field_behavior) = REQUIRED,
  3177. (google.api.resource_reference) = {
  3178. type: "dlp.googleapis.com/DlpJob"
  3179. }
  3180. ];
  3181. }
  3182. // The request message for finishing a DLP hybrid job.
  3183. message FinishDlpJobRequest {
  3184. // Required. The name of the DlpJob resource to be cancelled.
  3185. string name = 1 [
  3186. (google.api.field_behavior) = REQUIRED,
  3187. (google.api.resource_reference) = {
  3188. type: "dlp.googleapis.com/DlpJob"
  3189. }
  3190. ];
  3191. }
  3192. // The request message for deleting a DLP job.
  3193. message DeleteDlpJobRequest {
  3194. // Required. The name of the DlpJob resource to be deleted.
  3195. string name = 1 [
  3196. (google.api.field_behavior) = REQUIRED,
  3197. (google.api.resource_reference) = {
  3198. type: "dlp.googleapis.com/DlpJob"
  3199. }
  3200. ];
  3201. }
  3202. // Request message for CreateDeidentifyTemplate.
  3203. message CreateDeidentifyTemplateRequest {
  3204. // Required. Parent resource name.
  3205. //
  3206. // The format of this value varies depending on the scope of the request
  3207. // (project or organization) and whether you have [specified a processing
  3208. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3209. //
  3210. // + Projects scope, location specified:<br/>
  3211. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3212. // + Projects scope, no location specified (defaults to global):<br/>
  3213. // `projects/`<var>PROJECT_ID</var>
  3214. // + Organizations scope, location specified:<br/>
  3215. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3216. // + Organizations scope, no location specified (defaults to global):<br/>
  3217. // `organizations/`<var>ORG_ID</var>
  3218. //
  3219. // The following example `parent` string specifies a parent project with the
  3220. // identifier `example-project`, and specifies the `europe-west3` location
  3221. // for processing data:
  3222. //
  3223. // parent=projects/example-project/locations/europe-west3
  3224. string parent = 1 [
  3225. (google.api.field_behavior) = REQUIRED,
  3226. (google.api.resource_reference) = {
  3227. child_type: "dlp.googleapis.com/DeidentifyTemplate"
  3228. }
  3229. ];
  3230. // Required. The DeidentifyTemplate to create.
  3231. DeidentifyTemplate deidentify_template = 2 [(google.api.field_behavior) = REQUIRED];
  3232. // The template id can contain uppercase and lowercase letters,
  3233. // numbers, and hyphens; that is, it must match the regular
  3234. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3235. // characters. Can be empty to allow the system to generate one.
  3236. string template_id = 3;
  3237. // Deprecated. This field has no effect.
  3238. string location_id = 4;
  3239. }
  3240. // Request message for UpdateDeidentifyTemplate.
  3241. message UpdateDeidentifyTemplateRequest {
  3242. // Required. Resource name of organization and deidentify template to be updated, for
  3243. // example `organizations/433245324/deidentifyTemplates/432452342` or
  3244. // projects/project-id/deidentifyTemplates/432452342.
  3245. string name = 1 [
  3246. (google.api.field_behavior) = REQUIRED,
  3247. (google.api.resource_reference) = {
  3248. type: "dlp.googleapis.com/DeidentifyTemplate"
  3249. }
  3250. ];
  3251. // New DeidentifyTemplate value.
  3252. DeidentifyTemplate deidentify_template = 2;
  3253. // Mask to control which fields get updated.
  3254. google.protobuf.FieldMask update_mask = 3;
  3255. }
  3256. // Request message for GetDeidentifyTemplate.
  3257. message GetDeidentifyTemplateRequest {
  3258. // Required. Resource name of the organization and deidentify template to be read, for
  3259. // example `organizations/433245324/deidentifyTemplates/432452342` or
  3260. // projects/project-id/deidentifyTemplates/432452342.
  3261. string name = 1 [
  3262. (google.api.field_behavior) = REQUIRED,
  3263. (google.api.resource_reference) = {
  3264. type: "dlp.googleapis.com/DeidentifyTemplate"
  3265. }
  3266. ];
  3267. }
  3268. // Request message for ListDeidentifyTemplates.
  3269. message ListDeidentifyTemplatesRequest {
  3270. // Required. Parent resource name.
  3271. //
  3272. // The format of this value varies depending on the scope of the request
  3273. // (project or organization) and whether you have [specified a processing
  3274. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3275. //
  3276. // + Projects scope, location specified:<br/>
  3277. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3278. // + Projects scope, no location specified (defaults to global):<br/>
  3279. // `projects/`<var>PROJECT_ID</var>
  3280. // + Organizations scope, location specified:<br/>
  3281. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3282. // + Organizations scope, no location specified (defaults to global):<br/>
  3283. // `organizations/`<var>ORG_ID</var>
  3284. //
  3285. // The following example `parent` string specifies a parent project with the
  3286. // identifier `example-project`, and specifies the `europe-west3` location
  3287. // for processing data:
  3288. //
  3289. // parent=projects/example-project/locations/europe-west3
  3290. string parent = 1 [
  3291. (google.api.field_behavior) = REQUIRED,
  3292. (google.api.resource_reference) = {
  3293. child_type: "dlp.googleapis.com/DeidentifyTemplate"
  3294. }
  3295. ];
  3296. // Page token to continue retrieval. Comes from previous call
  3297. // to `ListDeidentifyTemplates`.
  3298. string page_token = 2;
  3299. // Size of the page, can be limited by server. If zero server returns
  3300. // a page of max size 100.
  3301. int32 page_size = 3;
  3302. // Comma separated list of fields to order by,
  3303. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3304. // default sorting order is ascending, redundant space characters are
  3305. // insignificant.
  3306. //
  3307. // Example: `name asc,update_time, create_time desc`
  3308. //
  3309. // Supported fields are:
  3310. //
  3311. // - `create_time`: corresponds to time the template was created.
  3312. // - `update_time`: corresponds to time the template was last updated.
  3313. // - `name`: corresponds to template's name.
  3314. // - `display_name`: corresponds to template's display name.
  3315. string order_by = 4;
  3316. // Deprecated. This field has no effect.
  3317. string location_id = 5;
  3318. }
  3319. // Response message for ListDeidentifyTemplates.
  3320. message ListDeidentifyTemplatesResponse {
  3321. // List of deidentify templates, up to page_size in
  3322. // ListDeidentifyTemplatesRequest.
  3323. repeated DeidentifyTemplate deidentify_templates = 1;
  3324. // If the next page is available then the next page token to be used
  3325. // in following ListDeidentifyTemplates request.
  3326. string next_page_token = 2;
  3327. }
  3328. // Request message for DeleteDeidentifyTemplate.
  3329. message DeleteDeidentifyTemplateRequest {
  3330. // Required. Resource name of the organization and deidentify template to be deleted,
  3331. // for example `organizations/433245324/deidentifyTemplates/432452342` or
  3332. // projects/project-id/deidentifyTemplates/432452342.
  3333. string name = 1 [
  3334. (google.api.field_behavior) = REQUIRED,
  3335. (google.api.resource_reference) = {
  3336. type: "dlp.googleapis.com/DeidentifyTemplate"
  3337. }
  3338. ];
  3339. }
  3340. // Configuration for a custom dictionary created from a data source of any size
  3341. // up to the maximum size defined in the
  3342. // [limits](https://cloud.google.com/dlp/limits) page. The artifacts of
  3343. // dictionary creation are stored in the specified Google Cloud Storage
  3344. // location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries
  3345. // that satisfy the size requirements.
  3346. message LargeCustomDictionaryConfig {
  3347. // Location to store dictionary artifacts in Google Cloud Storage. These files
  3348. // will only be accessible by project owners and the DLP API. If any of these
  3349. // artifacts are modified, the dictionary is considered invalid and can no
  3350. // longer be used.
  3351. CloudStoragePath output_path = 1;
  3352. oneof source {
  3353. // Set of files containing newline-delimited lists of dictionary phrases.
  3354. CloudStorageFileSet cloud_storage_file_set = 2;
  3355. // Field in a BigQuery table where each cell represents a dictionary phrase.
  3356. BigQueryField big_query_field = 3;
  3357. }
  3358. }
  3359. // Summary statistics of a custom dictionary.
  3360. message LargeCustomDictionaryStats {
  3361. // Approximate number of distinct phrases in the dictionary.
  3362. int64 approx_num_phrases = 1;
  3363. }
  3364. // Configuration for stored infoTypes. All fields and subfield are provided
  3365. // by the user. For more information, see
  3366. // https://cloud.google.com/dlp/docs/creating-custom-infotypes.
  3367. message StoredInfoTypeConfig {
  3368. // Display name of the StoredInfoType (max 256 characters).
  3369. string display_name = 1;
  3370. // Description of the StoredInfoType (max 256 characters).
  3371. string description = 2;
  3372. // Stored infotype types.
  3373. oneof type {
  3374. // StoredInfoType where findings are defined by a dictionary of phrases.
  3375. LargeCustomDictionaryConfig large_custom_dictionary = 3;
  3376. // Store dictionary-based CustomInfoType.
  3377. CustomInfoType.Dictionary dictionary = 4;
  3378. // Store regular expression-based StoredInfoType.
  3379. CustomInfoType.Regex regex = 5;
  3380. }
  3381. }
  3382. // Statistics for a StoredInfoType.
  3383. message StoredInfoTypeStats {
  3384. // Stat types
  3385. oneof type {
  3386. // StoredInfoType where findings are defined by a dictionary of phrases.
  3387. LargeCustomDictionaryStats large_custom_dictionary = 1;
  3388. }
  3389. }
  3390. // Version of a StoredInfoType, including the configuration used to build it,
  3391. // create timestamp, and current state.
  3392. message StoredInfoTypeVersion {
  3393. // StoredInfoType configuration.
  3394. StoredInfoTypeConfig config = 1;
  3395. // Create timestamp of the version. Read-only, determined by the system
  3396. // when the version is created.
  3397. google.protobuf.Timestamp create_time = 2;
  3398. // Stored info type version state. Read-only, updated by the system
  3399. // during dictionary creation.
  3400. StoredInfoTypeState state = 3;
  3401. // Errors that occurred when creating this storedInfoType version, or
  3402. // anomalies detected in the storedInfoType data that render it unusable. Only
  3403. // the five most recent errors will be displayed, with the most recent error
  3404. // appearing first.
  3405. //
  3406. // For example, some of the data for stored custom dictionaries is put in
  3407. // the user's Google Cloud Storage bucket, and if this data is modified or
  3408. // deleted by the user or another system, the dictionary becomes invalid.
  3409. //
  3410. // If any errors occur, fix the problem indicated by the error message and
  3411. // use the UpdateStoredInfoType API method to create another version of the
  3412. // storedInfoType to continue using it, reusing the same `config` if it was
  3413. // not the source of the error.
  3414. repeated Error errors = 4;
  3415. // Statistics about this storedInfoType version.
  3416. StoredInfoTypeStats stats = 5;
  3417. }
  3418. // StoredInfoType resource message that contains information about the current
  3419. // version and any pending updates.
  3420. message StoredInfoType {
  3421. option (google.api.resource) = {
  3422. type: "dlp.googleapis.com/StoredInfoType"
  3423. pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}"
  3424. pattern: "projects/{project}/storedInfoTypes/{stored_info_type}"
  3425. pattern: "organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}"
  3426. pattern: "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}"
  3427. };
  3428. // Resource name.
  3429. string name = 1;
  3430. // Current version of the stored info type.
  3431. StoredInfoTypeVersion current_version = 2;
  3432. // Pending versions of the stored info type. Empty if no versions are
  3433. // pending.
  3434. repeated StoredInfoTypeVersion pending_versions = 3;
  3435. }
  3436. // Request message for CreateStoredInfoType.
  3437. message CreateStoredInfoTypeRequest {
  3438. // Required. Parent resource name.
  3439. //
  3440. // The format of this value varies depending on the scope of the request
  3441. // (project or organization) and whether you have [specified a processing
  3442. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3443. //
  3444. // + Projects scope, location specified:<br/>
  3445. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3446. // + Projects scope, no location specified (defaults to global):<br/>
  3447. // `projects/`<var>PROJECT_ID</var>
  3448. // + Organizations scope, location specified:<br/>
  3449. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3450. // + Organizations scope, no location specified (defaults to global):<br/>
  3451. // `organizations/`<var>ORG_ID</var>
  3452. //
  3453. // The following example `parent` string specifies a parent project with the
  3454. // identifier `example-project`, and specifies the `europe-west3` location
  3455. // for processing data:
  3456. //
  3457. // parent=projects/example-project/locations/europe-west3
  3458. string parent = 1 [
  3459. (google.api.field_behavior) = REQUIRED,
  3460. (google.api.resource_reference) = {
  3461. child_type: "dlp.googleapis.com/StoredInfoType"
  3462. }
  3463. ];
  3464. // Required. Configuration of the storedInfoType to create.
  3465. StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED];
  3466. // The storedInfoType ID can contain uppercase and lowercase letters,
  3467. // numbers, and hyphens; that is, it must match the regular
  3468. // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3469. // characters. Can be empty to allow the system to generate one.
  3470. string stored_info_type_id = 3;
  3471. // Deprecated. This field has no effect.
  3472. string location_id = 4;
  3473. }
  3474. // Request message for UpdateStoredInfoType.
  3475. message UpdateStoredInfoTypeRequest {
  3476. // Required. Resource name of organization and storedInfoType to be updated, for
  3477. // example `organizations/433245324/storedInfoTypes/432452342` or
  3478. // projects/project-id/storedInfoTypes/432452342.
  3479. string name = 1 [
  3480. (google.api.field_behavior) = REQUIRED,
  3481. (google.api.resource_reference) = {
  3482. type: "dlp.googleapis.com/StoredInfoType"
  3483. }
  3484. ];
  3485. // Updated configuration for the storedInfoType. If not provided, a new
  3486. // version of the storedInfoType will be created with the existing
  3487. // configuration.
  3488. StoredInfoTypeConfig config = 2;
  3489. // Mask to control which fields get updated.
  3490. google.protobuf.FieldMask update_mask = 3;
  3491. }
  3492. // Request message for GetStoredInfoType.
  3493. message GetStoredInfoTypeRequest {
  3494. // Required. Resource name of the organization and storedInfoType to be read, for
  3495. // example `organizations/433245324/storedInfoTypes/432452342` or
  3496. // projects/project-id/storedInfoTypes/432452342.
  3497. string name = 1 [
  3498. (google.api.field_behavior) = REQUIRED,
  3499. (google.api.resource_reference) = {
  3500. type: "dlp.googleapis.com/StoredInfoType"
  3501. }
  3502. ];
  3503. }
  3504. // Request message for ListStoredInfoTypes.
  3505. message ListStoredInfoTypesRequest {
  3506. // Required. Parent resource name.
  3507. //
  3508. // The format of this value varies depending on the scope of the request
  3509. // (project or organization) and whether you have [specified a processing
  3510. // location](https://cloud.google.com/dlp/docs/specifying-location):
  3511. //
  3512. // + Projects scope, location specified:<br/>
  3513. // `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3514. // + Projects scope, no location specified (defaults to global):<br/>
  3515. // `projects/`<var>PROJECT_ID</var>
  3516. // + Organizations scope, location specified:<br/>
  3517. // `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3518. // + Organizations scope, no location specified (defaults to global):<br/>
  3519. // `organizations/`<var>ORG_ID</var>
  3520. //
  3521. // The following example `parent` string specifies a parent project with the
  3522. // identifier `example-project`, and specifies the `europe-west3` location
  3523. // for processing data:
  3524. //
  3525. // parent=projects/example-project/locations/europe-west3
  3526. string parent = 1 [
  3527. (google.api.field_behavior) = REQUIRED,
  3528. (google.api.resource_reference) = {
  3529. child_type: "dlp.googleapis.com/StoredInfoType"
  3530. }
  3531. ];
  3532. // Page token to continue retrieval. Comes from previous call
  3533. // to `ListStoredInfoTypes`.
  3534. string page_token = 2;
  3535. // Size of the page, can be limited by server. If zero server returns
  3536. // a page of max size 100.
  3537. int32 page_size = 3;
  3538. // Comma separated list of fields to order by,
  3539. // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3540. // default sorting order is ascending, redundant space characters are
  3541. // insignificant.
  3542. //
  3543. // Example: `name asc, display_name, create_time desc`
  3544. //
  3545. // Supported fields are:
  3546. //
  3547. // - `create_time`: corresponds to time the most recent version of the
  3548. // resource was created.
  3549. // - `state`: corresponds to the state of the resource.
  3550. // - `name`: corresponds to resource name.
  3551. // - `display_name`: corresponds to info type's display name.
  3552. string order_by = 4;
  3553. // Deprecated. This field has no effect.
  3554. string location_id = 5;
  3555. }
  3556. // Response message for ListStoredInfoTypes.
  3557. message ListStoredInfoTypesResponse {
  3558. // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
  3559. repeated StoredInfoType stored_info_types = 1;
  3560. // If the next page is available then the next page token to be used
  3561. // in following ListStoredInfoTypes request.
  3562. string next_page_token = 2;
  3563. }
  3564. // Request message for DeleteStoredInfoType.
  3565. message DeleteStoredInfoTypeRequest {
  3566. // Required. Resource name of the organization and storedInfoType to be deleted, for
  3567. // example `organizations/433245324/storedInfoTypes/432452342` or
  3568. // projects/project-id/storedInfoTypes/432452342.
  3569. string name = 1 [
  3570. (google.api.field_behavior) = REQUIRED,
  3571. (google.api.resource_reference) = {
  3572. type: "dlp.googleapis.com/StoredInfoType"
  3573. }
  3574. ];
  3575. }
  3576. // Request to search for potentially sensitive info in a custom location.
  3577. message HybridInspectJobTriggerRequest {
  3578. // Required. Resource name of the trigger to execute a hybrid inspect on, for example
  3579. // `projects/dlp-test-project/jobTriggers/53234423`.
  3580. string name = 1 [
  3581. (google.api.field_behavior) = REQUIRED,
  3582. (google.api.resource_reference) = {
  3583. type: "dlp.googleapis.com/JobTrigger"
  3584. }
  3585. ];
  3586. // The item to inspect.
  3587. HybridContentItem hybrid_item = 3;
  3588. }
  3589. // Request to search for potentially sensitive info in a custom location.
  3590. message HybridInspectDlpJobRequest {
  3591. // Required. Resource name of the job to execute a hybrid inspect on, for example
  3592. // `projects/dlp-test-project/dlpJob/53234423`.
  3593. string name = 1 [
  3594. (google.api.field_behavior) = REQUIRED,
  3595. (google.api.resource_reference) = {
  3596. type: "dlp.googleapis.com/DlpJob"
  3597. }
  3598. ];
  3599. // The item to inspect.
  3600. HybridContentItem hybrid_item = 3;
  3601. }
  3602. // An individual hybrid item to inspect. Will be stored temporarily during
  3603. // processing.
  3604. message HybridContentItem {
  3605. // The item to inspect.
  3606. ContentItem item = 1;
  3607. // Supplementary information that will be added to each finding.
  3608. HybridFindingDetails finding_details = 2;
  3609. }
  3610. // Populate to associate additional data with each finding.
  3611. message HybridFindingDetails {
  3612. // Details about the container where the content being inspected is from.
  3613. Container container_details = 1;
  3614. // Offset in bytes of the line, from the beginning of the file, where the
  3615. // finding is located. Populate if the item being scanned is only part of a
  3616. // bigger item, such as a shard of a file and you want to track the absolute
  3617. // position of the finding.
  3618. int64 file_offset = 2;
  3619. // Offset of the row for tables. Populate if the row(s) being scanned are
  3620. // part of a bigger dataset and you want to keep track of their absolute
  3621. // position.
  3622. int64 row_offset = 3;
  3623. // If the container is a table, additional information to make findings
  3624. // meaningful such as the columns that are primary keys. If not known ahead
  3625. // of time, can also be set within each inspect hybrid call and the two
  3626. // will be merged. Note that identifying_fields will only be stored to
  3627. // BigQuery, and only if the BigQuery action has been included.
  3628. TableOptions table_options = 4;
  3629. // Labels to represent user provided metadata about the data being inspected.
  3630. // If configured by the job, some key values may be required.
  3631. // The labels associated with `Finding`'s produced by hybrid
  3632. // inspection.
  3633. //
  3634. // Label keys must be between 1 and 63 characters long and must conform
  3635. // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
  3636. //
  3637. // Label values must be between 0 and 63 characters long and must conform
  3638. // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
  3639. //
  3640. // No more than 10 labels can be associated with a given finding.
  3641. //
  3642. // Examples:
  3643. // * `"environment" : "production"`
  3644. // * `"pipeline" : "etl"`
  3645. map<string, string> labels = 5;
  3646. }
  3647. // Quota exceeded errors will be thrown once quota has been met.
  3648. message HybridInspectResponse {
  3649. }
  3650. // Operators available for comparing the value of fields.
  3651. enum RelationalOperator {
  3652. // Unused
  3653. RELATIONAL_OPERATOR_UNSPECIFIED = 0;
  3654. // Equal. Attempts to match even with incompatible types.
  3655. EQUAL_TO = 1;
  3656. // Not equal to. Attempts to match even with incompatible types.
  3657. NOT_EQUAL_TO = 2;
  3658. // Greater than.
  3659. GREATER_THAN = 3;
  3660. // Less than.
  3661. LESS_THAN = 4;
  3662. // Greater than or equals.
  3663. GREATER_THAN_OR_EQUALS = 5;
  3664. // Less than or equals.
  3665. LESS_THAN_OR_EQUALS = 6;
  3666. // Exists
  3667. EXISTS = 7;
  3668. }
  3669. // Type of the match which can be applied to different ways of matching, like
  3670. // Dictionary, regular expression and intersecting with findings of another
  3671. // info type.
  3672. enum MatchingType {
  3673. // Invalid.
  3674. MATCHING_TYPE_UNSPECIFIED = 0;
  3675. // Full match.
  3676. //
  3677. // - Dictionary: join of Dictionary results matched complete finding quote
  3678. // - Regex: all regex matches fill a finding quote start to end
  3679. // - Exclude info type: completely inside affecting info types findings
  3680. MATCHING_TYPE_FULL_MATCH = 1;
  3681. // Partial match.
  3682. //
  3683. // - Dictionary: at least one of the tokens in the finding matches
  3684. // - Regex: substring of the finding matches
  3685. // - Exclude info type: intersects with affecting info types findings
  3686. MATCHING_TYPE_PARTIAL_MATCH = 2;
  3687. // Inverse match.
  3688. //
  3689. // - Dictionary: no tokens in the finding match the dictionary
  3690. // - Regex: finding doesn't match the regex
  3691. // - Exclude info type: no intersection with affecting info types findings
  3692. MATCHING_TYPE_INVERSE_MATCH = 3;
  3693. }
  3694. // Options describing which parts of the provided content should be scanned.
  3695. enum ContentOption {
  3696. // Includes entire content of a file or a data stream.
  3697. CONTENT_UNSPECIFIED = 0;
  3698. // Text content within the data, excluding any metadata.
  3699. CONTENT_TEXT = 1;
  3700. // Images found in the data.
  3701. CONTENT_IMAGE = 2;
  3702. }
  3703. // Type of metadata containing the finding.
  3704. enum MetadataType {
  3705. // Unused
  3706. METADATATYPE_UNSPECIFIED = 0;
  3707. // General file metadata provided by Cloud Storage.
  3708. STORAGE_METADATA = 2;
  3709. }
  3710. // Parts of the APIs which use certain infoTypes.
  3711. enum InfoTypeSupportedBy {
  3712. // Unused.
  3713. ENUM_TYPE_UNSPECIFIED = 0;
  3714. // Supported by the inspect operations.
  3715. INSPECT = 1;
  3716. // Supported by the risk analysis operations.
  3717. RISK_ANALYSIS = 2;
  3718. }
  3719. // An enum to represent the various types of DLP jobs.
  3720. enum DlpJobType {
  3721. // Unused
  3722. DLP_JOB_TYPE_UNSPECIFIED = 0;
  3723. // The job inspected Google Cloud for sensitive data.
  3724. INSPECT_JOB = 1;
  3725. // The job executed a Risk Analysis computation.
  3726. RISK_ANALYSIS_JOB = 2;
  3727. }
  3728. // State of a StoredInfoType version.
  3729. enum StoredInfoTypeState {
  3730. // Unused
  3731. STORED_INFO_TYPE_STATE_UNSPECIFIED = 0;
  3732. // StoredInfoType version is being created.
  3733. PENDING = 1;
  3734. // StoredInfoType version is ready for use.
  3735. READY = 2;
  3736. // StoredInfoType creation failed. All relevant error messages are returned in
  3737. // the `StoredInfoTypeVersion` message.
  3738. FAILED = 3;
  3739. // StoredInfoType is no longer valid because artifacts stored in
  3740. // user-controlled storage were modified. To fix an invalid StoredInfoType,
  3741. // use the `UpdateStoredInfoType` method to create a new version.
  3742. INVALID = 4;
  3743. }