Snowflake Connector
Overview
Used for OneTrust Data Discovery, the Snowflake connector works to scan structured data storage in RDBMS databases and retrieve discovered data back to OneTrust for review and analysis.
Connection Details
- Pod Residency
-
rdbms-scanner - Connection Method
-
JDBC Driver connection. For more information, please referenceSnowflake's official documentation.
Note:The Snowflake account provided should not have a default namespace. If it does, the scan will be limited to the database specified in the default namespace.
Connection Overview
-
Generate a credential with an authentication method. See Authentication for more.
-
Data source setup from Gallery
-
Supply credentials to data source
Supported Scan Actions
|
Scan Type |
Description |
|---|---|
|
Catalog |
This scan type will only retrieve the metadata in the database like details of schema, table, or column. |
|
Catalog & Scan |
This scan type lets OneTrust scan both metadata and data under the tables and return the appropriate labels. |
Credentials
OneTrust recommends to adhere to your organization's security and infrastructure policy and include system engineer resources or other qualified subject matter experts to set up credentials on data sources. For specific instructions for how to enable these credentials, refer to your data source's implementation documentation, knowledge base and/or support resources.
For minimal setup and auto discovery of all databases, OneTrust recommends ACCOUNTADMIN role. Scans can still be completed with the PUBLIC role as long as the user has explicit access to the given databases, schema, and tables. In the case they don't show up in the scan results, additional permission changes will be required.
For more information on the required read permissions necessary for completing these functions, please see Snowflake's official access control privileges documentation.
Sample JSON with Basic Authentication
{
"connectionUrl": "jdbc:snowflake://1.1.1.1:443",
"user": "your_user",
"password": "your_password"
}
Sample JSON with PAT Authentication
{
"connectionUrl": "jdbc:snowflake://1.1.1.1:443",
"user": "your_user",
"authenticator": "programmatic_access_token",
"token": "your_pat_token"
}
For more information about the available authentication methods and their configuration parameters, see Snowflake's JDBC Parameter References documentation.
Sample JSON with Key-Value Pair Authentication
{
"connectionUrl": "jdbc:snowflake://1.1.1.1:443",
"jdbc:snowflake://<HOSTNAME>/?authenticator=snowflake_jwt&private_key_file=./extlib/<privateKeyFileName>",
"user":"<snowflake_Username>"
}
Authentication
You can authenticate OneTrust with Snowflake using a key-value pairing for improved security. The steps below are for if you need to create new keys. You can also use existing ones for this purpose.
Private Key
-
Open a session by logging into the VM and generate a private key.
-
To generate an unencrypted version, use the following command:
CODEopenssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocryptNote:Generation of an encrypted private key is under consideration with OneTrust.
-
The command will generate a private key in PEM format.
CODE-----BEGIN ENCRYPTED PRIVATE KEY----- MIIE6TAbBgkqhkiG9w0BBQMwDgQILYPyCppzOwECAggABIIEyLiGSpeeGSe3xHP1wHLjfCYycUPennlX2bd8yX8xOxGSGfvB+99+PmSlex0FmY9ov1J8H1H9Y3lMWXbL ... -----END ENCRYPTED PRIVATE KEY----- -
To sync the private key to the RDBMS container, navigate to the installer directory again:
CODE/home/azureuser/onetrust-dd-installer-xxxxx/data-discovery/onebox-deployment/ -
Run the following script to sync the private key:
CODE./deploy.sh sync-extlib
Public Key
-
From the command line, generate the public key by referencing the private key.
-
The following command assumes the private key is encrypted and contained in the file named rsa_key.p8.
CODEopenssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub -
The command generates the public key in PEM format.
CODE-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy+Fw2qv4Roud3l6tjPH4zxybHjmZ5rhtCz9jppCV8UTWvEXxa88IGRIHbJ/PwKW/mR8LXdfI7l/9vCMXX4mk ... -----END PUBLIC KEY----- -
To assign the public key to a Snowflake user, execute an ALTER USER command:
CODEalter user <snowflakeUSERNAME> set rsa_public_key=’MIIBIjANBgkqh...’; -
You can retrieve the contents of the key using the following command:
CODEvi rsa_key.pub -
To verify the user's public key fingerprint, execute a DESCRIBE USER command:
CODEdesc user <snowflakeUSERNAME>;
Store Keys on VM
-
Copy both the keys in a secure folder on the VM.
-
Also, copy the private key file in the extlib folder under the deployment folder.
-
Navigate to the extlib folder under the deployment package:
CODE/home/azureuser/onetrust-dd-installer-xxxxx/data-discovery/onebox-deployment/extlib/ -
Copy the private key file at this location using the below command:
CODEcp <original_path> -
Confirm the file is copied correctly in the extlib folder.
Sync Private Key to RDBMS Container
-
Ensure a single pod of scanner-extlib is running:
CODEkubectl -n <namespace> scale --replicas=1 sts scanner-extlib -
Navigate to the directory where the certificates are located. For example, if using the installer directory:
CODEcd /home/azureuser/onetrust-dd-installer-xxxxx/data-discovery/onebox-deployment/extlib/ -
Copy the certs/keys from the current directory into the pod:
CODEkubectl -n <namespace> cp . scanner-extlib-0:/home/ot-service/extlib/ -
Verify that the files were copied successfully:
CODEkubectl -n <namespace> exec -it scanner-extlib-0 -- ls -al /home/ot-service/extlib/
Assign Public Key to Snowflake User
-
Execute an ALTER USER command to assign the public key to a Snowflake user.
CODEalter user <snowflakeUSERNAME> set rsa_public_key=’MIIBIjANBgkqh...’; -
You can retrieve the contents of the key using the following command:
CODEvi rsa_key.pub -
Execute a DESCRIBE USER command to verify the user’s public key.
CODEdesc user <snowflakeUSERNAME>;
Scan Profile Support
For additional details on scan profile configuration and management, see Setting Up Scan Profiles.
Limits
-
Max Number of Databases
-
Max Number of Schemas per Database
-
Max Number of Tables per Schema
-
Limitation Method for Scanning Rows per Table (Catalog & Scan type only)
-
First with Limit
-
Random Percentage
-
Random Percentage with Limit
-
Scope
-
Intelligent Sampling Scan
Scan Options
-
Tables
-
Views
Column Exclusion
-
Free text field for column data type
Wildcard
Wildcards are not supported for column inclusion or exclusion.
-
Example:
*Name*will not work to include/exclude bothfirstNameandlastNamecolumns -
Instead, you must specify the exact column names separated by commas (e.g.
firstName,lastName).
Columns Excluded in the Data Dictionary
When a column is excluded, it is still cataloged by the Data Dictionary. This means:
-
Basic metadata for the column is retrieved.
-
During extraction, the actual column content is skipped based on the configuration.
Include/Exclude Path Configuration Fields
-
Database
-
Schema
-
Table
-
Column
Collected Objects & Fields
|
Objects |
Fields |
|---|---|
|
Databases |
|
|
Schemas |
|
|
Tables |
|
|
Columns |
|
|
Keys |
|
Denylist
This connector has databases and/or schemas that included in our denylist. For more information, see RDBMS Database and Schema Denylist.