What you will be able to do
- Authorize AWS PrivateLink, Azure Private Link or Google Cloud Private Service Connect for the Snowflake service
- Set up private endpoints for internal stages on AWS and Azure, including the DNS changes
- Block public access to internal stages with the right mechanism for each cloud
- Choose an authentication method for the Snowflake SQL API and explain which network controls apply to its calls
1.Private connectivity to the Snowflake service
Traffic to Snowflake goes over the public internet unless you route it through a private IP address in your own VPC or VNet. That private path uses whatever your cloud provides: AWS PrivateLink, Azure Private Link or Google Cloud Private Service Connect. After it is set up, users sign in over the private path, and the same approach extends to Snowsight, Streamlit in Snowflake and internal stages. Private connectivity only covers inbound traffic, meaning requests from your network to Snowflake. It is not for connections Snowflake makes outward.
Setup starts with an ACCOUNTADMIN calling SYSTEM$AUTHORIZE_PRIVATELINK, which enables private connectivity to the service for the current account. The arguments depend on the cloud. On AWS, the federated token comes from aws sts get-federation-token and expires after 12 hours. If it expires, generate a new one before you call any of the authorize, verify or revoke functions again.
| Cloud | First argument | Second argument | Credential comes from |
|---|---|---|---|
| AWS | '<aws_id>' (12-digit AWS account ID) | '<federated_token>' | aws sts get-federation-token --name sam |
| Azure | '<private-endpoint-resource-id>' | '<federated_token>' | az account get-access-token --subscription <SubscriptionID> |
| Google Cloud | '<gcp_project_id>' | '<access_token>' | Access credentials for a Google Cloud user |
On AWS the steps continue in your own VPC:
- Call
SYSTEM$GET_PRIVATELINK_CONFIGas ACCOUNTADMIN and note theprivatelink-vpce-id. - Create a VPC endpoint against that value.
- Allow ports 443 and 80 of the VPCE CIDR in a security group.
- Create CNAME records in your DNS for the URLs the same function returns, such as
privatelink-account-url.
SYSTEM$GET_PRIVATELINK confirms the setup by returning "Account is authorized for PrivateLink." SYSTEM$REVOKE_PRIVATELINK, called with the same arguments, disables it. If your VPC is in a different region from your Snowflake account, enable a cross-region endpoint in the AWS console. Snowflake doesn't configure your VPC endpoints, security groups or DNS records for you. AWS Support handles problems with those.
Checkpoint 1 of 5· Check yourself
A company's Snowflake account is hosted on Microsoft Azure. Security wants users' connections to the Snowflake service to stop crossing the public internet. What should the team set up?
Private connectivity sends inbound traffic through a private IP address in your own VPC or VNet, using the private connectivity service of the cloud that hosts the account. On Azure, that service is Azure Private Link. An IPv4 network policy only restricts which public addresses can connect, and EGRESS rules control outbound traffic from Snowflake, not inbound traffic to it.
“These connections use AWS PrivateLink, Azure Private Link, or Google Cloud Private Service Connect.”Source: docs.snowflake.com
2.Private endpoints for internal stages on AWS
PrivateLink to the service does not cover the internal stage. Stage files live in an Amazon S3 bucket, and reaching it privately needs an S3 interface endpoint from AWS PrivateLink for S3. Once that is in place, loads and unloads stay on the AWS network and you no longer need the proxy farm customers used before. Each internal stage deployment has one bucket, and each Snowflake account has its own prefix in it. Private access uses a different URL form: <bucket_name>.<vpceID>.s3.<region>.vpce.amazonaws.com/prefix.
The setup needs three people: the Snowflake account administrator, the AWS administrator and the network administrator.
- The Snowflake administrator runs
ALTER ACCOUNT SET ENABLE_INTERNAL_STAGES_PRIVATELINK = true;and then reads theprivatelink_internal_stagevalue fromSYSTEM$GET_PRIVATELINK_CONFIG. The S3 bucket name is the first segment of that URL. - The AWS administrator creates the S3 interface endpoint. In its VPCE DNS name, they replace the leading
*with the bucket name, using the regional name and not a zonal one. - The network administrator makes
<bucket_name>.s3.<region>.amazonaws.comresolve to that name and checks the result withdig, which should return a private IP.
Two constraints catch people out. First, AWS has no cross-region interface endpoints for S3, so the stage endpoint must be in the same region as the Snowflake account, even if the service endpoint is cross-region. Second, wildcard DNS mappings could redirect traffic to S3 buckets outside Snowflake, so map the exact bucket host only. AWS PrivateLink for S3 also doesn't support FIPS endpoints, which matters for SnowGov regions. If you access the stages of several accounts, use dedicated interface endpoints, one per stage.
Checkpoint 2 of 5· Check yourself
Your Snowflake account is hosted in AWS us-east-1. Your client VPC is in eu-west-1 and already reaches the Snowflake service through a cross-region PrivateLink endpoint. You now want PUT and GET traffic to the internal stage to stay private too. What do you need to set up?
Stage files live in an S3 bucket, and reaching that bucket privately needs its own S3 interface endpoint. AWS doesn't support cross-region interface endpoints for S3, so this endpoint must be in the Snowflake account's region even when the service endpoint is cross-region. The service endpoint does not cover the stage, and wildcard DNS mappings are discouraged because they can redirect traffic to S3 buckets outside Snowflake.
“your VPC interface endpoint must be located in the same region as your Snowflake account to provide inbound connectivity”Source: docs.snowflake.com
Sources4
3.Private endpoints for internal stages on Azure
On Azure, each Snowflake account has its own storage account as its internal stage. That is different from AWS, where accounts share a bucket with separate prefixes. Over Private Link, the storage URI changes from <storage_account_name>.blob.core.windows.net to <storage_account_name>.privatelink.blob.core.windows.net. Several private endpoints, each in a different VNet, can point at the same stage, but each private endpoint talks to only one Snowflake service endpoint.
The steps, again split between the Snowflake, Azure and network administrators:
- Confirm that the Azure subscription is registered with the Azure Storage resource manager.
- Set
ENABLE_INTERNAL_STAGES_PRIVATELINK = trueand read the storage account ResourceID from theprivatelink_internal_stagekey. - Create a private endpoint in the Azure portal with Target sub-resource
blob, and record its resource ID. - As ACCOUNTADMIN, call
SYSTEM$AUTHORIZE_STAGE_PRIVATELINK_ACCESS('<privateEndpointResourceID>').SYSTEM$GET_STAGE_PRIVATELINK_AUTHORIZED_ENDPOINTSlists the authorized endpoints and their approval status. - In a private DNS zone, make the
privatelinkblob URL resolve to the endpoint's private IP addresses.
Be careful with DNS when you authorize the first endpoint. Azure then publishes a public CNAME for storage-account-name.privatelink.blob.core.windows.net. If your network already has private DNS zones for .privatelink.blob.core.windows.net, existing clients can stop resolving the public storage endpoint. Microsoft's fix is to enable Fallback to Internet in the private DNS zone before authorizing. Google Cloud has its own setup using Private Service Connect endpoints for internal stages.
Checkpoint 3 of 5· Put it in order
Your Snowflake account runs on Azure, and you want PUT and GET traffic to its internal stage to go over Azure Private Link. Put the setup steps in the order the procedure requires.
- 1.Confirm that the Azure subscription is registered with the Azure Storage resource manager
- 2.In the Azure portal, create a private endpoint with Target sub-resource blob and record its resource ID
- 3.In a private DNS zone, resolve <storage_account_name>.privatelink.blob.core.windows.net to the private endpoint's private IP addresses
- 4.Call SYSTEM$AUTHORIZE_STAGE_PRIVATELINK_ACCESS with the private endpoint's resource ID
- 5.As ACCOUNTADMIN, set ENABLE_INTERNAL_STAGES_PRIVATELINK = true and record the storage account ResourceID from the privatelink_internal_stage key
The private endpoint is created against the storage account ResourceID that Snowflake returns, so it comes after you enable the parameter. Its resource ID is then the argument to the authorize function. Once the endpoint is authorized, DNS is updated so the privatelink blob URL resolves to the endpoint's private IP addresses.
“View the private endpoint properties and record the resource ID value. You will provide this value as the privateEndpointResourceID function argument in the next step.”Source: docs.snowflake.com
Sources5
4.Blocking public access to internal stages
A private endpoint doesn't stop public traffic on its own, and each cloud closes the public path to the stage differently. On AWS you use network rules. An account administrator enables ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES. After that, IPv4 INGRESS rules protect the stage as well as the service, and a separate INTERNAL_STAGE rule of type AWSVPCEID can restrict the stage to particular interface endpoints. The network rule and policy evaluation mechanics are the same as for the service.
On Azure you call SYSTEM$BLOCK_INTERNAL_STAGES_PUBLIC_ACCESS() as ACCOUNTADMIN, and it can take a few minutes. The function changes the storage account's firewall. It sets Public network access to selected networks, adds Snowflake's VNet subnets and clears every IP from the Firewall section. It works on Azure only, and you can't choose which public addresses it blocks: every public IP is cut off. If you need exceptions, SYSTEM$BLOCK_INTERNAL_STAGES_PUBLIC_ACCESS_WITH_EXCEPTION blocks public access while keeping an allowlist. Each call replaces the previous allowlist, so always pass the full list. SYSTEM$INTERNAL_STAGES_PUBLIC_ACCESS_STATUS shows the current state, and SYSTEM$UNBLOCK_INTERNAL_STAGES_PUBLIC_ACCESS undoes the change.
USE ROLE ACCOUNTADMIN;
SELECT SYSTEM$BLOCK_INTERNAL_STAGES_PUBLIC_ACCESS_WITH_EXCEPTION('100.0.0.1', '1.2.3.0/24', '101.0.0.0/31');Before you block anything, confirm that private traffic actually reaches the stage. If you block first, loads fail, and managed services such as Azure Data Factory can break. A policy attached to a security integration is no help here either, because integration-level policies never restrict access to an internal stage.
Checkpoint 4 of 5· Check yourself
On an AWS-hosted account, an administrator has enabled ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES. They now want only one S3 interface endpoint to be able to reach the internal stage, and they don't want to change who can reach the Snowflake service. What should they add to the network policy?
An INGRESS rule of type AWSVPCEID protects only the Snowflake service. To limit the stage to specific interface endpoints, you need a separate rule in INTERNAL_STAGE mode, and that mode accepts only the AWSVPCEID type. SYSTEM$BLOCK_INTERNAL_STAGES_PUBLIC_ACCESS works only on Azure.
“based on the VPCE ID of an interface endpoint, you must create a separate network rule by using the INTERNAL_STAGE mode”Source: docs.snowflake.com
5.Securing calls to the Snowflake SQL API
The SQL API is a REST API for submitting statements, checking their status and cancelling them, and every request must include authentication information. It accepts OAuth, key-pair authentication and workload identity federation. In all three, the token goes in an Authorization: Bearer header. An optional X-Snowflake-Authorization-Token-Type header names the token type: KEYPAIR_JWT, OAUTH or PROGRAMMATIC_ACCESS_TOKEN. If you leave it out, Snowflake works out the type from the token.
The choice of method depends on who calls the API.
- OAuth suits an application acting for users. It relies on a security integration, set up as described in Snowflake OAuth and External OAuth.
- Key-pair suits a backend job. You sign a JWT whose issuer is
ACCOUNT.USER.SHA256:<fingerprint>(uppercase account and user), and the JWT is valid for at most one hour whatever expiry you set. - Workload identity federation suits a workload on AWS, Azure, Google Cloud or Kubernetes. It sends a token from its own provider instead of keeping a Snowflake secret.
Network controls apply to API calls the same way they apply to other connections. A call reaches the Snowflake service as a Snowflake user, so the account policy covers it, and a policy on that user replaces the account policy. If the application uses Snowflake OAuth, a policy on the OAuth security integration restricts the requests that try to authenticate. It overrides both the user and account policies, and remember that the user-level policy isn't checked on OAuth token requests. To keep API traffic off the public internet, send it to the account's private connectivity URL (privatelink-account-url from SYSTEM$GET_PRIVATELINK_CONFIG). Then use an endpoint-ID rule plus a blocked 0.0.0.0/0 rule so that only the private path is accepted.
Checkpoint 5 of 5· Check yourself
A nightly backend job authenticates to the SQL API with key-pair authentication. Its code sets the JWT's expiration time to 24 hours after issue. How long will Snowflake accept that JWT?
A key-pair JWT is capped at one hour from issue, even when the payload asks for longer, so a long-running job has to generate a fresh token rather than rely on a longer expiry.
“The JWT is valid for at most one hour after the token is issued, even if you specify a longer expiration time.”Source: docs.snowflake.com
Sources
(9)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“These connections use AWS PrivateLink, Azure Private Link, or Google Cloud Private Service Connect.”
↩︎ Private connectivity to the Snowflake service - 2.
“Enables private connectivity to the Snowflake service for the current account.”
↩︎ Private connectivity to the Snowflake service - 3.
“The federated token expires after 12 hours.”
↩︎ Private connectivity to the Snowflake service“call the SYSTEM$GET_PRIVATELINK_CONFIG function, and then record the privatelink-vpce-id value.”
↩︎ Private connectivity to the Snowflake service - 4.
“There is a single Amazon S3 bucket per internal stage deployment.”
↩︎ Private endpoints for internal stages on AWS“Do not use wildcard characters (i.e. *) with DNS mapping”
↩︎ Private endpoints for internal stages on AWS“your VPC interface endpoint must be located in the same region as your Snowflake account”
↩︎ Exam trap 2“your VPC interface endpoint must be located in the same region as your Snowflake account to provide inbound connectivity”
↩︎ Checkpoint - 5.
“In Azure, each Snowflake account has a dedicated storage account to use as an internal stage.”
↩︎ Private endpoints for internal stages on Azure“This step authorizes access to the Snowflake internal stage through the private endpoint.”
↩︎ Private endpoints for internal stages on Azure“Microsoft recommends enabling the Fallback to Internet option in the private DNS zone configuration before authorizing the first private endpoint.”
↩︎ Private endpoints for internal stages on Azure“Confirm that traffic using private connectivity is successfully reaching the internal stage before blocking public access.”
↩︎ Blocking public access to internal stages“Unlike network policies, this function can’t block some public IP addresses while allowing others.”
↩︎ Exam trap 1“View the private endpoint properties and record the resource ID value. You will provide this value as the privateEndpointResourceID function argument in the next step.”
↩︎ Checkpoint - 6.
“Controls access to an AWS internal stage without restricting access to the Snowflake service.”
↩︎ Blocking public access to internal stages“For accounts on Microsoft Azure, you cannot use a network rule to restrict access to the internal stage.”
↩︎ Prediction“based on the VPCE ID of an interface endpoint, you must create a separate network rule by using the INTERNAL_STAGE mode”
↩︎ Checkpoint - 7.
“A network policy that is activated for a security integration does not restrict access to an internal stage.”
↩︎ Blocking public access to internal stages“The network policy would restrict the access of requests trying to authenticate.”
↩︎ Securing calls to the Snowflake SQL API - 8.
“When you send a request, the request must include authentication information.”
↩︎ Securing calls to the Snowflake SQL API“If you omit the X-Snowflake-Authorization-Token-Type header, Snowflake determines the token type by examining the token.”
↩︎ Securing calls to the Snowflake SQL API“The JWT is valid for at most one hour after the token is issued, even if you specify a longer expiration time.”
↩︎ Securing calls to the Snowflake SQL API - 9.
“Use this value to create a canonical name (i.e. CNAME) for DNS resolution.”
↩︎ Securing calls to the Snowflake SQL API