Configures column-level and external-stage encryption to protect data in Snowflake.
Snowflake already encrypts all data at rest and in transit. "Enabling encryption" normally refers to adding extra protections, such as column-level encryption with the ENCRYPT
/DECRYPT
functions, or server-side encryption on external stages.
Wrap sensitive values with ENCRYPT
when you load them.Store the encrypted VARBINARY in a dedicated column (often suffixed “_enc”).
ENCRYPT( plaintext_expr :: STRING , passphrase_expr :: STRING [ , 'aes' ] ) :: VARBINARY
Create a new encrypted column, update it with ENCRYPT
, validate, then drop the original plaintext column to avoid data loss.
Use DECRYPT
at query time or create a secure view that handles decryption for authorized roles only.
DECRYPT( ciphertext_expr :: VARBINARY , passphrase_expr :: STRING [ , 'aes' ] ) :: STRING
Add an ENCRYPTION = ( TYPE = 'AWS_SSE_KMS' MASTER_KEY = 'aws_kms_key_arn' )
clause in CREATE STAGE
to ensure files are encrypted in S3.
CREATE OR REPLACE STAGE stage_name
URL = 's3://bucket/path/'
STORAGE_INTEGRATION = my_int
ENCRYPTION = ( TYPE = 'AWS_SSE_KMS' MASTER_KEY = 'aws_kms_key_arn' );
Store passphrases in Snowflake secrets or a dedicated key vault, rotate keys regularly, audit access, and limit decryption to roles that absolutely need it.
.
Snowflake encrypts all data automatically, but column-level encryption provides defense-in-depth for highly sensitive fields like PII.
Encrypting or decrypting at runtime adds CPU overhead. Benchmark critical queries and decrypt only the columns you need.
Yes. Insert data with a new passphrase, decrypt with the old one, and gradually migrate. For stages, update MASTER_KEY
in ALTER STAGE
.