Skip to main content

Network Security & Private Connectivity

Data governance doesn't stop at row and column access — you also need to control how users and services connect to Snowflake. This lesson covers network policies, network rules, private connectivity, external access integrations, and zero-trust architecture.


Network Policies: IP-Based Access Control​

Network policies restrict which IP addresses can connect to your Snowflake account.

CREATE OR REPLACE NETWORK POLICY corporate_access
ALLOWED_IP_LIST = ('10.0.0.0/8', '172.16.0.0/12', '192.168.1.0/24')
BLOCKED_IP_LIST = ('10.0.0.99')
COMMENT = 'Restrict access to corporate network ranges';

The evaluation logic:

  1. If the client IP is in BLOCKED_IP_LIST, deny (block list takes precedence).
  2. If the client IP is in ALLOWED_IP_LIST, allow.
  3. If the client IP is in neither list, deny (implicit deny when an allow list exists).

Applying Network Policies​

Network policies can be applied at different scopes:

ALTER ACCOUNT SET NETWORK_POLICY = corporate_access;           -- Account-level
ALTER USER service_account SET NETWORK_POLICY = svc_policy; -- User-level
ALTER SECURITY INTEGRATION my_oauth SET NETWORK_POLICY = pol; -- Integration-level
LevelPrecedenceUse Case
Security IntegrationHighestControl OAuth/SAML client access
UserMediumService accounts with static IPs
AccountLowestDefault policy for all users

A user-level policy overrides the account-level one entirely — it doesn't combine them.

SHOW NETWORK POLICIES;
SHOW PARAMETERS LIKE 'NETWORK_POLICY' IN ACCOUNT;

Network Rules: Fine-Grained Control​

Network rules support different types of network identifiers — not just IP addresses.

CREATE OR REPLACE NETWORK RULE corp_ip_rule
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('10.0.0.0/8', '172.16.0.0/12');

CREATE OR REPLACE NETWORK RULE vpc_endpoint_rule
MODE = INGRESS
TYPE = AWSVPCEID
VALUE_LIST = ('vpce-0a1b2c3d4e5f67890');

CREATE OR REPLACE NETWORK POLICY advanced_policy
ALLOWED_NETWORK_RULE_LIST = ('corp_ip_rule', 'vpc_endpoint_rule')
BLOCKED_NETWORK_RULE_LIST = ();

Network rules separate the definition of trusted sources from the policy that references them. Update the rule when IPs change, and every policy referencing it picks up the change.


Private Connectivity Options​

Many organizations require private network paths that never traverse the public internet:

CloudServiceHow It Works
AWSAWS PrivateLinkVPC endpoint in your account connects to Snowflake's VPC
AzureAzure Private LinkPrivate endpoint in your VNet connects to Snowflake
GCPPrivate Service ConnectForwarding rule targets Snowflake's service attachment
-- Retrieve private connectivity configuration
SELECT SYSTEM$GET_PRIVATELINK_CONFIG();

-- Authorize a private endpoint (AWS example)
SELECT SYSTEM$AUTHORIZE_PRIVATELINK('<aws-account-id>', '<vpce-id>');

Combine private connectivity with network policies to block all public access:

CREATE OR REPLACE NETWORK RULE private_only_rule
MODE = INGRESS
TYPE = AWSVPCEID
VALUE_LIST = ('vpce-0a1b2c3d4e5f67890');

CREATE OR REPLACE NETWORK POLICY private_only_policy
ALLOWED_NETWORK_RULE_LIST = ('private_only_rule');

ALTER ACCOUNT SET NETWORK_POLICY = private_only_policy;

External Access Integrations​

By default, Snowflake blocks all outbound network access from UDFs and procedures. External access integrations open specific, controlled pathways.

CREATE OR REPLACE NETWORK RULE api_egress_rule
MODE = EGRESS
TYPE = HOST_PORT
VALUE_LIST = ('api.myservice.com:443');

CREATE OR REPLACE SECRET api_key_secret
TYPE = GENERIC_STRING
SECRET_STRING = 'your-api-key-here';

CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION my_api_integration
ALLOWED_NETWORK_RULES = (api_egress_rule)
ALLOWED_AUTHENTICATION_SECRETS = (api_key_secret)
ENABLED = TRUE;

CREATE OR REPLACE FUNCTION call_ml_model(input_text VARCHAR)
RETURNS VARCHAR
LANGUAGE PYTHON
RUNTIME_VERSION = '3.10'
HANDLER = 'predict'
EXTERNAL_ACCESS_INTEGRATIONS = (my_api_integration)
SECRETS = ('api_key' = api_key_secret)
PACKAGES = ('requests')
AS $$
import requests, _snowflake

def predict(input_text):
api_key = _snowflake.get_generic_secret_string('api_key')
resp = requests.post('https://api.myservice.com/predict',
json={'text': input_text},
headers={'Authorization': f'Bearer {api_key}'})
return resp.json()['prediction']
$$;

Trust Center and Security Scanner​

Snowflake's Trust Center scans your account for common security misconfigurations:

ScannerWhat It Checks
Security EssentialsMFA enforcement, network policies, default role settings
CIS BenchmarkCenter for Internet Security Snowflake benchmark compliance
Threat IntelligenceSuspicious login patterns, known-bad IP addresses

Common findings: users without MFA, no account-level network policy, ACCOUNTADMIN as default role, overly broad IP allow lists, password-based service accounts. Each finding includes a severity rating and remediation steps.


Zero-Trust Best Practices​

Identity: Enforce MFA for humans. Use key-pair auth for service accounts. Federate through SAML/SCIM.

Network: Deploy private connectivity and block public access. Use network rules with VPC endpoint IDs. Apply dedicated policies per security integration.

Data: Classify and tag-mask everything. Use IS_ROLE_IN_SESSION() in policies. Monitor ACCESS_HISTORY for anomalies.

Operations: Review Trust Center weekly. Alert on failed login spikes. Limit ACCOUNTADMIN usage.

CREATE OR REPLACE ALERT failed_login_alert
WAREHOUSE = governance_wh
SCHEDULE = '5 MINUTE'
IF (EXISTS (
SELECT 1
FROM SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY
WHERE event_timestamp >= DATEADD('minute', -5, CURRENT_TIMESTAMP())
AND is_success = 'NO'
GROUP BY user_name
HAVING COUNT(*) > 10
))
THEN
CALL SYSTEM$SEND_EMAIL(
'security_notifications',
'security@company.com',
'Snowflake: Excessive Failed Logins Detected',
'More than 10 failed login attempts in the last 5 minutes.'
);

Key Takeaways​

  • Network policies control who can connect; apply them at account level as a baseline.
  • Network rules provide type-specific filtering and are reusable across policies.
  • Private connectivity keeps traffic off the public internet.
  • External access integrations control outbound traffic from UDFs and procedures.
  • Trust Center scans for misconfigurations; use it as a regular checkpoint.
  • Think zero-trust: verify identity, restrict network paths, protect data, monitor everything.

This wraps up Module 25 on Snowflake governance and security.