Network Policies
A network policy decides whether a connection from an address may exist. It knows nothing about rows, columns or roles.
The problem
A stolen password or key should be useless from an attacker's laptop. A network policy makes that true by limiting which network addresses can connect to Snowflake.
The mental model
The current design splits addresses from policy. A network rule is a schema-level object that holds a list of identifiers of one type. Most often that is IPv4 ranges. It can also be private-endpoint IDs, used when a company reaches Snowflake through its cloud provider's private network instead of the public internet. A network policy lists rules in an allowed list and a blocked list. The policy itself is an account-level object, so its name has no database or schema. It is attached to the account, a user, or a security integration (SCIM, Snowflake OAuth and External OAuth integrations accept one). Change one rule and every policy that lists it picks up the change.
IPv4 ranges use CIDR notation: the number after the slash says how many leading bits are fixed. So /32 is exactly one address, /28 is 16 addresses and /24 is 256. The rules below use documentation addresses, so the numbers are illustrative.
NETWORK RULES · ADDRESSES
RULETABLEAU_RANGETableau Cloud addresses
NETWORK POLICIES
TABLEAU_POLICYallowed: TABLEAU_RANGE
attached to
ATTACHED TO · PRECEDENCE
1 · SECURITY INTEGRATIONTABLEAU_OAUTHmost specific
RULEETL_SERVER192.0.2.7/32 (1 address)
ETL_ONLYallowed: ETL_SERVER
attached to
2 · USERUser SVC_ETLoverrides the account
CORP_POLICYallowed: PARIS_OFFICE, VPN_EXITblocked: BAD_HOST
attached to
3 · ACCOUNTAccounteveryone else
How it works: one connection, step by step
For each connection Snowflake picks exactly one policy, the most specific one that applies. Then it compares the address with that policy's lists. An address must match the allowed list to connect. If it also matches the blocked list, it is refused, because blocked wins on overlap. That is how you remove one compromised machine from a trusted range. A policy with no allowed IPv4 entries allows no IPv4 address at all. Never read an empty allowed list as "no restriction." When a request arrives over a private connection, the private-endpoint rules apply to it rather than the IPv4 rules.
Security integrationwith a network policy?
yes
Use the integrationpolicy
no
Userwith a network policy?
yes
Use the userpolicy
no
Use the accountpolicy
In theallowed list?
no
Refused
yes
In theblocked list?
yes
Refusedblocked wins
no
Connection allowedauthentication starts
Exactly one policy is evaluated: the most specific one that applies.
Worked example: IsmaFrost's rules
-- MODE = INGRESS: the rule describes traffic coming INTO Snowflake, which is what network policies filter.CREATE NETWORK RULE security_db. rules. paris_ office TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('203.0. ); -- 256 office addresses113. 0/ 24' CREATE NETWORK RULE security_db. rules. vpn_ exit TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('198.51. ); -- where VPN traffic reaches the internet100. 0/ 28' CREATE NETWORK RULE security_db. rules. etl_ server TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('192.0. ); -- one server2. 7/ 32' CREATE NETWORK RULE security_db. rules. tableau_ range TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('198.51. ); -- Tableau Cloud's published range100. 64/ 27' CREATE NETWORK POLICY corp_policyALLOWED_NETWORK_ = ('security_RULE_ LIST db. , 'security_rules. paris_ office' db. );rules. vpn_ exit' CREATE NETWORK POLICY etl_onlyALLOWED_NETWORK_ = ('security_RULE_ LIST db. );rules. etl_ server' CREATE NETWORK POLICY tableau_policy ALLOWED_NETWORK_ = ('security_RULE_ LIST db. );rules. tableau_ range' ALTER USER youness SET NETWORK_POLICY = corp_policy; -- test on yourself firstALTER ACCOUNT SET NETWORK_POLICY = corp_policy; -- then the whole accountALTER USER svc_etl SET NETWORK_POLICY = etl_only; -- overrides the account policyALTER SECURITY INTEGRATION tableau_oauth SET NETWORK_ POLICY = tableau_policy; -- overrides both -- Older policies list addresses directly. Still valid, harder to reuse.CREATE NETWORK POLICY legacy_policy ALLOWED_IP_ LIST = ('203. 0. ) BLOCKED_113. 0/ 24' IP_ LIST = ('203. 0. );113. 99'
When Alice opens a Tableau Cloud dashboard, the query comes from Tableau's servers, so Snowflake sees Tableau's published addresses, not her laptop. That connection uses the tableau_oauth integration, so TABLEAU_POLICY is the policy checked. Without it, CORP_POLICY would have to list Tableau's range. Her Snowsight logins still follow CORP_POLICY.
Go deeper · INGRESS, EGRESS and the VPN rule name
MODE = INGRESS means traffic coming into Snowflake, which is what network policies filter. EGRESS describes Snowflake calling out to the internet; it belongs to external access integrations, never to network policies. The rule vpn_exit holds the addresses where IsmaFrost's VPN traffic leaves for the internet, so that is the source Snowflake sees when a VPN user connects.
The pipeline's service user svc_etl authenticates with a key pair from one server. In March a private key turns up in a public repository. Because etl_only allows exactly one /32 address, the key is useless from anywhere else. Youness rotates the key through the second key slot that afternoon.
Amine works for an outside agency and connects from its network. Rather than widen the account policy, Youness attaches a user-level policy to AMINE with the agency's range. Only one policy is evaluated, so for Amine the user policy replaces CORP_POLICY: he can now connect from the agency and no longer from the Paris office. If he needs both, his policy lists both rules. Later an office workstation is compromised. Youness puts its single address in a rule and adds that rule to the blocked list of corp_policy. That one machine is refused even though it sits inside the allowed /24.
CREATE NETWORK RULE security_db. rules. agency_ range TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('192.0. );2. 128/ 28' CREATE NETWORK POLICY agency_policy ALLOWED_NETWORK_ = ('security_RULE_ LIST db. );rules. agency_ range' ALTER USER amine SET NETWORK_POLICY = agency_policy; -- replaces corp_policy for Amine only CREATE NETWORK RULE security_db. rules. bad_ host TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('203.0. );113. 99/ 32' ALTER NETWORK POLICY corp_policySET BLOCKED_NETWORK_ = ('security_RULE_ LIST db. ); -- blocked wins over the allowed /24rules. bad_ host'
Limits and traps: rolling out safely
Snowflake won't let you activate an account-level policy that blocks the address you're connected from, which protects you from locking yourself out in one statement. The documentation states that guard for the account level only. Policies also affect sessions already in progress: once a policy restricts a logged-in user's address, that user can't run further queries. That's why Youness attaches a new policy to his own user first, reconnects to check, and only then sets it on the account. If he gets it wrong, the backup ACCOUNTADMIN can undo it.
"Use a network policy so European analysts see only European rows" is wrong by category. Network policies decide whether a connection exists. Which rows a session sees is a row access policy.
- Network policies restrict connection sources only: IPv4 ranges or private endpoints, through network rules or legacy IP lists.
- Precedence: security integration > user > account. Only the most specific applicable policy is evaluated.
- Blocked overrides allowed on overlap. No allowed IPv4 entries means no IPv4 address is allowed.
- Your own address must be allowed before you can activate an account-level policy, and existing sessions are affected.

