Skip to content
Fixedmark

Databases · 11 min read

Updated

Snowflake Network Policy With a Static IP

Snowflake allowlists IPs with a network policy that references network rules of `TYPE = IPV4`. Attach the policy to a service user, not the whole account, so only that user is limited to your fixed IPs. Then send the driver's HTTPS traffic through a proxy or NAT with a static egress IP, and check the result with `select current_ip_address()`.

On this page

How Snowflake decides who can connect

A Snowflake network policy controls which source addresses can reach the service. Current policies do not hold IP addresses themselves. They point at network rules, and each rule groups identifiers of one type. A rule with TYPE = IPV4 and MODE = INGRESS holds IPv4 addresses and CIDR ranges.

A policy has two lists. ALLOWED_NETWORK_RULE_LIST names the rules that admit traffic. BLOCKED_NETWORK_RULE_LIST names the rules that refuse it. Once a policy allows any IPv4 rule, every other IPv4 address is refused, so you rarely need a blocked list. An address that appears in both lists is blocked.

Older policies used the ALLOWED_IP_LIST and BLOCKED_IP_LIST parameters directly. They still work. Snowflake asks you to use network rules for new policies and not to mix both methods in one policy.

Three facts catch people out.

  • A policy does nothing until you activate it on the account, a user, or a security integration.
  • A policy with no rules at all blocks every IPv4 address.
  • Network rules are schema objects, so you need a database and schema to hold them. Network policies are account objects.

Snowflake sees one address per connection, the public source IP of the TCP connection that reaches <account>.snowflakecomputing.com. If your code goes through a NAT gateway or a proxy, that address belongs to the NAT or the proxy, not to your function or laptop.

Account, user, or integration level

You can attach a policy at three levels. When more than one applies, the most specific one wins. A security integration policy overrides the user policy, and a user policy overrides the account policy. The policies do not combine. A user with its own policy ignores the account policy entirely.

Where to attach a Snowflake network policy
LevelCommandWho it limitsUse it for
AccountALTER ACCOUNT SET NETWORK_POLICY = pEvery user without a more specific policy, including people in SnowsightAn office or VPN range that all humans come from
UserALTER USER u SET NETWORK_POLICY = pThat one userService users for ETL, dbt, and app backends
Security integrationALTER SECURITY INTEGRATION i SET NETWORK_POLICY = pClients of that SCIM or OAuth integrationA BI tool or identity provider that has its own IPs

For a job or a backend, the user level is usually right. Put your fixed egress IPs in a policy, attach it to the service user that job logs in as, and leave the account policy for your people. If you put the job's IPs in the account policy instead, every analyst in Snowsight is either blocked or added to the same list, and the list grows into something nobody can audit.

Snowflake protects you from one mistake. Activating an account-level policy fails if your current IP is not allowed, or if it is blocked. The docs describe that check for the account level only, so test a user policy on a test user before you attach it to the real one.

For Snowflake OAuth, Snowflake does not apply the user-level policy to client token requests. Only the integration and account policies apply there. Read the precedence section of the network policy docs if you use OAuth integrations.

Why service users now need a network policy

Two changes push anything that runs without a person toward a network policy.

First, Snowflake is removing password-only sign-in. Its MFA rollout put the last phase in August to October 2026, rolling per account. In that phase non-human users lose password authentication and LEGACY_SERVICE users become TYPE = SERVICE. Dates can vary for your account, and the Strong Authentication Hub in Snowsight shows yours. A job that logged in with a password must move to key pair authentication, a programmatic access token, OAuth, or workload identity federation.

Second, programmatic access tokens require a network policy by default. A service user can only generate or use a token if it is subject to a network policy with one or more network rules. A person can generate one without a policy but cannot authenticate with it until a policy applies. An authentication policy can relax this with NETWORK_POLICY_EVALUATION, but the default is ENFORCED_REQUIRED.

So a token in a Lambda function only works if Snowflake can name the IPs that function calls from. It is tempting to satisfy the rule with a policy that allows 0.0.0.0/0, which defeats the point. The section on serverless jobs below covers better options.

The history matters too. In 2024, Mandiant investigated a campaign that used stolen credentials against Snowflake customers. Mandiant and Snowflake notified about 165 organizations. One of the three factors it listed was that the affected accounts had no network allow lists to limit access to trusted locations. A leaked key or token is much less useful to an attacker when it only works from two addresses you control.

