What you will be able to do
- Choose the right network rule TYPE and MODE for ingress, internal-stage and egress traffic
- Predict whether a request is allowed when a network policy has both allowed and blocked rules
- Work out which network policy applies when policies are set on the account, a user and a security integration
- Build a policy that allows only a private endpoint and blocks all public traffic on AWS, Azure or Google Cloud
Key concept
Network rule versus network policy — A network rule is a schema-level object that only groups network identifiers of one TYPE, such as IPv4 ranges or VPC endpoint IDs. Whether those identifiers are allowed or blocked is decided by the network policy that lists the rule, and the policy has no effect until it is activated on an account, user or security integration.
1.Why inbound traffic needs a network policy
A new Snowflake account accepts connections from anywhere. With no network policy in place, a stolen password works just as well from an unknown laptop as from the corporate office, because nothing checks where a request comes from. A network policy closes that gap. It controls inbound access to the Snowflake service and to the internal stage, and only a security administrator (or a higher role) can use one.
A policy is built in three steps, and the third step is the one people forget:
- Create network rules that group identifiers by purpose and by type.
- Create a network policy that lists those rules in its allowed list or its blocked list.
- Activate the policy on the account, a user or a security integration.
A policy that has been created but not activated restricts nothing. When you troubleshoot a policy that seems to be ignored, first check whether it was ever attached to anything.
Network policies govern traffic coming into Snowflake. Traffic going out, such as a UDF calling an external API, is handled by a different feature, external network access. That feature also uses network rules, but it uses them in a different mode.
Checkpoint 1 of 9· Put it in order
A security administrator wants to stop logins from outside the corporate office. Put the steps for controlling inbound traffic with a network policy in the correct order.
- 1.Activate the network policy on the account, a user or a security integration
- 2.Create a network policy that lists those network rules in its allowed list or blocked list
- 3.Create network rules that group the allowed office IP ranges by purpose and identifier type
Network rules only group identifiers, so they come first. The policy then lists those rules and decides whether they are allowed or blocked. The policy restricts nothing until it is activated, and that last step is the one people most often forget.
“Activate the network policy for an account, user, or security integration. A network policy doesn’t restrict network traffic until it is activated.”Source: docs.snowflake.com
Sources1
2.Network rule TYPE and MODE
TYPE says what kind of identifier a rule holds, and a single rule never mixes kinds. A rule with TYPE = IPV4 takes addresses or CIDR ranges such as 192.168.1.0/24. IPV6 takes IPv6 addresses and is available only on AWS. AWSVPCEID takes AWS VPC endpoint IDs, and plain VPC IDs are not accepted. AZURELINKID takes the LinkIDs of Azure private endpoints. GCPPSCID takes the pscConnectionIDs of Google Cloud Private Service Connect endpoints. COMPUTE_POOL takes Snowpark Container Services compute pool names. For outbound traffic, HOST_PORT takes domains with an optional port. The port defaults to 443, and example.com:0 allows every port.
MODE says which traffic the feature using the rule controls. For network policies, MODE also sets how far the protection reaches. The same IPv4 rule can protect only the service, or the service and the AWS internal stage as well, depending on an account parameter.
| MODE | Used by | What it controls | Conditions |
|---|---|---|---|
| INGRESS | Network policy | Snowflake service. With IPV4 it can also cover an AWS internal stage | Stage coverage needs ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES. IPV6, AWSVPCEID, AZURELINKID and GCPPSCID rules protect the service only |
| INTERNAL_STAGE | Network policy | AWS internal stage, without restricting the service | ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES enabled and TYPE must be AWSVPCEID |
| SNOWFLAKE_MANAGED_STORAGE_VOLUME | Network policy | AWS Snowflake-managed storage volume, without restricting the service | ENFORCE_NETWORK_RULES_FOR_SNOWFLAKE_MANAGED_STORAGE_VOLUME enabled and TYPE must be AWSVPCEID |
| EGRESS | External access integration | Requests sent from Snowflake by a UDF or procedure | Not used to restrict inbound connections |
Network rules are schema objects, so creating one needs the CREATE NETWORK RULE privilege on the schema. By default only ACCOUNTADMIN, SECURITYADMIN and the schema owner have that privilege. To delegate the work, grant it to a custom role, as in the example below. Keep rules small and purpose-built, for example one per region or one for privileged service users, and record each rule's purpose in COMMENT. SHOW NETWORK RULES then lists every rule with its comment.
GRANT CREATE NETWORK RULE ON SCHEMA securitydb.myrules TO ROLE network_admin; USE ROLE network_admin; CREATE NETWORK RULE cloud_network TYPE = IPV4 MODE = INGRESS VALUE_LIST = ('47.88.25.32/27');Checkpoint 2 of 9· Check yourself
On an AWS-hosted account, a network policy already allows a network rule with TYPE = AWSVPCEID and MODE = INGRESS. The team now also wants the internal stage reachable only through that same VPC endpoint. What do they need to do?
Only an IPV4 INGRESS rule can extend to the AWS internal stage once the parameter is enabled. AWSVPCEID INGRESS rules always protect only the service, so restricting the stage by VPCE ID needs its own INTERNAL_STAGE rule, and that rule must be TYPE = AWSVPCEID. EGRESS is for outbound traffic from external access integrations.
“you must create a separate network rule by using the INTERNAL_STAGE mode.”Source: docs.snowflake.com
Checkpoint 3 of 9· Exam question
Which statement correctly describes network rule modes when building a network policy that restricts who can connect to the Snowflake service?
Correct answer: A — Ingress-mode rules restrict access to the service, while egress-mode rules serve external network access and are invalid in a network policy.
- A. Correct: network policies take INGRESS rules (and INTERNAL_STAGE rules for stages); EGRESS rules belong to external access integrations.
- B. Incorrect: the directions are reversed; ingress controls traffic arriving at Snowflake.
- C. Incorrect: INGRESS is the default mode, and internal stage mode applies to AWS only.
- D. Incorrect: the mode determines how a rule is used, and egress rules cannot be placed in a policy.
Sources2
3.How the allowed and blocked lists are evaluated
An allowed list blocks everything else of the same type. If the only IPv4 rule in ALLOWED_NETWORK_RULE_LIST holds a single address, every other IPv4 address is refused. You do not need to add a blocked rule for the rest of the internet. The blocked list exists to cut exceptions out of a range you have allowed.
The blocked list wins. When an address matches both lists, Snowflake applies the blocked values first and refuses the request. It makes no difference that the address sits inside an allowed range. The example below uses this to allow a /24 range except for one host. Addresses outside the /24 are refused too, because the allowed list already excludes them.
CREATE NETWORK RULE allow_access_rule
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('192.168.1.0/24');
CREATE NETWORK RULE block_access_rule
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('192.168.1.99');
CREATE NETWORK POLICY public_network_policy
ALLOWED_NETWORK_RULE_LIST = ('allow_access_rule')
BLOCKED_NETWORK_RULE_LIST=('block_access_rule');A policy that has both IPv4 and IPv6 rules evaluates each type on its own. A request that arrives over IPv6 when the policy has no IPv6 rules is checked against the IPv4 rules only. IPv6 clients can connect at all only after ENABLE_DUAL_STACK_LOAD_BALANCER is set to TRUE.
Older policies built with ALLOWED_IP_LIST and BLOCKED_IP_LIST still work, and the blocked-first behaviour applies to them too. New policies should use network rules, and one policy should not mix the two methods. Pre-rule policies also can no longer be edited in Snowsight. Use ALTER NETWORK POLICY for them.
Checkpoint 4 of 9· Check yourself
A network policy has one IPv4 rule in ALLOWED_NETWORK_RULE_LIST. That rule holds only the office address 203.0.113.10, and the blocked list is empty. The policy is active on the account. An engineer wants to add a blocked rule for 0.0.0.0/0 so that the rest of the internet is refused. What should you tell them?
An allowed list refuses every identifier of the same type that it doesn't list, so the office address is already the only IPv4 address that can connect. 203.0.113.10 falls inside 0.0.0.0/0, and blocked values are applied first, so that blocked rule would also lock out the office.
“if you add an IPv4 network rule with a single IP address to the allowed list, all other IPv4 addresses are blocked.”Source: docs.snowflake.com
Checkpoint 5 of 9· Exam question
A network policy lists rule corp_allowed (TYPE IPV4, MODE INGRESS, 10.20.0.0/16) in ALLOWED_NETWORK_RULE_LIST and rule quarantine (TYPE IPV4, MODE INGRESS, 10.20.5.0/24) in BLOCKED_NETWORK_RULE_LIST. A user connects from 10.20.5.9. What is the outcome?
Correct answer: C — The connection is denied, because the address matches the blocked rule and Snowflake applies blocked values before allowed values.
- A. Incorrect: blocked values are not skipped once an allowed rule matches.
- B. Incorrect: the blocked list is independent of the allowed ranges and is not limited to addresses outside them.
- C. Correct: when an address matches both lists, the blocked entry wins, so a narrow quarantine range can be carved out of a wide allowed range.
- D. Incorrect: no repetition is needed; the blocked list takes effect on its own.
Sources1
4.Account, user and security integration: which policy applies
The most specific policy replaces the more general ones. It does not stack on top of them. You can activate a policy on the account, on a user or on a security integration. When more than one applies to a request, Snowflake uses only the most specific one. A user-level policy overrides the account policy. A security-integration policy overrides both.
| Activated on | Overrides | Overridden by |
|---|---|---|
| Account | Nothing (most general) | User and security integration policies |
| User | Account policy | Security integration policy |
| Security integration | Account and user policies | Nothing (most specific) |
Here is a worked case. The account policy allows only the office range 203.0.113.0/24. A service user has its own policy that allows 198.51.100.0/24. When that user connects from 198.51.100.17, the login succeeds. For this user the account policy is never read, so the user's address does not need to appear in it. The same override solves a common problem with integrations. If an identity provider's calls through a security integration are refused by a strict account policy, attach a policy to that integration. You do not need to loosen the account policy.
Two exceptions are easy to miss. For Snowflake OAuth, client-to-Snowflake traffic such as token requests ignores the user-level policy. Only the integration-level and account-level policies apply, except for the built-in SNOWFLAKE$LOCAL_APPLICATION integration, which also enforces the user policy. The other exception is MINS_TO_BYPASS_NETWORK_POLICY. This user property temporarily bypasses a policy, it is visible in DESCRIBE USER, and only Snowflake Support can set it.
Checkpoint 6 of 9· Match them up
Match each place a network policy can be activated, plus one special case, to how Snowflake decides which policy applies.
Tap a term, then the definition that fits it.
Policies don't stack. Snowflake uses only the most specific policy that applies: a security integration beats a user, and a user beats the account. So a user policy can let a user in from an address the account policy would refuse. Snowflake OAuth token requests are the exception: they skip the user policy unless they go through SNOWFLAKE$LOCAL_APPLICATION.
“Network policies applied to a user override network policies applied to the account, but are overridden by a network policy applied to a security integration.”Source: docs.snowflake.com
Checkpoint 7 of 9· Exam question
An account-level network policy allows only the corporate range 203.0.113.0/24 through an ingress network rule. The service user svc_etl has its own user-level network policy that allows 198.51.100.0/24, and no other policies exist. What happens when svc_etl connects from 198.51.100.17?
Correct answer: A — The login succeeds, because the user-level policy replaces the account policy for this user and the address falls inside its allowed range.
- A. Correct: Snowflake applies the most specific policy, so the user-level policy is the only one evaluated for this user and the address matches its allowed rule.
- B. Incorrect: evaluation is not layered from the account down; the account policy is skipped when a user-level policy is set.
- C. Incorrect: policies do not combine as an intersection. Only one policy applies at a time, chosen by specificity.
- D. Incorrect: a user-level policy can allow addresses the account policy does not, since it overrides rather than narrows.
Sources1
5.Private endpoint rules and blocking public access
For requests that arrive over private connectivity, private endpoint rules take precedence over IP rules. Suppose a request comes in over private connectivity and the allowed list contains an AWSVPCEID or AZURELINKID rule. Snowflake then ignores every IPV4 and IPV6 rule in the policy, whether the rule holds public or private ranges.
The reverse is not true. A private endpoint rule has no effect on public traffic. Allowing a VPCE ID does not block the public internet, so a team that only adds the endpoint rule has left public logins open. To allow only the endpoint, you need two rules: the endpoint rule in the allowed list, and an IPv4 rule for 0.0.0.0/0 in the blocked list.
CREATE NETWORK RULE block_public_access
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('0.0.0.0/0');
CREATE NETWORK RULE allow_vpceid_access
MODE = INGRESS
TYPE = AWSVPCEID
VALUE_LIST = ('vpce-0fa383eb170331202');
CREATE NETWORK POLICY allow_vpceid_block_public_policy
ALLOWED_NETWORK_RULE_LIST = ('allow_vpceid_access')
BLOCKED_NETWORK_RULE_LIST=('block_public_access');Shared endpoints need a finer filter. When several VPCs, VNets or business units reach Snowflake through one endpoint or transit gateway, an INGRESS rule of type AWSVPCEID, AZURELINKID or GCPPSCID can use the tuple form {private_link_id:ip_or_cidr,...}. Snowflake then matches the endpoint ID and the private IP together. This still works when private ranges overlap. If each endpoint maps to exactly one VPC, a plain endpoint rule is enough.
Snowpark Container Services services that use customer-provided credentials are a separate case. Their requests are checked only against COMPUTE_POOL rules, so even 0.0.0.0/0 in the allowed list does not let them in. Without a matching compute pool rule they fail with error 390422.
Checkpoint 8 of 9· Fill the gap
This policy should let in only traffic from one VPC endpoint and refuse every public IPv4 address. Which keyword completes the last line?
CREATE NETWORK RULE block_public_access
MODE = INGRESS
TYPE = IPV4
VALUE_LIST = ('0.0.0.0/0');
CREATE NETWORK RULE allow_vpceid_access
MODE = INGRESS
TYPE = AWSVPCEID
VALUE_LIST = ('vpce-0fa383eb170331202');
CREATE NETWORK POLICY allow_vpceid_block_public_policy
ALLOWED_NETWORK_RULE_LIST = ('allow_vpceid_access')
? =('block_public_access');A VPCE ID rule has no effect on public requests. Allowing the endpoint does not shut out the internet, so the 0.0.0.0/0 IPv4 rule must go in the blocked list. Placed in the allowed list, it would let every public address in. BLOCKED_IP_LIST is the older method: it takes IP addresses rather than network rules, and it shouldn't be mixed with network rules in one policy.
Source: docs.snowflake.com6.Enforcing the same policy design on AWS, Azure and Google Cloud
The pattern is the same on every cloud. What changes is the identifier type and how far each rule reaches. An organization with accounts on all three clouds can apply one standard everywhere: allow the private endpoint, block 0.0.0.0/0, and activate the policy narrowly. Each account then needs the endpoint type for its own cloud, and the internal stage needs separate handling on each.
| Cloud | Private endpoint TYPE | Where to find the ID | Internal stage restriction by network rule |
|---|---|---|---|
| AWS | AWSVPCEID (VPC IDs not supported) | VPCE ID of the VPC endpoint | Yes: INTERNAL_STAGE mode, or IPV4 INGRESS once ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES is enabled |
| Azure | AZURELINKID | SYSTEM$GET_PRIVATELINK_AUTHORIZED_ENDPOINTS | No: you can only block all public traffic to the stage |
| Google Cloud | GCPPSCID | pscConnectionID from gcloud compute forwarding-rules describe | Not via INGRESS: GCPPSCID rules protect the service only |
IPv6 is a further AWS-only difference. IPv6 rules support only INGRESS mode and never protect internal stages, so a policy that copies IPv6 rules into an Azure or Google Cloud account protects nothing there.
Checkpoint 9 of 9· Match them up
An organization uses the same policy design on Snowflake accounts in all three clouds: allow the private endpoint and block 0.0.0.0/0. For each cloud or rule, pick the statement that describes how it behaves.
Tap a term, then the definition that fits it.
The allow-endpoint, block-public pattern works on every cloud, but how far it reaches is different on each. Only AWS can restrict an internal stage with a network rule, through INTERNAL_STAGE mode. On Azure you can only block public traffic to the stage, and Google Cloud's GCPPSCID INGRESS rules cover only the service. IPv6 rules are AWS-only and never protect stages.
“For accounts on Microsoft Azure, you cannot use a network rule to restrict access to the internal stage.”Source: docs.snowflake.com
Sources2
Sources
(2)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“By default, Snowflake allows users to connect to the service and internal stage from any computer or device.”
↩︎ Why inbound traffic needs a network policy“A network policy doesn’t restrict network traffic until it is activated.”
↩︎ Why inbound traffic needs a network policy“if you add an IPv4 network rule with a single IP address to the allowed list, all other IPv4 addresses are blocked.”
↩︎ How the allowed and blocked lists are evaluated“Snowflake applies the values in the BLOCKED_IP_LIST parameter first. This behavior also applies to the ALLOWED_NETWORK_RULE_LIST and the BLOCKED_NETWORK_RULE_LIST parameters.”
↩︎ How the allowed and blocked lists are evaluated“If a request arrives over IPv6 and no IPv6 network rules are present in the policy, the request is evaluated against IPv4 rules only.”
↩︎ How the allowed and blocked lists are evaluated“all new network policies should use network rules, not the ALLOWED_IP_LIST and BLOCKED_IP_LIST parameters, to control access from IP addresses.”
↩︎ How the allowed and blocked lists are evaluated“the most specific network policy overrides more general network policies”
↩︎ Account, user and security integration: which policy applies“Network policies applied to a security integration are the most specific network policies. They override both accounts and users.”
↩︎ Account, user and security integration: which policy applies“For Snowflake OAuth, the user-level network policy is not considered for client-to-Snowflake traffic such as token requests.”
↩︎ Account, user and security integration: which policy applies“Only Snowflake can set the value for this object property.”
↩︎ Account, user and security integration: which policy applies“Whenever possible, narrowly scope a network policy to a group of users or a security integration rather than an entire account.”
↩︎ Account, user and security integration: which policy applies“then all IPV4 and IPV6 network rules that contain public or private IP ranges are ignored.”
↩︎ Private endpoint rules and blocking public access“you must create two separate network rules, one for the allowed list and another for the blocked list.”
↩︎ Private endpoint rules and blocking public access“are evaluated only against network rules of type COMPUTE_POOL.”
↩︎ Private endpoint rules and blocking public access“Network policies applied to a user override network policies applied to the account”
↩︎ Exam trap 1“to restrict access has no effect on requests coming from the public network”
↩︎ Exam trap 2“Activate the network policy for an account, user, or security integration. A network policy doesn’t restrict network traffic until it is activated.”
↩︎ Checkpoint“This behavior also applies to the ALLOWED_NETWORK_RULE_LIST and the BLOCKED_NETWORK_RULE_LIST parameters.”
↩︎ Prediction“Network policies applied to a user override network policies applied to the account, but are overridden by a network policy applied to a security integration.”
↩︎ Checkpoint - 2.
“If TYPE=IPV4, by default the network rule controls access to the Snowflake service only.”
↩︎ Network rule TYPE and MODE“The TYPE property of the network rule must be AWSVPCEID.”
↩︎ Network rule TYPE and MODE“By default, only the ACCOUNTADMIN and SECURITYADMIN roles, along with the schema owner, have this privilege.”
↩︎ Network rule TYPE and MODE“Snowflake evaluates the combination of the PrivateLink ID and private IP, not the IP alone, to allow or block traffic.”
↩︎ Private endpoint rules and blocking public access“If TYPE=AWSVPCEID, TYPE=AZURELINKID, or TYPE=GCPPSCID, then the network rule controls access to the Snowflake service only.”
↩︎ Enforcing the same policy design on AWS, Azure and Google Cloud“Execute the SYSTEM$GET_PRIVATELINK_AUTHORIZED_ENDPOINTS function to retrieve the LinkID associated with an account.”
↩︎ Enforcing the same policy design on AWS, Azure and Google Cloud“IPv6 network rules only support the INGRESS mode and don’t protect internal stages.”
↩︎ Enforcing the same policy design on AWS, Azure and Google Cloud“A network rule does not define whether its identifiers should be allowed or blocked.”
↩︎ Key concept“For accounts on Microsoft Azure, you cannot use a network rule to restrict access to the internal stage.”
↩︎ Exam trap 3“the EGRESS mode indicates the network rule will be used with an external access integration to restrict outgoing requests”
↩︎ Exam trap 4“you must create a separate network rule by using the INTERNAL_STAGE mode.”
↩︎ Checkpoint“For accounts on Microsoft Azure, you cannot use a network rule to restrict access to the internal stage.”
↩︎ Checkpoint