InfoTypes are types of sensitive data. Cloud Data Loss Prevention supports both built-in and custom infoTypes. You can view all built-in infoTypes in the infoTypes reference, or you can use the DLP API to list all built-in infoTypes programmatically.
The infoTypes.list
method lists all built-in infoTypes that are currently supported in
Cloud DLP. Each infoType includes the following information:
- The infoType identifier (ID), the internal name of the infoType.
- The infoType display name, a human readable infoType name.
- Whether the infoType is supported by inspection or risk analysis operations.
Code examples
To list all built-in infoType detectors:
Console
In the Google Cloud console, open Cloud DLP.
Click the Configuration tab, and then click InfoTypes.
A table containing all built-in infoType detectors appears.
Protocol
JSON input:
GET https://dlp.googleapis.com/v2/infoTypes?key={YOUR_API_KEY}
The preceding request, when sent to the indicated endpoint, returns a list of all predefined detectors in the following format, where:
[INFOTYPE-NAME]
represents the name of the infoType detector.[INFOTYPE-DISPLAY-NAME]
represents the display name for the detector"supportedBy"
is set to"INSPECT"
,"RISK_ANALYSIS"
, or both, depending on whether the detector is supported by inspection or risk analysis operations[INFOTYPE-DESCRIPTION]
represents the detector's description.
JSON output:
{
"infoTypes":[
{
"name":"[INFOTYPE-NAME]",
"displayName":"[INFOTYPE-DISPLAY-NAME]",
"supportedBy":[
"INSPECT"
],
"description":"[INFOTYPE-DESCRIPTION]"
},
...
]
}
Java
To learn how to install and use the client library for Cloud DLP, see Cloud DLP client libraries.
To authenticate to Cloud DLP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Cloud DLP, see Cloud DLP client libraries.
To authenticate to Cloud DLP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To learn how to install and use the client library for Cloud DLP, see Cloud DLP client libraries.
To authenticate to Cloud DLP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for Cloud DLP, see Cloud DLP client libraries.
To authenticate to Cloud DLP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
PHP
To learn how to install and use the client library for Cloud DLP, see Cloud DLP client libraries.
To authenticate to Cloud DLP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
C#
To learn how to install and use the client library for Cloud DLP, see Cloud DLP client libraries.
To authenticate to Cloud DLP, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
APIs Explorer
You can list infoType detectors using APIs Explorer:
Go to the APIs Explorer on the API reference page for
infoTypes.list
by clicking the following button:Uncheck Google OAuth 2.0.
Click Execute.
APIs Explorer sends a request to Cloud DLP, which sends back a JSON object containing all supported infoType detectors.