Create the rule and attach the policy

This example locks one service user to a pair of egress IPs. Replace 203.0.113.10 and 203.0.113.11 with your own. A bare address in VALUE_LIST means that one address. You need a role that can create network rules in the schema and network policies in the account. The script uses ACCOUNTADMIN, which can do both.

Terminal
# Key pair for the service user (from Snowflake's key pair docs)
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 aes-256-cbc -inform PEM -out rsa_key.p8
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
setup.sql
USE ROLE ACCOUNTADMIN;

-- Network rules live in a schema
CREATE DATABASE IF NOT EXISTS security_db;
CREATE SCHEMA IF NOT EXISTS security_db.network;

CREATE NETWORK RULE security_db.network.etl_egress
  TYPE = IPV4
  MODE = INGRESS
  VALUE_LIST = ('203.0.113.10', '203.0.113.11')
  COMMENT = 'Fixed egress pair for ETL jobs';

-- Network policies are account objects
CREATE NETWORK POLICY etl_only
  ALLOWED_NETWORK_RULE_LIST = ('security_db.network.etl_egress')
  COMMENT = 'Service users that run from the fixed egress pair';

-- Paste rsa_key.pub without the BEGIN and END lines
CREATE USER etl_svc
  TYPE = SERVICE
  DEFAULT_ROLE = transformer
  DEFAULT_WAREHOUSE = transform_wh
  RSA_PUBLIC_KEY = 'MIIBIjANBgkqh...'
  NETWORK_POLICY = etl_only;

GRANT ROLE transformer TO USER etl_svc;

-- Existing user instead:
-- ALTER USER etl_svc SET NETWORK_POLICY = etl_only;

To change the addresses later, edit the rule, not the policy. CREATE OR ALTER NETWORK RULE can replace the VALUE_LIST of an existing rule, and every policy that references it picks up the change. ALTER NETWORK POLICY etl_only ADD ALLOWED_NETWORK_RULE_LIST = (...) adds a second rule, which is a clean way to run old and new IPs side by side during a migration.

Allow both addresses of a pair from day one. If your egress fails over from one IP to the other and only the first is listed, every connection after the failover is refused. The post on static IP pairs and failover explains why there are two.

Find out which IP Snowflake sees

When a policy refuses a client, drivers show a message like the one in this Microsoft Q&A thread. The IP in the message is the address Snowflake received, which is the fastest way to see what your traffic really leaves from.

Driver error
Incoming request with IP/Token XX.XX.XXX.XX is not allowed to access Snowflake. Contact your account administrator.

Once a connection works, ask Snowflake directly. CURRENT_IP_ADDRESS returns the IPv4 address of the client that sent the request. If it shows one of your fixed IPs, the route is right.

check.sql
-- From the client you are testing
SELECT CURRENT_IP_ADDRESS();

-- Which policy applies to the user and the account
SHOW PARAMETERS LIKE 'NETWORK_POLICY' IN USER etl_svc;
SHOW PARAMETERS LIKE 'NETWORK_POLICY' IN ACCOUNT;
DESCRIBE NETWORK POLICY etl_only;

-- Recent failed logins, last 7 days, no view latency
SELECT event_timestamp, client_ip, reported_client_type, error_code, error_message
FROM TABLE(information_schema.login_history_by_user(
  USER_NAME => 'ETL_SVC', RESULT_LIMIT => 100))
WHERE is_success = 'NO'
ORDER BY event_timestamp DESC;

The information_schema table function covers the last 7 days. For older events, query SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY, which keeps 365 days but can lag by up to two hours. Third-party docs such as Coalesce's error library report that blocked logins show code 390422 with INCOMING_REQUEST_BLOCKED. We did not find that pairing in Snowflake's own docs, so match on the IP and the message rather than the code alone.

If the IP in the error is an IPv6 address, your client reached Snowflake over IPv6. Snowflake evaluates IPv4 and IPv6 rules separately, and IPv6 rules are an AWS-only feature that needs IPv6 ingress enabled on the account. Most fixed egress setups are IPv4, so force IPv4 in the client. See IPv6 egress and IPv4-only allowlists.

