Snowflake
Connect Snowflake to Trustle to get insight into over-privileged and unused accounts, and to adopt just-in-time access management.
Prerequisites
Section titled “Prerequisites”- An Account Admin user in the Snowflake console.
Configure Snowflake
Section titled “Configure Snowflake”Step 1: Create the trustle_setup.sql
Section titled “Step 1: Create the trustle_setup.sql”- Log in to the Snowflake console as an Account Admin user.
- Go to your workspace in the Snowflake console (Work with data → Projects → Workspace).
- Create a new file to run the Trustle setup queries.
Step 2: Create the Trustle Role
Section titled “Step 2: Create the Trustle Role”- Create the role for the Trustle service account.
- Grant
IMPORTEDprivileges on the Snowflake database. - Grant the
SECURITYADMINrole to the Trustle role.
CREATE ROLE IF NOT EXISTS TRUSTLE_ROLE COMMENT = 'Role for Trustle integration - DO NOT DELETE.';
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE TRUSTLE_ROLE;
GRANT ROLE SECURITYADMIN TO ROLE TRUSTLE_ROLE;Step 3: Create the Trustle Warehouse
Section titled “Step 3: Create the Trustle Warehouse”- Create the warehouse that the Trustle service account uses.
- Grant
USAGEto the Trustle role.
CREATE WAREHOUSE IF NOT EXISTS TRUSTLE_ETL_WHWAREHOUSE_SIZE = 'XSMALL'AUTO_SUSPEND = 60AUTO_RESUME = TRUE;
GRANT USAGE ON WAREHOUSE TRUSTLE_ETL_WH TO ROLE TRUSTLE_ROLE;Step 4: Create the Trustle Service Account User
Section titled “Step 4: Create the Trustle Service Account User”-
Open a terminal on your local machine and create an RSA key for the service account.
Terminal window openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out trustle_rsa_key.p8 -nocryptopenssl rsa -in trustle_rsa_key.p8 -pubout -out trustle_rsa_key.pub -
Create the service account user, replacing the
RSA_PUBLIC_KEYcontents with your generated public key. -
Grant the Trustle role to the service account.
CREATE USER TRUSTLE_SERVICE_ACCOUNTTYPE = SERVICEDEFAULT_ROLE = SECURITYADMINDEFAULT_WAREHOUSE = TRUSTLE_ETL_WHCOMMENT = 'Service Account for Trustle integration - DO NOT DELETE.'RSA_PUBLIC_KEY='<contents of trustle_rsa_key.pub>';
GRANT ROLE TRUSTLE_ROLE TO USER TRUSTLE_SERVICE_ACCOUNT;Connect in Trustle
Section titled “Connect in Trustle”- Go to the Connections page in Trustle from the left menu.
- Under SaaS Applications, find the Snowflake logo and click Connect.
- Provide the connection details.
- Add the Snowflake Account Identifier, for example
xy12345.us-east-1ororganization-account_name. - Add the Private Key you generated in Create the Trustle Service Account User, including the
BEGINandENDlines. - Click Test Connection.
- After the connection test succeeds, click Save Connection.