- Enable the DLP API from GCP
- Install the DLP API
git clone https://github.com/googleapis/nodejs-dlp.git
- Install Nodejs and samples
cd nodejs-dlp/samples
npm install @google-cloud/dlp
npm install yargs
npm install mime
Using ìnspectString.js
explicit your data.
- E.g. your email address in assets
node inspectString.js $GCLOUD_PROJECT "My email address is dev@yahya-abulhaj.dev."
- E.g. your phone number(s) in assets
node inspectString.js $GCLOUD_PROJECT "My phone number is +99999999."
- Give input to the system e.g. upload the below asset
- from
nodejs-dlp/samples
redact the email address values from the image
node redactImage.js $GCLOUD_PROJECT ~/assets-for-real.png "" EMAIL_ADDRESS ~/yaya-redacted.png
We specified EMAIL_ADDRESS as the infotype to redact.
In the image, you should notice that the email address is no longer visible.