Connect dbt, Python, and Node through a proxy

Snowflake drivers talk HTTPS on port 443, so an ordinary HTTP CONNECT proxy works and you do not need SOCKS5. The driver opens a tunnel through the proxy and runs TLS with Snowflake inside it, so the proxy never sees queries or results. The post on HTTP CONNECT shows the bytes.

Snowflake does not allow TLS-intercepting proxies that re-sign traffic with their own certificate. A CONNECT proxy that passes TLS through is fine, because the driver still checks Snowflake's real certificate.

Python connector

The Python connector reads HTTP_PROXY, HTTPS_PROXY, and NO_PROXY by default. It also takes proxy_host, proxy_port, proxy_user, and proxy_password as connection parameters, or a single proxy URL. From version 5.0 the parameters override the environment. Before 5.0 the environment won. Setting HTTPS_PROXY in the job's environment works on both, so the example uses it.

# pip install "snowflake-connector-python>=5.0"
# (Before 5.0 the passphrase argument was private_key_file_pwd.)
# Set in the job environment, not in code:
#   HTTPS_PROXY=<your proxy URL>
import os
import snowflake.connector

conn = snowflake.connector.connect(
    account=os.environ["SNOWFLAKE_ACCOUNT"],  # e.g. myorg-myaccount
    user="ETL_SVC",
    authenticator="SNOWFLAKE_JWT",
    private_key_file=os.environ["SNOWFLAKE_KEY_PATH"],
    private_key_password=os.environ["SNOWFLAKE_KEY_PASSPHRASE"],
    warehouse="TRANSFORM_WH",
)
cur = conn.cursor()
cur.execute("select current_ip_address()")
print(cur.fetchone())
conn.close()

In Node, the snowflake-sdk connection options win over the environment, which makes per-connection config the safer choice. Note the port fallback. new URL() drops a default port, so https://...:443 parses with an empty port. With proxyProtocol set to https, the SDK opens TLS to the proxy itself, so the proxy password never crosses the network in clear text.

dbt Core

dbt-snowflake uses the Python connector, so the same environment variables apply. Keep the key in a file and read paths from the environment.

profiles.yml
analytics:
  target: prod
  outputs:
    prod:
      type: snowflake
      account: "{{ env_var('SNOWFLAKE_ACCOUNT') }}"
      user: ETL_SVC
      private_key_path: "{{ env_var('SNOWFLAKE_KEY_PATH') }}"
      private_key_passphrase: "{{ env_var('SNOWFLAKE_KEY_PASSPHRASE') }}"
      role: TRANSFORMER
      warehouse: TRANSFORM_WH
      database: ANALYTICS
      schema: MARTS
      threads: 8
Terminal
export HTTPS_PROXY="$PROXY_URL"
dbt debug --target prod
dbt build --target prod

Stage traffic and NO_PROXY

Drivers do not only talk to the account host. PUT and GET move files to and from cloud storage, and SYSTEM$ALLOWLIST lists those STAGE hosts for your account. An INGRESS IPv4 rule protects the Snowflake service. It only covers AWS internal stages when an admin sets ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES. If you do not enforce that, you can keep storage traffic off the proxy and save bandwidth. Snowflake's Python docs give NO_PROXY=.amazonaws.com as the example for S3. If you do enforce it, storage traffic must leave from the allowlisted IPs too.

Serverless jobs, CI, and hosted dbt

Lambda, Cloud Run, Vercel Functions, and most PaaS platforms send outbound traffic from shared addresses that change. The post on why serverless egress IPs change covers each one. You have three ways to give such a job a name Snowflake can allowlist.

  • Put the job in a VPC with a NAT gateway and an Elastic IP. This is the standard AWS answer, but it bills per hour, per GB, and per public IPv4 address. Run the numbers with the NAT gateway cost calculator.
  • Use your platform's paid static IP add-on where one exists, and allowlist the addresses it gives you.
  • Send only the Snowflake connection through a static IP proxy, using the driver options above. This needs no network changes in the platform, and the rest of the function keeps its normal egress.

Watch HTTPS_PROXY in a function that also calls other services. It applies to every client that reads the environment, including the AWS SDK. Prefer per-connection options where the driver has them, or list the other hosts in NO_PROXY. The post on NO_PROXY and per-client agents covers how each runtime parses those variables.

