Configure a Snowflake Integration

Warehouse sizing recommendations

Before configuring the integration, review the Warehouse sizing recommendations guide to ensure that you use Snowflake compute resources cost effectively.

Permissions

The permissions outlined in this section are the Snowflake privileges required for a basic configuration. See the Snowflake reference guide for a list of privileges necessary for additional features and settings.

  • APPLICATION_ADMIN Immuta permission

  • The Snowflake user must have the following privileges:

    • CREATE DATABASE ON ACCOUNT WITH GRANT OPTION

    • CREATE ROLE ON ACCOUNT WITH GRANT OPTION

    • CREATE USER ON ACCOUNT WITH GRANT OPTION

    • MANAGE GRANTS ON ACCOUNT WITH GRANT OPTION

    • APPLY MASKING POLICY ON ACCOUNT WITH GRANT OPTION

    • APPLY ROW ACCESS POLICY ON ACCOUNT WITH GRANT OPTION

  • The Snowflake user registering data sources must have the following privileges on all securables:

    • USAGE on all databases and schemas with registered data sources

    • REFERENCES on all tables and views registered in Immuta

Configure the integration

  1. Click the App Settings icon in the navigation menu.

  2. Click the Integrations tab.

  3. Click the +Add Integration button and select Snowflake from the dropdown menu.

  4. Complete the Host, Port, and Default Warehouse fields.

  5. Opt to check the Enable Project Workspace box. This will allow for managed write access within Snowflake. Note: Project workspaces still use Snowflake views, so the default role of the account used to create the data sources in the project must be added to the Excepted Roles List. This option is unavailable when table grants is enabled.

  6. Opt to check the Enable Impersonation box and customize the Impersonation Role to allow users to natively impersonate another user. You cannot edit this choice after you configure the integration.

  7. Snowflake query audit is enabled by default.

    1. Configure the audit frequency by scrolling to Integrations Settings and find the Snowflake Audit Sync Schedule section.

    2. Enter how often, in hours, you want Immuta to ingest audit events from Snowflake as an integer between 1 and 24.

    3. Continue with your integration configuration.

Select your configuration method

You have two options for configuring your Snowflake environment:

  • Automatic setup: Grant Immuta one-time use of credentials to automatically configure your Snowflake environment and the integration.

  • Manual setup: Run the Immuta script in your Snowflake environment yourself to configure your Snowflake environment and the integration.

Automatic setup

Required permissions: When performing an automatic setup, the credentials provided must have the permissions listed above.

The setup will use the provided credentials to create a user called IMMUTA_SYSTEM_ACCOUNT and grant the following privileges to that user:

  • APPLY MASKING POLICY ON ACCOUNT

  • APPLY ROW ACCESS POLICY ON ACCOUNT

  • Additional grants associated with the IMMUTA database

These credentials will be used to create and configure a new IMMUTA database within the specified Snowflake instance. The credentials are not stored or saved by Immuta, and Immuta doesn’t retain access to them after initial setup is complete.

You can create a new account for Immuta to use that has these privileges, or you can grant temporary use of a pre-existing account. By default, the pre-existing account with appropriate privileges is ACCOUNTADMIN. If you create a new account, it can be deleted after initial setup is complete.

From the Select Authentication Method Dropdown, select one of the following authentication methods:

  • Username and Password (Not recommended): Complete the Username, Password, and Role fields.

  • Key Pair Authentication:

    1. Complete the Username field. This user must be assigned the public key in Snowflake.

    2. When using an encrypted private key, enter the private key file password in the Additional Connection String Options. Use the following format: PRIV_KEY_FILE_PWD=<your_pw>

    3. Click Key Pair (Required), and upload a Snowflake private key pair file.

    4. Complete the Role field.

Manual setup

Required permissions: When performing a manual setup, the Snowflake user running the script must have the permissions listed above.

It will create a user called IMMUTA_SYSTEM_ACCOUNT, and grant the following privileges to that user:

  • APPLY MASKING POLICY ON ACCOUNT

  • APPLY ROW ACCESS POLICY ON ACCOUNT

  • Additional grants associated with the IMMUTA database

Run the script

  1. Select Manual.

  2. Use the Dropdown Menu to select your Authentication Method:

    • Username and password (Not recommended): Enter the Username and Password and set them in the bootstrap script for the Immuta system account credentials.

    • Key Pair Authentication: Upload the Key Pair file and when using an encrypted private key, enter the private key file password in the Additional Connection String Options. Use the following format: PRIV_KEY_FILE_PWD=<your_pw>

    • Snowflake External OAuth:

      1. Create a security integration for your Snowflake External OAuth. Note that if you have an existing security integration, then the Immuta system role must be added to the existing EXTERNAL_OAUTH_ALLOWED_ROLES_LIST. The Immuta system role will be the Immuta database provided above with _SYSTEM. If you used the default database name it will be IMMUTA_SYSTEM.

      2. Fill out the Token Endpoint. This is where the generated token is sent.

      3. Fill out the Client ID. This is the subject of the generated token.

      4. Select the method Immuta will use to obtain an access token:

        • Certificate

          1. Keep the Use Certificate checkbox enabled.

          2. Opt to fill out the Resource field with a URI of the resource where the requested token will be used.

          3. Enter the x509 Certificate Thumbprint. This identifies the corresponding key to the token and is often abbreviated as `x5t` or is called `sub` (Subject).

          4. Upload the PEM Certificate, which is the client certificate that is used to sign the authorization request.

        • Client secret

          1. Uncheck the Use Certificate checkbox.

          2. Enter the Scope (string). The scope limits the operations and roles allowed in Snowflake by the access token. See the OAuth 2.0 scopes documentation for details about scopes.

          3. Enter the Client Secret (string). Immuta uses this secret to authenticate with the authorization server when it requests a token.

  3. In the Setup section, click bootstrap script to download the script. Then, fill out the appropriate fields and run the bootstrap script in Snowflake.

Select available warehouses (optional)

If you enabled a Snowflake workspace, select Warehouses from the dropdown menu that will be available to project owners when creating Snowflake workspaces. Select from a list of all the warehouses available to the privileged account entered above. Note that any warehouse accessible by the PUBLIC role does not need to be explicitly added.

Select excepted roles and users

Enter the Excepted Roles/User List. Each role or username (both case-sensitive) in this list should be separated by a comma. Wildcards are unsupported.

Save the configuration

Click Save.

Opt to enable Snowflake tag ingestion

To allow Immuta to automatically import table and column tags from Snowflake, enable Snowflake tag ingestion in the external catalog section of the Immuta app settings page.

Requirements:

  • A configured Snowflake integration or connection

  • The must have the following privileges and should be able to access all securables registered as data sources:

    • IMPORTED PRIVILEGES ON DATABASE snowflake

    • APPLY TAG ON ACCOUNT

  1. Navigate to the App Settings page.

  2. Scroll to 2 External Catalogs, and click Add Catalog.

  3. Enter a Display Name and select Snowflake from the dropdown menu.

  4. Enter the Account.

  5. Enter the Authentication information: Username, Password, Port, Default Warehouse, and Role.

  6. Opt to enter the Proxy Host, Proxy Port, and Encrypted Key File Passphrase.

  7. Opt to Upload Certificates.

  8. Click the Test Connection button.

  9. Click the Test Data Source Link.

  10. Once both tests are successful, click Save.

Register data

Register Snowflake data in Immuta.

Last updated

Was this helpful?