Migrate existing Snowflake user to key-pair

Prev Next

1. Generate the key pair

Run the following commands on a workstation with OpenSSL installed:

openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub

During execution, you will be prompted to set a password. You will need this password later on the platform.

Two files will be generated: rsa_key.p8 and rsa_key.pub.


2. Configure the public key in Snowflake

Log in to your Snowflake dashboard and run the following queries (replace the value with the actual contents of rsa_key.pub):

USE ROLE SECURITYADMIN;
ALTER USER PC_HUNTERS_DB_COLLECTION_USER SET RSA_PUBLIC_KEY = 'MIIBIjANBgkqh...';

3. Update the configuration in Hunters

  1. Open the Hunters portal.

  2. Go to the Data Sources page.

  3. Find the Snowflake data source, click the three dots (â‹®), and select Edit.

  4. Set the Private Key field to the entire contents of rsa_key.p8, including the lines:

    -----BEGIN ENCRYPTED PRIVATE KEY-----
    ...
    -----END ENCRYPTED PRIVATE KEY-----
    
  5. Set the Private Key Passphrase to the password you used when generating the key pair with OpenSSL.

  6. Click Test Connection, then Save.