Portable now supports Key Pair Authentication for Snowflake destinations, allowing users to securely connect to their Snowflake account using an encrypted or unencrypted key pair. This method enhances security by replacing passwords with cryptographic authentication. In this guide, we'll walk through setting up Key Pair Authentication, generating your keys, configuring Snowflake, and adding credentials in Portable.
Key Pair Authentication provides a more secure way to authenticate with Snowflake by eliminating the need for passwords in API requests. Instead, it uses an asymmetric cryptographic key pair:
If the private key is encrypted, you'll need to provide a passphrase. Otherwise, it can be left blank in Portable.
To use Key Pair Authentication, you first need to generate an RSA key pair. Run the following commands in your terminal:
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8
The ouput result will be a private key in PEM format e.g.
-----BEGIN ENCRYPTED PRIVATE KEY-----
...
-----END ENCRYPTED PRIVATE KEY-----
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
The ouput result will be a public key in PEM format e.g.
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
Once you've generated your public key, register it with your Snowflake user account by executing the following SQL statement in Snowflake. __It is important in this stept that when you set your public key you only use the encoded content of your key, do not keep the header and footer__e.g:
-----BEGIN PUBLIC KEY-----
T32T...
-----END PUBLIC KEY-----
ALTER USER MY_SNOWFLAKE_USER SET RSA_PUBLIC_KEY = 'T32T...';
You can check your user information using this statement
DESC USER MY_SNOWFLAKE_USER;
Now that your Snowflake account is configured, you need to add the private key in Portable.
If you used an encrypted private key, enter the passphrase.
Save the configuration.
Once the setup is complete, Portable will attempt to connect to Snowflake using the private key. If everything is set up correctly, you'll see a success messages:
If there are any missing required fields, Portable will highlight them for you to update.