Snowflake
Snowflake Integration
Common Fate integrates with Snowflake to grant/revoke database access when access is requested and approved.
To configure the Snowflake integration, Common Fate requires a Snowflake account with ACCOUNTADMIN
role or SECURITYADMIN
role to create the necessary service account and role.
We create a dedicated integration user with minimal permissions instead of using ACCOUNTADMIN
to follow the principle of least privilege. This integration user will only have permissions to:
- View users and databases
- Create and manage roles
- Grant and revoke roles
Prerequisites
- Log in to Snowflake at https://app.snowflake.com
- Switch to ACCOUNTADMIN or SECURITYADMIN role by running:
- Run the following commands line by line to create the integration role and user:
- You can use the AWS CLI to create a secret in the region you are deploying to, you must use the following path
"/<namespace>/<stage>/<secret name>"
- Run these commands to get the required connection details:
- In your configuration Terraform, add the following into your
main.tf
file
- Account ID: Use the account_id from the query result in step 5
- Region: Use the region from the query result in step 5
- Username: Use the username of the integration user created in step 3. If you ran the commands as is, it would be
COMMONFATE_INTEGRATION_USER
Provisioning access to Snowflake Account
To make a Snowflake account available for Just-In-Time (JIT) access you can add a commonfate_snowflake_account_availability
resource to your Common Fate application Terraform code.
You’ll need to use the commonfate_snowflake_account_availability
in conjunction with a commonfate_access_workflow
resources.
Snowflake Account Availability
Access workflow
Provisioning access to Snowflake Database
To make Snowflake databases available for Just-In-Time (JIT) access you can add a commonfate_snowflake_database_selector
Selector resource to your Common Fate application Terraform code. As shown below, the when
clause in the resource is a Cedar expression. You can use any Cedar operator in the when
clause, such as &&
and ||
to combine conditions.
You’ll need to use the commonfate_snowflake_database_selector
in conjunction with a commonfate_snowflake_database_availabilities
and commonfate_access_workflow
resources.
Snowflake Database Selector
Snowflake Database Availability
Access workflow
Support
If you need assistance with this integration, please contact support@commonfate.io, or join our Slack community here, we’re happy to help!