Prerequisites
- The Admin role on the folder you’ll add the account to
- A Snowflake user for Infisical to sign in as, with a role that can use a warehouse
- A key pair or a programmatic access token for that user (Snowflake blocks password sign-in for human users, so a password only works for a service user whose policy allows it)
- A gateway on version 0.43.133 or later that can reach your Snowflake account, including over AWS PrivateLink if you use it
- If the gateway’s outbound traffic is restricted, access from the gateway to the cloud storage that Snowflake returns large results from
- A Snowflake account template
Set up the credential
Set up a key pair or a programmatic access token for the Snowflake user before you create the account.Key pair
1
Generate a key pair:
2
Assign the public key to the Snowflake user. Paste the contents of
infisical_key.pub without the header and footer lines:infisical_key.p8 into Private Key, then delete your local copy of the file.
To replace the key later without downtime, set the new key in RSA_PUBLIC_KEY_2, update the account, then remove the old key. To rotate the key pair on a schedule, use a Snowflake user key pair rotation.
Programmatic access token
Snowflake only issues a programmatic access token to a user who has a network policy, and only for a token that’s restricted to one role:Grant the role permissions
A session can do whatever the role it uses can do, so grant the role only what the account’s users need. To appear in the browser, a table needs the role to haveUSAGE on the warehouse, the database, and the table’s schema:
USE ROLE to switch to any other role that the Snowflake user holds, so grant the user only the roles its sessions should use.
Create the account
1
Go to Privileged Access Management > Accounts and select Add Account.
2
Select the Folder and a Snowflake Account Template, then select Next.
3
Enter a Name and the connection details:
4
Select the Auth Method, enter the Snowflake Username, and enter the credential:
5
Select Create. Infisical signs in to Snowflake through the gateway to check the credential and the warehouse before it saves the account.
Connect
To open a session, follow Connect to an account.- Browser
- CLI
The browser session has a table browser and a SQL editor. The table browser shows the first 1,000 rows of a result.Snowflake doesn’t enforce primary keys, but the table browser needs a declared primary key to edit a table’s rows. If a table has no primary key, edit its rows from the SQL editor.
Recording and command blocking
Infisical records every statement in a session and its outcome. To see them, open the session and go to Session Logs. The template’s Command Blocking patterns apply to Snowflake statements. If a statement matches a pattern, Infisical rejects the statement before it reaches Snowflake and records the rejection. Command blocking only matches the text of each statement, so it can’t stop SQL that a statement builds while it runs, such as withEXECUTE IMMEDIATE. For restrictions that must always hold, use Snowflake privileges.
Next steps
Sessions
Review and end the connections that people and agents make to your accounts.
Access requests
Require approval before a member can use a sensitive account.