I am working on developing PII de identification application using data leak prevention(GCP). I am using de identification template for the de-identification rules.
Issue: I am not able to figure out about using custom info types in the deidentification template.
Here is a sample deidentification template:
{
"deidentifyTemplate":{
"displayName":"Email and id masker",
"description":"De-identifies emails and ids with a series of asterisks.",
"deidentifyConfig":{
"infoTypeTransformations":{
"transformations":[
{
"infoTypes":[
{
"name":"EMAIL_ADDRESS"
}
],
"primitiveTransformation":{
"characterMaskConfig":{
"maskingCharacter":"*"
}
}
}
]
}
}
}
}
In the above example, it a bultin info type(email) and in documentation custom info type snippet is like below:
"inspect_config":{
"custom_info_types":[
{
"info_type":{
"name":"CUSTOM_ID"
},
"regex":{
"pattern":"[1-9]{2}-[1-9]{4}"
},
"likelihood":"POSSIBLE"
}
]
}
There is not a valid object definition for inspect_config in rest documentation of deidentification template, its only valid in inspection template.
Is it possible to use custom info types in de identification template(infoTypeTransformations)?
Here is the link for rest documentation.
Yes it is possible to use custom info types. What will need to be done is that you create a De-Identify Template and also an Inspect Template.
Then when you call the API, you send both of the template in as parameters. With python using the dlp client library, here is some sample pseudocode