Reuse sessions across invocations. A cold start that opens a new Snowflake session pays for authentication plus the extra hop. Create the connection at module scope so warm invocations reuse it.

GitHub-hosted runners have the same problem as functions, and allowlisting GitHub's published ranges admits every other runner on them. Deploys from GitHub Actions to allowlisted servers covers the options there.

Hosted dbt is a different case. The dbt platform publishes IP addresses per region for multi-tenant accounts, and you allowlist those for its users. The same page says the addresses can change occasionally. Multi-tenant means other dbt customers likely send traffic from them too, so that rule trusts dbt's platform, not your project. That may be a fine trade, but make it on purpose. The post on cloud IP ranges explains why a shared range is weaker than an address only you use.

Doing this with Fixedmark

Fixedmark gives an app a pair of static outbound IPv4 addresses and one proxy URL. It is in early access and not generally available yet. For Snowflake, put both addresses of the pair in the network rule's VALUE_LIST, then point the driver at the proxy URL.

  1. 1
    Get the pair and the URLCreate an app and a token, and note the app's two IPs. Copy the token when you create it, since Fixedmark stores only a hash. The proxy URL looks like https://APP_ID:TOKEN@mum.egress.fixedmark.com:443. Store it as the secret FIXEDMARK_PROXY_URL, URL-encoding the token if it contains @, :, or /.
  2. 2
    Allowlist both IPsPut both addresses in the etl_egress rule from the setup script, and attach the policy to the service user.
  3. 3
    Point the driver at the proxySet HTTPS_PROXY=$FIXEDMARK_PROXY_URL for the Python connector and dbt, or parse FIXEDMARK_PROXY_URL into the snowflake-sdk proxy options in Node. Port 443 is TLS to the proxy, so the token stays encrypted on the way. Avoid the plain 8080 and 1080 endpoints, which send it in cleartext.
  4. 4
    Verify from SnowflakeRun select current_ip_address() and confirm it returns one of the pair. The egress verification guide has checks you can run before Snowflake is involved.

TLS passes through end to end, so Fixedmark sees the destination host, byte counts, and timing, but not your SQL or results. Each connection appears in the connection logs with its destination and egress IP, which helps when a login is refused and you need to know which address it used. Pick the region closest to your Snowflake account, not to your app, to keep the extra hop short.

On plans with destination allowlists, restrict the token to your account host on port 443, for example myorg-myaccount.snowflakecomputing.com, so a leaked token cannot reach anything else. Add your stage hosts too if storage traffic goes through the proxy. Anything else sent through HTTPS_PROXY will then be refused, which is another reason to scope the proxy to the Snowflake connection.

The trial and the Starter plan run on a shared IP pair. Other Fixedmark customers in the same region send traffic from those addresses, so do not put them in a production network policy. A dedicated pair starts with the Pro plan. See pricing for the planned launch prices.

Sources

Checked November 2026. Confirm current details on the vendor's site before you decide. Prices and limits change.

Blog

Frequently asked questions

Does a user-level network policy add to the account policy?

No. The most specific policy wins. A user with its own policy is checked only against that policy, and the account policy is ignored for that user. A security integration policy overrides both.

Can I lock myself out of Snowflake with a network policy?

Snowflake refuses to activate an account-level policy that does not allow your current IP. Its docs describe that check for the account level only, so test a user policy on a test user first. If you are locked out, only Snowflake Support can set a temporary bypass.

Do I need SOCKS5 to reach Snowflake through a proxy?

No. Snowflake drivers use HTTPS on port 443, so an HTTP CONNECT proxy works. The Python connector reads HTTPS_PROXY, and the Node.js snowflake-sdk takes proxyHost, proxyPort, proxyUser, proxyPassword, and proxyProtocol.

Why does a programmatic access token fail when the password worked?

By default a service user can only generate or use a programmatic access token while a network policy with at least one network rule applies to it. Attach a policy that allows your job's fixed IPs, rather than relaxing the requirement.

Should I allowlist 0.0.0.0/0 to make a token work?

It satisfies the token requirement but removes the network check, so a stolen token works from anywhere. Give the job a fixed egress IP and allowlist that instead.

Make it fixed.

Fixedmark is in early access. Join the list to get dedicated static IPs when your region opens.