Create a Sensitive Data Protection inspection template
This quickstart shows you how to create and use a Sensitive Data Protection inspectiontemplate in the Google Cloud console.Sensitive Data Protection inspection templateslet you create and persist configuration information in Sensitive Data Protection.
To complete this quickstart, you need to have data that you can scan inCloud Storage, BigQuery, or Firestore in Datastore mode (Datastore).
To follow step-by-step guidance for this task directly in the Google Cloud console, clickGuide me:
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- Create a project: To create a project, you need the Project Creator role (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- Create a project: To create a project, you need the Project Creator role (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission.Learn how to grant roles.
Verify that billing is enabled for your Google Cloud project.
Enable the Sensitive Data Protection API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission.Learn how to grant roles.
Create a template
In the following sections, you configure and create an inspection template.
Define template
In the Sensitive Data Protection section of the Google Cloud console, goto theCreate template page.
On theCreate template page, define the following options:
ForTemplate type, use the default settingInspect (find sensitivedata).
ForTemplate ID, enter
quickstart-template.ForDisplay name, enter
Quickstart template.ForDescription, leave the field empty.
ForResource location, use the default settingGlobal (anyregion).
ClickContinue.
Configure detection
You now configure the template to detect for an infoType such as credit card numbers.
In theConfigure detection section of theCreate template page, dothe following:
In theInfoTypes section, clickManage infoTypes, select theinfoTypes that you want to scan for, and then clickDone.
In theConfidence threshold section, selectPossiblefrom theLikelihood list.
The default valuePossible is sufficient for most purposes. Ifyou routinely get matches that are too broad when you use thistemplate, move the slider up. If you get too few matches, move theslider down.
To create the template, clickCreate.
The template's summary information page appears. To return to the mainSensitive Data Protection page, clickInspection template details.
Use the template
The following steps describe how to configure the template for use in a scan:
In the Google Cloud console, go to theCreate job or job trigger page.
Follow the prompts to create an inspection job or job trigger (a recurring job). When you are prompted to configure the detection, select the template that you created.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
Delete the project
The easiest way to eliminate billing is to delete the project that you created for the tutorial.
To delete the project:
Delete the template
There are no costs associated with creating and storing templates. However, ifyou want to delete a template, follow these steps:
In the Google Cloud console, go to theConfiguration tab of Sensitive Data Protection.
Select the project that contains the inspection template that you want to delete.
On theConfiguration tab, click theTemplates subtab. The Google Cloud console displays a list of all templates for the current project.
In theActions column for the template you want to delete, click the trigger actions menu, clickDelete, and then clickConfirm.
What's next
Learn more aboutcreating and scheduling Sensitive Data Protection inspectionjobs.
Learn more aboutcreating Sensitive Data Protection inspection templates.
Learn more about theinfoType detector reference.
Learn more about how Sensitive Data Protection matches your content using thelikelihood value.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.