Key Snowflake Concepts
Let’s review some essential Snowflake concepts:- Role: A collection of permissions that can be assigned to users.
- User: An account for accessing Snowflake. In this case, we’re creating a service account for programmatic access, not for logging into the Snowflake web UI.
- Warehouse: A cluster of compute resources for running queries.
- Database: A container for schemas and other objects.
- Schema: A container for tables and other database objects.
- Table: A structure that stores data in rows and columns.
Authentication Methods
Dust supports two authentication methods for Snowflake connections:- Username & Password (traditional method)
- Key Pair Authentication (recommended for enhanced security)
Choosing Your Authentication Method
- Password authentication: Simpler to set up, suitable for testing and development
- Key pair authentication: More secure, required by many organizations, recommended for production use
Step-by-Step Guide
Setup on Snowflake’s side
Note: For configuring access to Snowflake, you may need to whitelist the following Dust static IP: If you’re in the US (routes start with https://dust.tt) the IP is34.46.9.232. For the EU customers (routes start with https://eu.dust.tt) the IP is 35.195.191.222
We recommend creating a dedicated Warehouse, User and Role for Dust.Setup the warehouse, role and user for Dust
About permissions for the dust_roleMake sure you’re not adding too many permissions to the dust_role user. Here’s the max that we accept:
USAGE grant on these resources:SELECT grant on these resources:Even if the Snowflake role has permissions on views, Dust ignores views when listing resources to query; only tables are considered for agent Table queries.
Setting up Key Pair Authentication
If you chose key pair authentication, follow these steps to generate your keys and configure them in Snowflake and Dust. Step 1: Generate an RSA Key Pair You’ll need to generate a private key and a corresponding public key. The minimum key size is 2048 bits. Generate an unencrypted private key:-----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines, and without line breaks).
Alternatively, you can set this during user creation as shown in the “Create a new user” section above.
Step 3: Secure Your Private Key
Keep your private key file (rsa_key.p8) secure. You’ll need to provide it to Dust in the next section.
Security best practices:
- Never commit the private key to version control
- Store it in a secure location with restricted access
- Use an encrypted key with a strong passphrase for production environments
- Rotate keys periodically according to your security policy
GrantUSAGE on databases and schemas to the role
:bulb:Granting USAGE for databases and schemas does not mean granting access to the tables inside.It simply means that the Dust role on Snowflake will be aware of the existence of these databases & schemas, which is a pre-requisite if you wish to query some of the tables they contain. For each Snowflake database that you wish to use through Dust, you will need to grant
USAGE to the role:
USAGE to the role:
T which is in schema S which is itself in database D, you will need to grant USAGE on both database D and schemaS
Alternatively, you may decide to grant USAGE on all schemas inside of a database:
Grant SELECT on tables to the role
:bulb: GrantingSELECT on tables is what enables the Dust Snowflake role to execute SELECT SQL queries on the tables.Our Snowflake integration will reject any role that has grants other than
SELECT grants (it is very important that the Snowflake connection remains read-only, in order to fully prevent Dust agents from mutating your data)
You have the flexibility to grant access at two different levels: whole schemas, or individual tables. Choose the appropriate level based on your security requirements and Dust’s needs.
a. Grant access to whole schemas
For each schema you want to give access to:
Setup on Dust’s side
Once the Snowflake access has been setup, navigate to Dust’s Spaces > Connections, click on “Add Connections” and select Snowflake. You’ll be prompted to choose your authentication method: For Password Authentication:- Select “Username & Password”
- Fill in the connection details:
- Snowflake Account identifier (e.g.,
au12345.us-east-1) - Role (e.g.,
dust_role) - Warehouse (e.g.,
dust_warehouse) - Username (e.g.,
dust_user) - Password
- Snowflake Account identifier (e.g.,
- Select “Key Pair Authentication”
- Fill in the connection details:
- Snowflake Account identifier (e.g.,
au12345.us-east-1) - Role (e.g.,
dust_role) - Warehouse (e.g.,
dust_warehouse) - Username (e.g.,
dust_user) - Private Key: Paste the entire contents of your private key file in PEM format, including the header and footer lines (e.g.,
-----BEGIN PRIVATE KEY-----…-----END PRIVATE KEY-----) - Private Key Passphrase: If your private key is encrypted, enter the passphrase. Leave empty if the key is not encrypted.
- Snowflake Account identifier (e.g.,
- Unencrypted PKCS#8 (
-----BEGIN PRIVATE KEY-----) - Encrypted PKCS#8 (
-----BEGIN ENCRYPTED PRIVATE KEY-----) - PKCS#1 RSA keys (
-----BEGIN RSA PRIVATE KEY-----), encrypted or unencrypted
Tables only (no views)
The Snowflake connector only syncs and exposes tables for Query Tables (Table queries) in agents. Views (including materialized views) are not supported and will not be exposed to agents.