| name | snowflake-security-basics |
| description | Apply Snowflake security best practices: network policies, key rotation,
MFA, encryption, and least-privilege access.
Use when securing Snowflake access, implementing network policies,
or auditing security configuration.
Trigger with phrases like "snowflake security", "snowflake network policy",
"secure snowflake", "snowflake MFA", "snowflake encryption".
|
| allowed-tools | Read, Write, Grep |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","data-warehouse","analytics","snowflake"] |
| compatibility | Designed for Claude Code |
Snowflake Security Basics
Overview
Security best practices for Snowflake: network policies, key pair rotation, MFA, secret management, and least-privilege roles.
Prerequisites
- SECURITYADMIN or ACCOUNTADMIN role access
- Understanding of network CIDR notation
- Secret management solution (Vault, AWS Secrets Manager, etc.)
Instructions
Step 1: Create Network Policies
CREATE OR REPLACE NETWORK POLICY corporate_policy
ALLOWED_IP_LIST = (
'203.0.113.0/24',
'198.51.100.0/24',
'10.0.0.0/8'
)
BLOCKED_IP_LIST = (
'203.0.113.99'
);
ALTER ACCOUNT SET NETWORK_POLICY = corporate_policy;
ALTER USER svc_etl SET NETWORK_POLICY = corporate_policy;
SELECT * FROM TABLE(INFORMATION_SCHEMA.POLICY_REFERENCES(POLICY_NAME => 'corporate_policy'));
Step 2: Configure Key Pair Rotation
#!/bin/bash
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key_new.p8 -nocrypt
openssl rsa -in rsa_key_new.p8 -pubout -out rsa_key_new.pub
PUB_KEY=$(grep -v rsa_key_new.pub | -d )