Snowflake Security, RBAC, and User Administration · Topic 14 of 16
Private Connectivity, Internal Stages and the SQL API
Set up private endpoints for the Snowflake service and internal stages on AWS, Azure and Google Cloud, and secure and authenticate calls to the SQL API.
- 5 min
- Private connectivity needs Business Critical or higher on AWS, Azure and Google Cloud.
SYSTEM$AUTHORIZE_PRIVATELINK,SYSTEM$GET_PRIVATELINK,SYSTEM$GET_PRIVATELINK_CONFIGandSYSTEM$REVOKE_PRIVATELINKare run byACCOUNTADMIN.- Internal stages need
ENABLE_INTERNAL_STAGES_PRIVATELINK, an S3 interface endpoint in the same region and DNS for the bucket name.
What it is
Private connectivity keeps traffic between your cloud network and Snowflake off the public internet. It uses the cloud provider's own feature: AWS PrivateLink, Azure Private Link or Google Cloud Private Service Connect. It requires Business Critical edition or higher on all three clouds.
There are two separate paths to protect. The Snowflake service endpoint carries SQL, Snowsight and API traffic. The internal stage storage is the cloud bucket or container behind internal stages and carries file uploads and downloads. Each has its own endpoint and DNS setup.
The SQL API is a REST interface for running SQL. It has no connection of its own, so its security comes from authentication and the same network controls.
How it works
Authorizing the service endpoint
An ACCOUNTADMIN authorizes the cloud account that owns the endpoint, then creates the endpoint and DNS records.
| Cloud | Call that authorizes | Config value used to build the endpoint |
|---|---|---|
| AWS | SYSTEM$AUTHORIZE_PRIVATELINK('<aws_id>', '<federated_token>') | privatelink-vpce-id |
| Azure | SYSTEM$AUTHORIZE_PRIVATELINK('<endpoint resource id>', '<access token>') | privatelink-pls-id |
| Google Cloud | SYSTEM$AUTHORIZE_PRIVATELINK('<project id>', '<access token>') | Service attachment and URLs from the config output |
Three more functions complete the set:
SYSTEM$GET_PRIVATELINK_CONFIGreturns the endpoint values, URLs and the Snowsight and Marketplace private URLs that you need for DNS.SYSTEM$GET_PRIVATELINK(with the same arguments) verifies authorization.SYSTEM$REVOKE_PRIVATELINK(with the same arguments) turns it off.
DNS is part of the job. Create CNAME records that map the values from the config output to the endpoint, and check that they resolve to private IP addresses inside your network. A public address means the setup is wrong. Clients then use the account identifier with a .privatelink segment. On AWS, the OCSP cache server listens on port 80, so the endpoint security group must allow ports 80 and 443.
When a scenario says "authorization failed" or "token expired", remember the AWS federated token lives 12 hours and the Google access token one hour by default. Generate a new one and run the call again.
Private connectivity to internal stages (AWS)
Internal stage files live in a Snowflake-managed S3 bucket, so the service endpoint does not cover them. The setup is separate:
- An
ACCOUNTADMINenables the account parameterENABLE_INTERNAL_STAGES_PRIVATELINK. - Run
SYSTEM$GET_PRIVATELINK_CONFIGand read the internal stage value; the bucket name is its first segment. - The AWS administrator creates an S3 interface VPC endpoint in the same region as the Snowflake account.
- The network administrator maps
<bucket_name>.s3.<region>.amazonaws.comto the region-scoped endpoint DNS name.
For several Snowflake accounts, create one S3 endpoint per account and set S3_STAGE_VPCE_DNS_NAME on each account to its endpoint name. Cross-region endpoints are not supported for S3. Avoid wildcard DNS mappings, because they can affect other buckets.
Restricting who can reach the stage
Private connectivity opens a path; network rules decide who may use it. Enable ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES, define an INTERNAL_STAGE rule of type AWSVPCEID, and put it in the active network policy. When the parameter is on, the legacy IP lists are not used for stage access. Azure internal stages cannot use network rules; Azure Private Link can block public access instead.
Between clouds and regions
Each account connects privately through the cloud and region it runs in, using that cloud's feature. For internal stages on AWS, the S3 endpoint must be in the same region as the Snowflake account, because cross-region S3 endpoints are not supported. Cross-region PrivateLink is also unavailable in government regions and China. When you manage accounts on several clouds, repeat the authorize, endpoint and DNS steps for each account, since every account has its own endpoint values and its own cloud's mechanism.
Securing the SQL API
The SQL API accepts these credentials in the Authorization header, and the optional header X-Snowflake-Authorization-Token-Type names the type:
| Method | Token type value |
|---|---|
| OAuth | OAUTH |
| Key pair JWT | KEYPAIR_JWT |
| Programmatic access token | PROGRAMMATIC_ACCESS_TOKEN |
| Workload identity federation | WORKLOAD_IDENTITY_FEDERATION |
If the header is omitted, Snowflake works out the token type itself. For key pair authentication, the JWT carries iss (account, user and the SHA256: public key fingerprint, in uppercase), sub, iat and exp. A JWT is valid for at most one hour after it is issued, whatever exp you set.
Secure the API like any other client path: use a service user with a key pair or workload identity, limit the user with a network policy, grant a least-privilege role, and keep tokens out of source code.
Common mistakes
Assuming the service endpoint also covers internal stages. It does not; stages need their own endpoint, DNS mapping and parameter.
Leaving public DNS answers. If the private URL resolves to a public IP, traffic is not private.
Forgetting port 80 for OCSP on AWS. Certificate checks fail when only 443 is open.
Enabling stage rules without the enforcement parameter. An INTERNAL_STAGE rule has no effect until ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES is on.
Treating a long JWT lifetime as a setting. The one hour limit applies regardless of exp.
What to remember for the exam
- Private connectivity needs Business Critical or higher on AWS, Azure and Google Cloud.
SYSTEM$AUTHORIZE_PRIVATELINK,SYSTEM$GET_PRIVATELINK,SYSTEM$GET_PRIVATELINK_CONFIGandSYSTEM$REVOKE_PRIVATELINKare run byACCOUNTADMIN.- Internal stages need
ENABLE_INTERNAL_STAGES_PRIVATELINK, an S3 interface endpoint in the same region and DNS for the bucket name. - Control stage access with
INTERNAL_STAGEnetwork rules plusENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES. - SQL API auth: OAuth, key pair JWT, programmatic access token or workload identity federation; a JWT lasts at most one hour.
Check yourself
Which parameter must be enabled before the internal stage endpoint appears in the private connectivity configuration?
ENABLE_INTERNAL_STAGES_PRIVATELINK.Which function returns the values needed to build the private endpoint and DNS records?
SYSTEM$GET_PRIVATELINK_CONFIG.What is the longest lifetime of a JWT used with the SQL API?
One hour after it is issued, regardless of the
expvalue.
Topic 14 of 16 in Snowflake Security, RBAC, and User Administration
Test yourself on Snowflake Security, RBAC, and User Administration
The full Snowflake ADA-C02 question bank has 814 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Snowflake. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.