Contents#
- November 2026 update: what changed
- Introduction
- Snowflake Container Services Security Overview
- Data Governance and Security in One Platform
- Snowpark Container Services Security Architecture
- SPCS Controllers Security
- SPCS Compute Pools Security
- SPCS Service Security
- SPCS Image Registry Security
- SPCS Auditing and Monitoring (event tables, structured logging, metrics, alerting)
- SPCS Communication Security
- Tunneling Into and Out of SPCS (including Data Connectivity Proxy)
- Conclusion
November 2026 update: what changed#
This guide first went out in April 2026. Snowflake has shipped a lot since then, and a few things in the original were wrong or have gone stale. If you read the first version, these are the changes that matter:
- Any role can now publish public endpoints. Since a rollout that started on 18 May 2026,
BIND SERVICE ENDPOINTon the account is granted toPUBLICautomatically. If you relied on that privilege as an ingress control, revoke it fromPUBLIC(see SPCS Service Security). - Service-to-service access works through service roles. Services with different owner roles can call each other directly when one is granted a service role for the other’s endpoint; no public endpoint is needed. The original version got this wrong (see Service to Service).
- Service DNS names now look like
<service-name>.<hash>.svc.spcs.internal, not<service>.<schema>.<db>.snowflakecomputing.internal. - Caller’s rights needs caller grants, and
executeAsCallersits under a top-levelcapabilitiesfield, not inside a container (see Caller Identity Passthrough). - Stable egress IPs come from
SYSTEM$GET_SNOWFLAKE_EGRESS_IP_RANGES(), rotate on a schedule, and are available on AWS and Azure but not Google Cloud (see Stable Egress IP Addresses). - Maintenance windows are overnight weekend windows, and single-instance services and running jobs are disrupted (see Compute Pools).
- Block storage now runs on all three clouds with much higher limits, and deleted volumes are snapshotted rather than kept (see Block Storage).
- Image repositories can use
SNOWFLAKE_FULLencryption, which supports Tri-Secret Secure (see image registry encryption). - New: Data Connectivity Proxy, Snowflake’s own outbound-only tunnel; session token configuration; the
statusmetric group; and thenetwork.egress.denied.packetssignal for blocked egress. - Removed: the claim that you can configure mTLS for egress inside an External Access Integration. I couldn’t find any Snowflake documentation for it.
Introduction#
Snowpark Container Services (SPCS) is a fully managed container runtime that enables developers to deploy, manage, and scale containerized workloads – jobs, services, service functions – on secure Snowflake-managed infrastructure with configurable hardware options including GPUs. This article focuses on how Snowflake hardens container deployments: compute isolation, storage encryption, communication security, and the governance model that keeps data within Snowflake’s security boundary. The questions it works through (isolation, workload identity, ingress, egress allowlists, tunnels) are the ones to ask of any data platform that runs customer containers; Snowflake is where I answer them. For a comprehensive overview of the capability, see the SPCS documentation and tutorials.
Snowpark Container Services is a container service that was built to simplify the overall deployment process. It introduces and reuses vocabulary that maps to the standard Kubernetes vocabulary.
NOTE: Most simple Kubernetes workloads that do not deal with the orchestration layer will run as-is on top of Snowpark Container Services.
Table 1 – Snowpark Vocabulary Mapping with Kubernetes#
| Snowpark | Kubernetes | Definition |
|---|---|---|
| Node | Node / Worker | SPCS defines compute pools that have similar nodes |
| Container | Container | Same definition as standard containers |
| Controller | Controller | Same as Kubernetes, with one exception: fully managed by Snowflake – customers have no access to the controllers |
| Cluster | Cluster | Same as Kubernetes: compute pools + controllers |
| Image Registry | Image Registry | OCI v2 compliant service. Fully provisioned and managed by Snowflake. Customers interact using standard Docker client or SnowCLI |
| Service | Deployment + network spec | Represents overall specifications: containers list, mounted volumes, endpoints, images, resources, and the compute pool to use. Long-running workloads that do not terminate automatically |
| Service Instance | Pod | An instance that runs on a single node. Min/max instances control autoscaling |
| Job Service | N/A | A service that runs to completion and then stops, similar to a stored procedure |
Parallel job (REPLICAS = n) | N/A | Not a separate type: EXECUTE JOB SERVICE … REPLICAS = n runs n instances of a job in parallel; each instance sees SNOWFLAKE_JOBS_COUNT and SNOWFLAKE_JOB_INDEX |
| Service Function | N/A | A UDF linked to a service endpoint, used to call a service from SQL inside your Snowflake account |
Snowflake Container Services Security Overview#
This Snowpark runtime is built with two main pillars:
- Security is Paramount: The out-of-the-box security model meets the Snowflake high security standard.
- Ease of Use: Most modern container service infrastructure can be very complicated to build and maintain. Snowpark Container Services hides this complexity by providing a unique user experience where developers can focus on building applications and enabling their critical business functions without the hassle of managing the infrastructure.
By building and offering a fully managed container service natively integrated with Snowflake governance and security, Snowflake delivers ease of use and security together. The following layers are provided with the necessary security controls:
- Container Registry: Snowflake provisions and maintains the image registry infrastructure including networking, load balancing, storage OS updates, and security patches transparently.
- Storage: Any related storage such as image registry storage, container mounted volumes, and block storage volumes are provisioned and secured by Snowflake. Any data stored in the Snowflake account is protected by Snowflake data security and the data governance capabilities built into the platform. Learn more about integrated security and governance with Snowflake Horizon.
- Compute: Snowflake provisions and maintains the compute infrastructure including networking, load balancing, storage, OS updates, and security patches transparently for the host OS and the container OS. When nodes are replaced, Snowflake provides new nodes with hardened images and redeploys containers onto them. Services with several instances can stay available through this if they tolerate running at half capacity; single-instance services and running jobs are disrupted (see maintenance below).
- Container Orchestration Services: Snowflake maintains the Kubernetes infrastructure including networking, load balancing, storage OS updates, and security patches transparently.
- Container GPU Run Time: Snowflake transparently maintains and updates Nvidia drivers.
- Metrics/Logs: Snowflake provisions and manages automatically a log collection capability using containers on all nodes, which automatically provides customers with logs out of the box. Compute pool and container metrics (CPU, memory, GPU, network, storage) are generally available; they land in the event table, where Datadog, Grafana or any Prometheus-compatible tool can pick them up.
- Controllers: Snowflake provisions and maintains the controller infrastructure including networking, load balancing, storage OS updates, and security patches transparently.
- Networking and Communications: Snowflake provisions and orchestrates all container infrastructure networking components including routing, proxies, firewalling, DNS, and certificate management for public endpoints.
- Load Balancing / Application Gateways: Snowflake provisions and maintains all load balancing and application gateway infrastructure to scale and provide secure ingress and egress access communications within Snowflake account.
- Authentication: Customers can leverage Snowflake user identities to interact with Snowpark Container Services. Users can be provisioned manually or via SCIM. Authentication and authorization is handled automatically among various containers. When a service or function needs to access data in your Snowflake account, Snowflake authentication and access control applies automatically – including Programmatic Access Tokens (PAT), OAuth, SAML, and Keypair authentication. More on this in the Data Governance and Security in One Platform section.
Data Governance and Security in One Platform#
SPCS is built on top of the Snowflake platform and leverages Snowflake’s high-standard security and data governance.
By deploying containers with Snowpark, data stays within the security and governance boundary of Snowflake. Any access to the data must go through Snowflake’s defense-in-depth layers:
- Network Access Controls: Network policies, data encryption in transit via TLS 1.2+.
- Identity and Access Management: Snowflake supports OAuth, SAML, Keypair, Programmatic Access Tokens (PAT), Workload Identity Federation, and username/password authentication methods.
- Data Governance: Any role-based access control, dynamic data masking policies, and row access policies are automatically applied. Customers do not need to maintain different copies of data or separate access control functions as data moves around – in contrast to traditional container infrastructure on other platforms.
- Encryption: Customer data in the Snowflake service is encrypted at rest using AES-256 by default and in transit using TLS 1.2+. Traffic between your own services stays on Snowflake’s internal network; the public docs describe it as plain TCP/HTTP, so add TLS inside your services if your policy requires encryption on every hop. Block storage volumes and image repositories created with
SNOWFLAKE_FULLencryption support Tri-Secret Secure (TSS) for customers requiring customer-managed keys. - High Availability and Data Protection: Customer data stored in Snowflake leverages Snowflake built-in high availability and protection such as time travel and fail safe. In addition, cross-regional cross-cloud high availability is available with Snowflake replication and failover.
- End-to-End Observability: Customers have full visibility of their data processing and SPCS logs, including lineage, access history, account usage, and service monitoring and logs.
- Snowflake Horizon: The unifying framework across all the above, including the expanding Snowflake portfolio of security and compliance reports.
Snowpark Container Services Security Architecture#
Components listed in Table 1 are deployed inside Snowflake’s cloud infrastructure environment. All communication among those components is private over Snowflake’s internal networking infrastructure and leverages TLS to encrypt data flows.
Each customer has a dedicated cluster which includes controllers and compute pools – their security boundary – isolated from other customers using security groups (Network Security Groups). Customer A containers cannot communicate directly with Customer B’s containers. The only possible way of cross-customer communication is for Customer B to publish a publicly accessible endpoint, and then Customer A goes via the egress proxy and enters Customer B’s public endpoint via the ingress proxy. Within the same customer account, containers can communicate using the Snowflake internal network.
SPCS is available on AWS, Microsoft Azure, and Google Cloud. The overview page now includes government regions, but individual feature pages still note regional exceptions, so check availability for your region before you plan around a feature.
SPCS Controllers Security#
Snowflake automatically provisions and deprovisions the controllers. Customers have no access to controllers. This helps developers focus on their applications instead of building and maintaining controller infrastructure. Snowflake engineers maintain the high availability of those controllers; in case of failure, any failed controllers are automatically rebuilt.
Controller nodes are not permanent. Snowflake routinely upgrades operating systems, drivers, and patches any security vulnerabilities found on those nodes as part of maintenance. A particular node may stay up for a maximum of one month, after which Snowflake retires it and replaces it with a newly updated one. Failure in controller nodes is transparent to customers, as Snowflake automatically rebuilds those nodes. Configurations are stored in the Snowflake cloud service layer that leverages built-in Snowflake high availability.
Finally, controller nodes run in their own network security groups that control all communications with the compute pools.
SPCS Compute Pools Security#
Customers create compute pools using SQL:
CREATE COMPUTE POOL tutorial_compute_pool
MIN_NODES = 2
MAX_NODES = 3
INSTANCE_FAMILY = GPU_NV_M; -- a GPU family available on AWS; families differ per cloudOr using the Snowflake Python API:
new_compute_pool_def = ComputePool(
name="MyComputePool",
instance_family="GEN_X64_G2_2", # current generation; CPU_X64_* is now "previous generation"
min_nodes=1,
max_nodes=2,
)
new_compute_pool = api_root.compute_pools.create(new_compute_pool_def)Compute pools are the trust boundary where service(s)/job(s) can run. They are a group of similar nodes. Customers choose the instance family and Snowflake automatically provisions the nodes. As part of maintenance, Snowflake manages upgrades to operating systems and drivers and patches any security vulnerabilities. A particular node may stay up for a maximum of one month; then SPCS retires it and replaces it with a newly updated one.
Maintenance windows. Scheduled maintenance runs Saturday 8 PM to Sunday 8 AM and Sunday 8 PM to Monday 8 AM, in the time zone of your account’s region (early-access accounts: daily from 11 PM, for up to 6 hours). Snowflake recreates up to half of a service’s instances at a time, so a service with at least two instances that tolerates running at half capacity stays available. Single-instance services and running job services are disrupted, and disruption during maintenance isn’t covered by the SLA. Check what’s coming with SYSTEM$GET_COMPUTE_POOL_PENDING_MAINTENANCE and keep critical jobs out of those windows.
Snowflake controls which node a service instance runs on, based on customer specifications. A node could run one or more service instances/jobs. Multiple services can share the same compute pool, or a customer can have many compute pools and dedicate one per service or job, depending on functional and security requirements.
NOTE: When the customer drops a compute pool, the underlying nodes are terminated at the cloud service provider layer.
Compute Pool Metrics#
Compute Pool metrics are generally available for all SPCS customers. Customers can observe the performance of nodes, services, and jobs, including free memory, memory used by a specific container, and CPU utilization. Metrics land in the event table (see Platform Metrics), where enterprise monitoring tools such as Datadog or Grafana can read them.
Block Storage#
Block storage volumes are available for services on AWS, Azure and Google Cloud (using them with job services is still in preview). Current limits per volume:
| Cloud | Size | IOPS (max) | Throughput (max) |
|---|---|---|---|
| AWS | 1 GiB to 64 TiB | 80,000 | 2,000 MiB/s |
| Azure | 1 GiB to 16 TiB | 80,000 | 1,200 MiB/s |
| Google Cloud | 4 GiB to 16 TiB | 160,000 (CPU instances) | 2,400 MiB/s (CPU instances) |
IOPS and throughput scale with volume size, so the maximums need large volumes. Volumes support point-in-time snapshots, and Tri-Secret Secure (TSS) (GA November 2025) for customers who need customer-managed encryption keys.
What happens on delete: dropping a service with FORCE, or stopping all services with ALTER COMPUTE POOL … STOP ALL, deletes the attached volumes. What you can keep is a snapshot: snapshotOnDelete defaults to true for services and false for jobs, and those snapshots are deleted after 7 days unless you change snapshotDeleteAfter. Take your own snapshots of anything you need to keep longer.
SPCS Service Security#
The service definition is the main component that defines the service or job running in SPCS. You define a service by specifying the specs, compute pool, and min/max instances:
CREATE SERVICE echo_service
IN COMPUTE POOL tutorial_compute_pool
FROM @tutorial_stage
SPEC = 'echo_spec.yaml'
MIN_INSTANCES = 1
MAX_INSTANCES = 3;The service has the following security properties:
- Single-node instances: Service instances run on a single node. Snowflake orchestrates additional instances on other available nodes.
- Intra-service container communication: Containers on the same service instance communicate over localhost.
- Cross-service communication: Containers across services and service instances use the DNS name Snowflake assigns to each service:The hash is specific to the schema (look it up with
<service-name>.<hash>.svc.spcs.internalSHOW SERVICESorSYSTEM$GET_SERVICE_DNS_DOMAIN), and services in the same schema can simply use<service-name>. - Load balancing: Snowflake manages all load balancing aspects of Kubernetes. Customers have no access to the underlying infrastructure.
- DNS: Snowflake manages all DNS naming resolutions.
- Role-based trust boundary: The role that owns the service defines its security context. Services with the same owner role can reach each other’s endpoints by default. A service owned by a different role can call an endpoint only if its owner role has been granted a service role for that endpoint (see Service to Service). To keep services apart, create them with different roles and don’t grant service roles across them.
ACCOUNTADMINcan’t own a service. - User-mode containers: Containers in services run as user mode and cannot change hardware configurations of the host.
- Workload governance: The account parameters
ALLOWED_SPCS_WORKLOAD_TYPESandDISALLOWED_SPCS_WORKLOAD_TYPESrestrict which kinds of SPCS workloads may run in the account at all. - Networking controls:
- Egress: Controlled by External Access Integration (EAI) objects. No EAI, no egress.
- Ingress: Controlled by the
BIND SERVICE ENDPOINTprivilege, network policies and service roles. Ingress endpoints only accept authenticated Snowflake users; programmatic access works with OAuth or Programmatic Access Tokens (PAT) in theAuthorizationheader.
Check this in your account: any role may now publish public endpoints. In a behavior change rolled out from 18 May 2026,
BIND SERVICE ENDPOINT ON ACCOUNTis granted to thePUBLICrole automatically. Any role that can create a service can therefore expose an authenticated public endpoint. If you want that to stay a deliberate decision, take it back fromPUBLICand grant it to the roles that should have it:REVOKE BIND SERVICE ENDPOINT ON ACCOUNT FROM ROLE PUBLIC; GRANT BIND SERVICE ENDPOINT ON ACCOUNT TO ROLE app_publisher_role;
CORS Configuration#
CORS (Cross-Origin Resource Sharing) support is generally available (August 2025). Without CORS, browsers block JavaScript from making requests to a different origin than the page was loaded from. Since your frontend app (https://myapp.example.com) and your SPCS endpoint (https://<hash>.snowflakecomputing.app) are different origins, the browser will reject the request unless the SPCS endpoint returns the correct CORS headers.
Snowflake’s ingress proxy handles all CORS headers automatically based on corsSettings in your service specification – your service code does not need to handle CORS itself. The proxy answers the browser’s preflight OPTIONS request with the configured headers and adds them to actual responses. It also strips any CORS headers your service sets itself, always sends Access-Control-Allow-Credentials: true, and lets browsers cache preflights for two hours (Access-Control-Max-Age).
Endpoint hostnames are changing. With the 2026_08 behavior change bundle (disabled by default for now), public endpoints move from shared
*.snowflakecomputing.apphostnames to per-account hostnames undersnowflake.app. When you enable it, update anything that hardcodes the old hostname: egress allowlists, frontend config, bookmarks and monitoring.
Service spec configuration:
endpoints:
- name: myendpoint
port: 8080
public: true
corsSettings:
Access-Control-Allow-Origin:
- "https://myapp.example.com"
- "https://staging.example.com"
Access-Control-Allow-Methods:
- GET
- POST
- PUT
- DELETE
Access-Control-Allow-Headers:
- Authorization
- Content-Type
- X-Request-IDHow the browser flow works:
- Your frontend JavaScript makes a
fetch()call to the SPCS endpoint - The browser sends a preflight
OPTIONSrequest to check if the origin is allowed - Snowflake’s ingress proxy responds with the CORS headers from your
corsSettings - If the origin matches, the browser proceeds with the actual request
- The
Authorizationheader carries the PAT – this is whyAuthorizationmust be listed inAccess-Control-Allow-Headers
Frontend example (JavaScript):
const PAT = "<your-pat-token>";
const SPCS_ENDPOINT = "https://<ingress-hostname>/echo";
// The browser automatically sends a preflight OPTIONS request first.
// Snowflake's proxy handles it — your service never sees it.
const response = await fetch(SPCS_ENDPOINT, {
method: "POST",
headers: {
"Authorization": `Snowflake Token="${PAT}"`,
"Content-Type": "application/json",
},
body: JSON.stringify({
data: [[0, "hello world"]]
}),
});
const result = await response.json();
console.log(result);Common pitfalls:
- Missing
Authorizationin allowed headers: If you don’t listAuthorizationinAccess-Control-Allow-Headers, the browser will block the preflight and your request never reaches the service. - Wildcard origins:
corsSettingsrequires explicit origins –*is not supported. This is intentional: Snowflake enforces that you know which origins should access your service. - Forgetting the PAT format: The header must be
Snowflake Token="<pat>"(with quotes around the token inside the header value), notBearer <pat>. - CSP interaction: Snowflake’s ingress proxy enforces a baseline Content-Security-Policy. If your service also serves a frontend that needs to call external APIs, configure an EAI – the CSP is automatically extended to allow browser-side requests to the same egress destinations.
Gateways#
Gateways allow routing ingress requests to multiple service endpoints behind a single hostname. This simplifies multi-service architectures and reduces the number of public endpoints exposed. For more information, see Use Gateways to route ingress requests to multiple endpoints.
Three security differences matter when you put a gateway in front of services:
- Access control moves to the gateway. Users need
USAGEon the gateway object, and they don’t need service roles for the endpoints behind it. Whoever can use the gateway reaches every route on it. - No caller’s rights. Gateways don’t support caller’s rights, so services behind a gateway can’t run queries as the end user.
- No CORS or CSP settings. Browser-facing apps that rely on
corsSettingsor EAI-extended CSP still need a direct service endpoint.
SPCS Image Registry Security#
Snowflake provisions and orchestrates the underlying OCI v2 compliant image registry infrastructure and security. The image registry is accessed using a per-customer fully qualified domain name:
<orgname>-<acctname>.registry.snowflakecomputing.comThe Image Registry has the following attributes:
- Built on internal stage: The image registry is built on top of the Snowflake account internal stage.
- Multiple repositories: Repositories can be created with the
CREATE IMAGE REPOSITORYcommand. A role can have READ, WRITE, SERVICE READ, SERVICE WRITE or OWNERSHIP privileges on a repository, as detailed in the documentation. Individual images can’t be dropped, so treat a push as permanent and keep a separate repository per environment. - Image metadata: Customers can query image metadata using
SHOW IMAGES IN IMAGE REPOSITORY <name>, including image name, creation date, tags, digest, and image path. - Docker CLI: Customers can use Docker CLI to push/pull images.
- Snowflake REST API / SnowCLI: For listing, creating, and dropping repositories and managing access controls.
Authentication#
Snowflake accounts enforce MFA by default, which is incompatible with the docker login command. As a result, username/password authentication is not supported for Docker CLI unless the account administrator explicitly enables password-only login (not recommended). The recommended authentication methods are:
| Method | Docker CLI | REST API / SnowCLI |
|---|---|---|
| PAT (Programmatic Access Token) – Recommended | Yes | Yes |
| Keypair Authentication | via SnowCLI token | Yes |
| OAuth | via SnowCLI token | Yes |
| Workload Identity Federation (AWS, Azure, GCP, OIDC) | via SnowCLI token | Yes |
| Username/Password (only if MFA disabled – not recommended) | Yes | Yes |
Option 1 – SnowCLI (recommended): The Snowflake CLI handles all authentication methods transparently and calls docker login on your behalf:
snow spcs image-registry login
# Supports keypair, OAuth, PAT, Workload Identity -- no manual token management
# For private link environments:
snow spcs image-registry login --private-linkOption 2 – PAT with Docker CLI: Generate a PAT, then use it directly with Docker using the literal string USER as the username and the PAT value as the password:
docker login <orgname>-<acctname>.registry.snowflakecomputing.com \
--username USER \
--password "<your-pat-token>"Option 3 – Short-lived token (CI/CD pipelines): Use snow spcs image-registry token to generate a short-lived OAuth token and pipe it into any OCI-compatible client:
snow spcs image-registry token --format=JSON | \
jq -r '.token' | \
docker login <orgname>-<acctname>.registry.snowflakecomputing.com \
--username 0sessiontoken --password-stdinThis approach is suitable for automated pipelines where storing a long-lived PAT is undesirable.
Encryption#
Images are encrypted in transit using TLS 1.2+. At rest, you choose the encryption when you create the repository, and it can’t be changed afterwards:
CREATE IMAGE REPOSITORY my_repo ENCRYPTION = (TYPE = 'SNOWFLAKE_FULL');SNOWFLAKE_FULL: the registry service encrypts images before they reach cloud storage, which then encrypts them again server-side. It supports Tri-Secret Secure, and it has been the default on AWS and Azure since the 2025_05 behavior change bundle.SNOWFLAKE_SSE: server-side encryption only. It doesn’t support Tri-Secret Secure.
If you need customer-managed keys for images, create repositories with SNOWFLAKE_FULL (and check older repositories, which you’d have to recreate). Block storage volumes support TSS too (GA November 2025).
Networking#
- Network Policies: Customers can leverage Snowflake network policies to control access to the image registry from authorized IP addresses.
- Private Link: The image registry supports private connectivity (Business Critical edition). Use
SYSTEM$GET_PRIVATELINK_CONFIGand create a CNAME record pointing to thespcs-registry-privatelink-urlvalue returned. This eliminates the need to route image push/pull traffic over the public internet. See Configuring private connectivity.
SPCS Auditing and Monitoring#
Snowflake provides and maintains logging containers to allow customers to monitor and access container logs. Snowflake manages the updating and patching of those logging containers. Three mechanisms are available, each suited to different use cases:
SYSTEM$GET_SERVICE_LOGS: Real-time log tail for development and debugging. Limited to 100 KB.SPCS_GET_LOGStable function: Scoped to a single service, queries historical logs with full SQL.- Event Tables: Full-featured log and metric persistence across all services – the foundation for production auditing, alerting, and monitoring.
Setting Up an Event Table#
Event tables capture everything your containers emit to stdout and stderr, plus platform metrics. Every account already has an active default event table, SNOWFLAKE.TELEMETRY.EVENTS. Creating your own is optional, but it lets you set retention and access separately from other telemetry (on Enterprise edition you can also associate one per database):
CREATE EVENT TABLE my_db.my_schema.spcs_events
DATA_RETENTION_TIME_IN_DAYS = 90;
-- Associate with your account (requires ACCOUNTADMIN)
ALTER ACCOUNT SET EVENT_TABLE = my_db.my_schema.spcs_events;
-- Verify
SHOW PARAMETERS LIKE 'event_table' IN ACCOUNT;Control what gets logged per service in the service spec:
spec:
logExporters:
eventTableConfig:
logLevel: INFO # INFO = stdout + stderr, ERROR = stderr only, NONE = disabledEvent Table Schema#
Every row in the event table follows a fixed schema. The key columns:
| Column | What’s in it |
|---|---|
TIMESTAMP | UTC time of the event |
RECORD_TYPE | LOG, METRIC, SPAN, or EVENT |
RESOURCE_ATTRIBUTES | Source identification: service name, container name, compute pool, instance ID |
RECORD | Metadata: severity_text for logs, metric.name for metrics |
RECORD_ATTRIBUTES | Extra context: log.iostream (stdout/stderr) |
VALUE | The actual log message or metric value |
SCOPE | Scoping info (e.g., snow.spcs.platform for platform events) |
Distinguish between services, containers, and instances using RESOURCE_ATTRIBUTES:
{
"snow.service.name": "MY_SERVICE",
"snow.service.container.name": "main",
"snow.container.instance": "0",
"snow.compute_pool.name": "MY_POOL"
}Querying Logs#
Recent logs for a service:
SELECT TIMESTAMP, VALUE::STRING AS log_message
FROM my_db.my_schema.spcs_events
WHERE TIMESTAMP > DATEADD(hour, -1, CURRENT_TIMESTAMP())
AND RESOURCE_ATTRIBUTES:"snow.service.name" = 'MY_SERVICE'
AND RECORD_TYPE = 'LOG'
ORDER BY TIMESTAMP DESC
LIMIT 50;Errors only (stderr):
SELECT TIMESTAMP, VALUE::STRING AS log_message
FROM my_db.my_schema.spcs_events
WHERE TIMESTAMP > DATEADD(hour, -6, CURRENT_TIMESTAMP())
AND RESOURCE_ATTRIBUTES:"snow.service.name" = 'MY_SERVICE'
AND RECORD_TYPE = 'LOG'
AND RECORD_ATTRIBUTES:"log.iostream" = 'stderr'
ORDER BY TIMESTAMP DESC;Filter by severity (when using structured logging):
SELECT TIMESTAMP, VALUE::STRING AS log_message
FROM my_db.my_schema.spcs_events
WHERE TIMESTAMP > DATEADD(day, -1, CURRENT_TIMESTAMP())
AND RESOURCE_ATTRIBUTES:"snow.service.name" = 'MY_SERVICE'
AND RECORD_TYPE = 'LOG'
AND RECORD:"severity_text" IN ('ERROR', 'FATAL')
ORDER BY TIMESTAMP DESC;Using SPCS_GET_LOGS (simpler, scoped to one service):
-- Last 24 hours (default)
SELECT * FROM TABLE(my_db.my_schema.my_service!SPCS_GET_LOGS());
-- Custom time range, filtered by container
SELECT * FROM TABLE(my_db.my_schema.my_service!SPCS_GET_LOGS(
START_TIME => DATEADD('day', -3, CURRENT_TIMESTAMP())
))
WHERE container_name = 'main';Real-time debugging with SYSTEM$GET_SERVICE_LOGS:
-- Last 100 lines from container 'main' in instance 0
SELECT SYSTEM$GET_SERVICE_LOGS('my_service', 0, 'main', 100);
-- Logs from the PREVIOUS container run (essential for debugging crashes)
SELECT SYSTEM$GET_SERVICE_LOGS('my_service', 0, 'main', 100, true);Structured Logging from Python#
If your container emits JSON to stdout, Snowflake parses it into the event table’s structured columns. This is far more useful than flat text – you can filter by severity, search by attributes, and correlate across services:
import json
import logging
from datetime import datetime, timezone
class SnowflakeStructuredHandler(logging.Handler):
"""Emit JSON logs that Snowflake parses into event table columns."""
def emit(self, record):
log_entry = {
"severity_text": record.levelname, # → RECORD.severity_text
"body": record.getMessage(), # → VALUE
"timestamp": datetime.fromtimestamp( # → TIMESTAMP
record.created, tz=timezone.utc
).strftime("%Y-%m-%dT%H:%M:%S.%fZ"),
"attributes": { # → RECORD_ATTRIBUTES
"module": record.module,
"function": record.funcName,
"line": record.lineno,
}
}
print(json.dumps(log_entry), flush=True)
logger = logging.getLogger("my_service")
logger.setLevel(logging.DEBUG)
logger.addHandler(SnowflakeStructuredHandler())
# Usage
logger.info("Service started on port 8080")
logger.error("Connection to database failed after 3 retries")The JSON field severity_text maps to RECORD:"severity_text", body maps to VALUE, and attributes maps to RECORD_ATTRIBUTES. Unrecognized JSON fields are silently ignored. Non-JSON log lines land in VALUE as plain strings.
Platform Metrics#
Platform metrics (CPU, memory, GPU, network, storage) land in the same event table as logs, distinguished by RECORD_TYPE = 'METRIC'. Enable them in the service spec:
spec:
platformMonitor:
metricConfig:
groups:
- system # CPU, memory, GPU usage
- system_limits # resource limits and requests
- status # restarts, container state, exit codes
- network # egress counters incl. denied packets, ingress connections
- storage # volume IOPS, throughput, capacityOne network metric deserves its own alert: network.egress.denied.packets counts outbound packets the egress proxy blocked. A non-zero value means something in the container tried to reach a destination its External Access Integration doesn’t allow, which is either a misconfiguration or exactly the behaviour you hoped to stop.
Query CPU and memory usage over the last hour:
SELECT
DATE_TRUNC('minute', TIMESTAMP) AS minute,
RESOURCE_ATTRIBUTES:"snow.service.container.name"::STRING AS container,
AVG(CASE WHEN RECORD:"metric.name" = 'container.cpu.usage'
THEN CAST(VALUE AS FLOAT) END) AS avg_cpu_cores,
AVG(CASE WHEN RECORD:"metric.name" = 'container.memory.usage'
THEN CAST(VALUE AS FLOAT) / (1024*1024*1024) END) AS avg_memory_gb
FROM my_db.my_schema.spcs_events
WHERE TIMESTAMP > DATEADD(hour, -1, CURRENT_TIMESTAMP())
AND RESOURCE_ATTRIBUTES:"snow.service.name" = 'MY_SERVICE'
AND RECORD_TYPE = 'METRIC'
AND RECORD:"metric.name" IN ('container.cpu.usage', 'container.memory.usage')
GROUP BY 1, 2
ORDER BY 1 DESC;Check container restarts and exit codes (debugging crashes; needs the status group above):
SELECT
TIMESTAMP,
RESOURCE_ATTRIBUTES:"snow.service.container.name"::STRING AS container,
RECORD:"metric.name"::STRING AS metric,
VALUE
FROM my_db.my_schema.spcs_events
WHERE RESOURCE_ATTRIBUTES:"snow.service.name" = 'MY_SERVICE'
AND RECORD_TYPE = 'METRIC'
AND RECORD:"metric.name" IN (
'container.restarts',
'container.state.last.finished.exitcode',
'container.state.last.finished.reason'
)
AND TIMESTAMP > DATEADD(hour, -6, CURRENT_TIMESTAMP())
ORDER BY TIMESTAMP DESC;For container.state.last.finished.reason the value is always 1; the reason itself travels as a reason label on the metric, so select the record’s attributes as well when you query it.
Using SPCS_GET_METRICS (scoped to one service):
SELECT * FROM TABLE(my_db.my_schema.my_service!SPCS_GET_METRICS(
START_TIME => DATEADD('hour', -1, CURRENT_TIMESTAMP())
));Alerting on Container Errors#
Combine event tables with Snowflake Alerts to get notified when things go wrong:
CREATE OR REPLACE ALERT spcs_error_alert
WAREHOUSE = my_wh
SCHEDULE = '5 minute'
IF (EXISTS (
SELECT 1
FROM my_db.my_schema.spcs_events
WHERE TIMESTAMP > DATEADD(minute, -5, CURRENT_TIMESTAMP())
AND RECORD_TYPE = 'LOG'
AND RESOURCE_ATTRIBUTES:"snow.service.name" = 'MY_SERVICE'
AND (RECORD:"severity_text" IN ('ERROR', 'FATAL')
OR RECORD_ATTRIBUTES:"log.iostream" = 'stderr')
))
THEN
CALL SYSTEM$SEND_SNOWFLAKE_NOTIFICATION(
SNOWFLAKE.NOTIFICATION.TEXT_PLAIN(
'SPCS service MY_SERVICE has errors - check event table'
),
'{"my_email_integration": {}}'
);
ALTER ALERT spcs_error_alert RESUME;Creating Views for Easier Access#
Raw event table queries are verbose. Create views to simplify daily use:
-- Clean log view
CREATE OR REPLACE VIEW my_db.my_schema.service_logs AS
SELECT
TIMESTAMP,
RESOURCE_ATTRIBUTES:"snow.service.name"::STRING AS service_name,
RESOURCE_ATTRIBUTES:"snow.service.container.name"::STRING AS container_name,
RESOURCE_ATTRIBUTES:"snow.container.instance"::STRING AS instance_id,
RECORD:"severity_text"::STRING AS severity,
RECORD_ATTRIBUTES:"log.iostream"::STRING AS stream,
VALUE::STRING AS log_message
FROM my_db.my_schema.spcs_events
WHERE RECORD_TYPE = 'LOG';
-- Now querying is simple
SELECT * FROM service_logs
WHERE service_name = 'MY_SERVICE'
AND severity = 'ERROR'
AND TIMESTAMP > DATEADD(hour, -1, CURRENT_TIMESTAMP());Prometheus and OpenTelemetry Integration#
For application-level custom metrics, Snowflake provides a Prometheus sidecar container that scrapes your app’s /metrics endpoint and writes to the event table:
spec:
containers:
- name: main
image: /my_db/my_schema/my_repo/my_app:latest
- name: prometheus
image: /snowflake/images/snowflake_images/monitoring-prometheus-sidecar:0.0.1
args:
- "-e"
- "localhost:8000/metrics,1m" # scrape /metrics every 1 minuteFor more control, use OpenTelemetry directly from your application code to emit custom counters, histograms, and traces – these land in the same event table and can be queried alongside platform metrics and logs.
Compute pool node-level metrics are also exposed via a Prometheus endpoint on TCP port 9001 on each node. Only other services in your account can reach it (they find the nodes through discover.monitor.<pool>.cp.spcs.internal), so external tools such as Datadog or Grafana need either a small relay service in SPCS or a query against the event table through a Snowflake connector.
Platform events (such as container state changes) are controlled by the LOG_EVENT_LEVEL setting and can be read with SPCS_GET_EVENTS, alongside SPCS_GET_LOGS and SPCS_GET_METRICS.
SPCS-specific auditing and monitoring should be used in conjunction with overall Snowflake security and observability data to provide end-to-end monitoring and auditing. For more details, see Snowflake Horizon.
SPCS Communication Security#
This section covers service-to-service, Snowflake-to-service, service-to-Snowflake, ingress, egress, and private connectivity patterns.
SPCS Service to Service Communication#
Services communicate using the Snowflake internal network, leveraging Snowflake-provisioned load balancing, DNS naming, and resolution.
Service-to-Service communication has two patterns:
- Same service instance: Containers on the same service instance use localhost and defined port numbers.
- Cross-service / cross-instance: Containers use the DNS name Snowflake assigns to each service:Within the same schema,
<service-name>.<hash>.svc.spcs.internal<service-name>alone is enough. Get the full name fromSHOW SERVICESorDESCRIBE SERVICE.
Services only accept requests on the endpoints declared in their specification, and the calling service’s owner role needs permission to use the endpoint:
Same owner role: services owned by the same role can call each other’s endpoints by default.
Different owner roles: the caller’s owner role needs a service role that covers the endpoint. Every service has a built-in
all_endpoints_usageservice role, and you can define narrower ones underserviceRolesin the spec:-- Let services owned by analytics_svc_role call every endpoint of the echo service GRANT SERVICE ROLE my_db.my_schema.echo_service!all_endpoints_usage TO ROLE analytics_svc_role;To keep services apart, create them with different owner roles and don’t grant service roles across them.
Note that USAGE on a service does not grant access to its endpoints; only service roles do. And ACCOUNTADMIN can’t own a service.
SPCS Snowflake to Service Communication#
Customers can build services and call those services from inside their Snowflake accounts (for example, for ML inference). Snowflake enables this via a UDF type called a Service Function.
Once an endpoint is created, the service function calls the service through that endpoint over Snowflake’s internal network. The user needs USAGE on the function, and the function’s owner role needs a service role for the endpoint (for example GRANT SERVICE ROLE my_db.my_schema.service_c!all_endpoints_usage TO ROLE func_owner_role). USAGE on the service alone is not enough.
If you run multiple service instances, Snowflake automatically load-balances between the nodes using the max_batch_rows parameter:
CREATE FUNCTION my_echo_udf (text VARCHAR)
RETURNS VARCHAR
SERVICE = Service_C
ENDPOINT = echoendpoint
MAX_BATCH_ROWS = 100
AS '/echo';SPCS Service to Snowflake Communication#
A service can call and access data in your Snowflake account. The service automatically uses the service owner role to connect to the underlying Snowflake account using temporary credentials automatically provisioned by Snowflake OAuth.
Snowflake creates a dedicated service user for each service. Since release 8.35 it has the same name as the service (older services use SF$SERVICE$<id>), and it can only use the service owner role and PUBLIC. You can find everything it ran by filtering QUERY_HISTORY on user_type = 'SNOWFLAKE_SERVICE'. A short-lived access token, valid for up to 1 hour, is written to /snowflake/session/token in every container. This access token is:
- Valid only to call Snowflake internally via
SNOWFLAKE_HOST - Restricted to that specific account, role, and user
- Cannot be used outside your Snowflake SPCS cluster
Once the service establishes a session using any Snowflake driver/connector, Snowflake session policies apply for session duration.
Working with the Session Token#
Snowflake writes the OAuth token to /snowflake/session/token inside every container. The file is refreshed automatically by the SPCS runtime – the token is valid for up to 1 hour, and Snowflake updates the file in-place before the current token expires. Your service should re-read the file periodically (every few minutes is sufficient) rather than caching the token value at startup.
You can tighten how the token is exposed per container with sessionTokenConfig: mount it at a different directory and restrict the file mode, so only the process that needs it can read it.
spec:
containers:
- name: main
image: /my_db/my_schema/my_repo/my_app:latest
sessionTokenConfig:
path: /app/session # token is mounted at /app/session/token
permission: "0400" # owner read only (default "0644")If a container doesn’t need to talk to Snowflake at all, set mountSessionToken: false on it and the token isn’t mounted there.
Environment variables SNOWFLAKE_HOST, SNOWFLAKE_ACCOUNT, SNOWFLAKE_DATABASE, and SNOWFLAKE_SCHEMA are auto-injected into every container, so connecting to Snowflake requires no hardcoded configuration:
import snowflake.connector
import os
def get_snowflake_connection():
with open('/snowflake/session/token', 'r') as f:
token = f.read().strip()
return snowflake.connector.connect(
host=os.environ['SNOWFLAKE_HOST'],
account=os.environ['SNOWFLAKE_ACCOUNT'],
authenticator='oauth',
token=token,
database=os.environ.get('SNOWFLAKE_DATABASE'),
schema=os.environ.get('SNOWFLAKE_SCHEMA'),
)For JDBC drivers, the connection string follows the same pattern: jdbc:snowflake://{SNOWFLAKE_HOST}/?authenticator=oauth&token={token}.
Caller Identity Passthrough#
By default, the session token runs as the service owner’s role – the role that created the service. But many applications need to know who is calling and execute queries as that user. SPCS supports this through identity headers and caller’s rights.
Identity headers on ingress requests:
When a user accesses a public endpoint, Snowflake’s ingress proxy injects identity headers after authenticating the user, replacing any client-supplied headers with the same names:
| Header | Content |
|---|---|
Sf-Context-Current-User | Username of the authenticated caller |
Sf-Context-Current-User-Email | Caller’s email (has to be enabled by Snowflake Support) |
Your service can read Sf-Context-Current-User to implement user-specific logic, audit logging, or authorization decisions – without the caller needing to send any credentials beyond their Snowflake authentication.
Two caveats: the header isn’t a signed credential, and the replacement only happens on authenticated public ingress. Another service that can reach your endpoint internally can set the header to anything. If you base authorization on it, make sure only the ingress proxy can reach that endpoint, by keeping internal callers off it with service roles.
Caller’s rights – executing queries as the calling user:
To go further and run Snowflake queries as the calling user (not the service owner), enable executeAsCaller. Note that capabilities is a top-level field of the specification, next to spec, not part of a container:
spec:
containers:
- name: my-app
image: ...
capabilities:
securityContext:
executeAsCaller: trueWith this enabled, the ingress proxy also injects Sf-Context-Current-User-Token – a JWT for the calling user. Combine it with the service’s own session token (dot-separated) to connect as that user:
def get_caller_connection(request):
"""Connect to Snowflake as the calling user, not the service owner."""
service_token = open('/snowflake/session/token').read().strip()
user_token = request.headers.get('Sf-Context-Current-User-Token')
combined_token = f"{service_token}.{user_token}"
return snowflake.connector.connect(
host=os.environ['SNOWFLAKE_HOST'],
account=os.environ['SNOWFLAKE_ACCOUNT'],
authenticator='oauth',
token=combined_token,
)This is powerful: the service can maintain two connections simultaneously – one as the service owner (for shared config tables, logging, service-level operations) and one as the calling user (for user-specific queries where Snowflake’s RBAC applies to that user’s role).
Caller grants are required. This is restricted caller’s rights: by default the service can’t do anything on a user’s behalf. Every operation has to pass two checks, the user’s own privileges and the caller grants you give the service owner role. Without caller grants, the code above connects but its queries fail:
-- Run as a role with the global MANAGE CALLER GRANT privilege
GRANT CALLER USAGE ON DATABASE my_db TO ROLE service_owner_role;
GRANT CALLER USAGE ON SCHEMA my_db.my_schema TO ROLE service_owner_role;
GRANT CALLER USAGE ON WAREHOUSE my_wh TO ROLE service_owner_role;
GRANT CALLER SELECT ON TABLE my_db.my_schema.orders TO ROLE service_owner_role;Caller grants are a ceiling on what the service may do as any user; the user’s own grants, masking and row access policies still apply on top. That makes them a useful control: a compromised service can never use a caller’s privileges beyond what you granted here.
The caller token is short-lived: SERVICE_CALLER_TOKEN_VALIDITY_SECS defaults to 120 seconds (maximum 7 days) and can be set per account, database, schema or service. Keep it short unless the service genuinely runs long work for a user.
Note: Caller’s rights is supported for ingress endpoints only, and not through gateways. Service functions do not receive caller identity headers.
For a working implementation that decodes both tokens, tracks refresh intervals, and generates ready-to-use JDBC connection strings, see the spcs-token-inspector tool.
SPCS Service to Other Snowflake Accounts#
When a service needs to connect to a different Snowflake account, the customer must:
- Enable egress access via an External Access Integration.
- Allow-list the other Snowflake account in the EAI.
- Provide user identity and credentials via secrets in the service specification.
The connection is established over TLS 1.2+ via the Snowflake-managed egress proxy cluster.
SPCS Ingress Access#
For customers building long-running applications that need to be accessed publicly, the Snowflake ingress endpoint is defined in service specs by setting public: true on an endpoint. Snowflake automatically provisions and protects this endpoint in the background.
Snowflake automatically protects public endpoints with the following controls:
- Public endpoints are behind Snowflake load balancers and the ingress proxy. No additional infrastructure needed.
- All communications are carried over TLS 1.2+.
- Users and roles can be automatically provisioned via SCIM.
- Authenticated access only: Snowflake requires valid credentials to access public endpoints. Username/password, OAuth, SAML/SSO, and Keypair authentication are all supported.
- Snowflake access controls automatically apply.
- Customers can restrict access to the ingress endpoint using Snowflake network policies.
- Ingress timeout: Connections to ingress endpoints have a 90-second idle timeout. Use polling or WebSockets for long-lived connections.
Programmatic Access with PAT#
Programmatic Access Tokens (PAT) provide the simplest way to access SPCS public endpoints programmatically. A PAT goes directly in the Authorization header (as Snowflake Token="…", not Bearer) – no intermediate token exchange step required:
curl -X POST https://<ingress-hostname>/endpoint \
-H 'Authorization: Snowflake Token="<your-pat-token>"' \
-H 'Content-Type: application/json' \
-d '{"data": [[0, "hello"]]}'This replaces the earlier flow where a PAT first had to be exchanged for a scoped SPCS access token via the /oauth/token endpoint. For standard SPCS endpoint access that exchange is no longer needed.
For keypair JWT-based authentication, a token exchange step is still required. PAT is the recommended approach for new integrations due to its simplicity.
Setup requirements:
-- Create a PAT restricted to one low-privilege role, with a short lifetime
ALTER USER <user_name> ADD PROGRAMMATIC ACCESS TOKEN <token_name>
ROLE_RESTRICTION = 'ENDPOINT_CLIENT_ROLE'
DAYS_TO_EXPIRY = 30;
-- If an authentication policy applies, ensure PAT is allowed
ALTER AUTHENTICATION POLICY <policy_name>
SET AUTHENTICATION_METHODS = ('PASSWORD', 'PROGRAMMATIC_ACCESS_TOKEN');
-- Give that role access to the endpoint
GRANT USAGE ON DATABASE my_db TO ROLE endpoint_client_role;
GRANT USAGE ON SCHEMA my_db.my_schema TO ROLE endpoint_client_role;
GRANT SERVICE ROLE my_db.my_schema.echo_service!all_endpoints_usage TO ROLE endpoint_client_role;Things that trip people up:
- Network policy required. By default a user can only use a PAT if they are subject to a network policy. Without one, the PAT is rejected.
- Expiry. Tokens last 15 days by default and at most 365. Use
ROLE_RESTRICTIONso a leaked token only carries one narrow role. - Policy guardrails. The PAT policy in an authentication policy can now require a role restriction on person users’ PATs (
REQUIRE_ROLE_RESTRICTION_FOR_PERSON_USERS) and block powerful roles such asACCOUNTADMINfrom being a PAT’s role (BLOCKED_ROLES_LIST). - Access comes from the service role, not from
USAGEon the service. Snowflake’s RBAC applies to PAT-authenticated requests just as it does to browser sessions.
Ingress Access Request Security Control#
The ingress proxy filters and hardens all traffic entering your service:
Incoming requests:
- Banned HTTP methods are blocked:
TRACE,CONNECT X-SF-SPCS-Authorizationand Snowflake bearer tokens in theAuthorizationheader are scrubbed before forwarding to your service
Outgoing responses:
- Sensitive server headers are scrubbed (
X-XSS-Protection,Server,X-Powered-By,Public-Key-Pins) - Executable MIME types return a
403 Forbidden - Security headers are automatically injected:
X-Frame-Options: DENY,Cross-Origin-Opener-Policy: same-origin,Cross-Origin-Resource-Policy: same-origin,X-Content-Type-Options: nosniff, andCross-Origin-Embedder-Policy: credentialless(cross-origin resources that don’t support CORS load without credentials) - A baseline
Content-Security-Policyis enforced by default:default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:; object-src 'none'; connect-src 'self'; frame-ancestors 'self'; - When an EAI is configured, the CSP is automatically extended to allow the web page in the browser to access the same egress destinations as the service.
CORS for Ingress Endpoints#
CORS headers on ingress responses are fully managed by the Snowflake proxy – your service code does not need to handle preflight requests or inject CORS headers. Configure allowed origins, methods, and headers per endpoint via corsSettings in the service spec. For the full configuration walkthrough, frontend code example, and common pitfalls, see the CORS Configuration section above.
SPCS Egress Access#
Services that need to access external services and APIs use External Access Integrations. A customer creates egress network rules specifying the external destination by hostname:port or IP address and port. Those rules are cryptographically signed by the cloud service layer using the customer context and installed in Snowflake-managed egress proxies – they cannot be spoofed by workers.
CREATE NETWORK RULE my_network_rule
MODE = EGRESS
TYPE = HOST_PORT
VALUE_LIST = ('api.example.com:443');
CREATE EXTERNAL ACCESS INTEGRATION my_eai
ALLOWED_NETWORK_RULES = (my_network_rule)
ENABLED = TRUE;SPCS supports egress to ports 22, 80, 443, and 1024+. Ports 23 to 79, 81 to 442 and 444 to 1023 are blocked whatever your network rules say. The catch-all destination 0.0.0.0 (any host on the internet) only works with ports 80 and 443, and it effectively turns egress control off, so use it only for sandboxes.
To see what a service actually tried to reach and was refused, watch the network.egress.denied.packets metric (see Platform Metrics).
Stable Egress IP Addresses#
By default, outbound traffic from SPCS uses dynamic IP addresses that can change. For customers whose external endpoints require firewall allowlisting by source IP, Snowflake supports stable egress IPs: outbound traffic leaves from a small set of published IP ranges instead of arbitrary cloud addresses. This is available on AWS commercial regions and on Azure (generally available since 8 October 2026), not on Google Cloud.
Retrieve the current ranges with:
SELECT SYSTEM$GET_SNOWFLAKE_EGRESS_IP_RANGES();The ranges rotate. Each range has an effective and an expires timestamp, and new ranges appear in the function’s output at least 60 days before they start carrying traffic. Don’t paste the addresses into a firewall once and forget them: automate a job that reads the function regularly and updates your allowlist, or connections will start failing when a range expires.
This is essential for connecting to on-premises systems, SaaS vendors, or partner APIs that enforce IP-based access controls. Rather than allowlisting broad cloud CIDR ranges, you give your network or security team a short, managed list. If your network can’t accept any inbound connections at all, look at Data Connectivity Proxy instead.
Credentials for External Services#
Services that call external APIs need credentials, and those belong in Snowflake secrets referenced from the service specification, never in images or plain environment variables. Two newer options reduce how many long-lived secrets you keep:
- Outbound workload identity federation (GA July 2026): Snowflake acts as an OpenID Connect provider and issues short-lived identity tokens (
WORKLOAD_IDENTITY_FEDERATIONsecrets,SYSTEM$ISSUE_WORKLOAD_IDENTITY_FEDERATION_TOKEN) that cloud providers and other services can trust, so there are no static keys to leak. Check that your workload type is covered before you design around it. - Client certificates: if your endpoint requires mutual TLS, store the certificate and key as secrets, mount them as files and present them from your own code. There is no built-in mTLS option on External Access Integrations.
Outbound Egress via Private Connectivity#
Instead of routing egress through the public internet, customers can now direct service egress traffic through a private connectivity endpoint. This keeps traffic on the cloud provider’s private network:
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
'com.amazonaws.us-west-2.s3',
'*.s3.us-west-2.amazonaws.com'
);
CREATE NETWORK RULE private_link_rule
MODE = EGRESS
TYPE = PRIVATE_HOST_PORT
VALUE_LIST = ('mybucket.s3.us-west-2.amazonaws.com');Private egress connectivity is available for AWS, Azure, and Google Cloud on Business Critical edition. Private communication requires that both Snowflake and the customer’s cloud account use the same cloud provider and region.
SPCS Private Connectivity#
Snowflake supports inbound private connectivity for all three SPCS network endpoints, so SPCS traffic doesn’t have to cross the public internet. Like other private connectivity, it requires Business Critical edition.
Configuring Private Connectivity#
- First, configure private connectivity to your Snowflake account, including a CNAME record for the
regionless-privatelink-account-urlvalue. - Call
SYSTEM$GET_PRIVATELINK_CONFIGto retrieve SPCS-specific hostnames:
| Key | Purpose |
|---|---|
spcs-registry-privatelink-url | Private routing to the image registry |
app-service-privatelink-url | Wildcard hostname for service public endpoints |
spcs-auth-privatelink-url | Hostname for SPCS authentication routing |
- Create CNAME records in your DNS resolving to these hostnames via your private network.
This enables:
- Image pushes/pulls to flow over private connectivity instead of the public internet
- Service public endpoint access to flow over private connectivity
- SPCS authentication to flow over private connectivity
For complete setup instructions, see Configuring private connectivity.
Tunneling Into and Out of SPCS#
Private connectivity and EAIs cover the official networking paths. But sometimes you need to reach infrastructure that isn’t exposed through PrivateLink or a public API – an on-prem database, a home lab, a development machine, or a service behind a corporate firewall. SPCS allows egress on ports 22, 80, 443 and 1024+, which is all you need to establish a tunnel.
Start with Snowflake’s own option; the do-it-yourself approaches after it are for cases it doesn’t cover.
Data Connectivity Proxy#
Data Connectivity Proxy (DCP) is the supported version of the tunnel idea. You run a lightweight agent on your network; it makes a single outbound connection on port 443 to Snowflake and holds an encrypted tunnel open, and Snowflake routes requests to your private data source through it. Your firewall only sees outbound traffic: no inbound listener, no public IP, no VPN.
DCP is available on AWS, Azure and Google Cloud across Standard, Enterprise and Business Critical editions, and it works for Snowpark Container Services workloads (including notebooks, Streamlit apps and Openflow). For an on-prem database behind a deny-all-inbound firewall, it’s the first thing to try. The approaches below remain useful when you need something DCP isn’t built for, such as reverse access from Snowflake to your machine, a mesh network, or a quick development setup.
Several do-it-yourself tunneling approaches have been proven to work with SPCS:
SSH Tunnels#
The most straightforward approach. Your SPCS container initiates an outbound SSH connection to a server you control, establishing SOCKS proxies (-D) for outbound traffic, local port forwards (-L) to reach specific services like databases, and reverse port forwards (-R) to expose container services back on your server. Use autossh for automatic reconnection. Store the SSH private key as a base64-encoded Snowflake Secret, decode it at runtime, and clean up the environment variables after the tunnels are established.
For a full walkthrough with Dockerfile, tunnel scripts, nginx reverse proxy, service function examples, and security hardening, see my article: SSH Tunnels from Snowflake Container Services. For the original SSH tunnel architecture used for querying on-prem data lakes, see Query Your On-Premise DataLake Through a Private Tunnel with Snowflake.
WebSocket Tunnels#
An alternative that works entirely over HTTPS (port 443). A lightweight Python agent running in your data centre opens an outbound WebSocket connection to an SPCS endpoint – the same way a browser connects to any website. No inbound firewall rules needed. The agent multiplexes TCP connections over the WebSocket, allowing SPCS services to reach on-prem databases, REST APIs, or any TCP service through the tunnel.
This approach is particularly interesting for data sovereignty scenarios where you need to query on-prem Apache Iceberg catalogs or databases without the data leaving your infrastructure. The WebSocket tunnel carries only queries and results – the data stays on-prem.
For the full architecture including multi-catalog support and PAT-based authentication, see: Data Sovereignty First: Integrating an On-Premise Apache Iceberg into Snowflake Through a Direct Outbound Tunnel.
Tailscale#
Tailscale creates a WireGuard-based mesh VPN. Run the Tailscale client inside your SPCS container and it joins your tailnet – giving the container a stable IP address and direct access to any other machine on your Tailscale network.
One important detail: SPCS containers run as unprivileged user-mode processes with minimal capabilities. The NET_ADMIN capability needed to create kernel-level network interfaces (tun/tap devices) is not available. This means standard WireGuard and traditional VPN solutions that require kernel-level networking will not work. Tailscale solves this with its userspace networking mode (--tun=userspace-networking), which operates entirely in user space without needing NET_ADMIN or root. Any WireGuard-based solution deployed in SPCS must use a similar userspace approach.
Vladimir Timofeenko wrote a detailed guide on this approach: Connecting to Tailscale on Snowpark Container Services.
ngrok#
ngrok creates secure tunnels to localhost. Run the ngrok agent inside your SPCS container and it exposes container services on a public ngrok URL – bypassing Snowflake’s ingress authentication if you need unauthenticated access or a stable public URL for webhooks and integrations. Treat that as a deliberate security exception: everything Snowflake’s ingress proxy does for you (authentication, network policies, header hardening) no longer applies on that path.
Brad Culberson explored this approach: Public Endpoints in Snowpark Container Services.
Choosing an Approach#
| Approach | Egress Port | Direction | Auth Required On Remote Side | Best For |
|---|---|---|---|---|
| Data Connectivity Proxy | 443 (agent connects out to Snowflake) | Snowflake reaches your private source | Managed by Snowflake | Supported default for private data sources, deny-all-inbound networks |
| SSH tunnel | 22 | Bidirectional (SOCKS, -L, -R) | SSH key | Full control, on-prem databases, reverse access |
| WebSocket tunnel | 443 | Inbound to SPCS (agent connects out) | PAT | Data sovereignty, restrictive firewalls, HTTPS-only |
| Tailscale | 443 (DERP relay) | Mesh (any direction) | Tailscale auth | Existing tailnet, multi-service mesh |
| ngrok | 443 | Outbound (expose container services) | ngrok account | Webhooks, public URLs, quick dev access |
SPCS does accept inbound traffic, but only as authenticated HTTPS or WebSocket requests to public endpoints; there’s no way to open an arbitrary inbound port. So every approach here has one side dial out: the container (SSH, Tailscale, ngrok) or an agent on your network (Data Connectivity Proxy, or the WebSocket tunnel, which connects in through an SPCS endpoint). Every container-initiated tunnel also needs an External Access Integration, so each one is visible in your network rules. The choice depends on your network constraints, existing infrastructure, and whether you need bidirectional access or just one-way connectivity.
The same pattern on other platforms#
Running your own containers inside the data’s security boundary is a platform capability, not something an ordinary database offers. It needs a data platform with a managed container runtime, and the questions in this guide are the checklist for one: how compute is isolated between customers and services, how a container gets a short-lived identity instead of a stored password, how ingress authenticates against platform roles, how egress is limited to named hosts, and how logs and metrics reach the platform’s own telemetry. The Kubernetes vocabulary in Table 1 carries over.
Specific to Snowflake, and worth re-checking elsewhere: compute pools and their maintenance windows, the way tokens reach the container, BIND SERVICE ENDPOINT, External Access Integrations, caller’s rights with caller grants, the Data Connectivity Proxy, and the feature status in the table below, which is dated November 2026.
Conclusion#
Snowpark Container Services simplifies and hardens the traditional container service model. Customers focus on their applications while Snowflake provisions and maintains secure-by-default container infrastructure across AWS, Microsoft Azure, and Google Cloud Platform.
Key security capabilities delivered by Snowflake, as of November 2026:
| Capability | Status |
|---|---|
| Automated OS and driver patching | Generally available |
| Role-based isolation between services (owner roles and service roles) | Generally available |
| Ingress proxy with CSP, header scrubbing, banned method filtering | Generally available |
| Egress control via External Access Integrations | Generally available |
| Stable egress IP ranges for firewall allowlisting | Generally available on AWS commercial regions and Azure (since October 2026); not on Google Cloud |
| Private connectivity for image registry and service endpoints | Available, Business Critical edition |
| Private egress connectivity (AWS, Azure, GCP) | Generally available, Business Critical edition |
| Data Connectivity Proxy (outbound-only tunnel to private data sources) | Available on AWS, Azure and Google Cloud |
| CORS configuration per service endpoint | Generally available |
| Restricted caller’s rights with caller grants | Available |
| Block storage with Tri-Secret Secure (TSS) support | Generally available |
Image repositories with SNOWFLAKE_FULL encryption (TSS-compatible) | Default on AWS and Azure |
| Programmatic Access Tokens (PAT) with role restriction and policy controls | Generally available |
| Compute pool and container metrics in the event table | Generally available |
| Workload Identity Federation (inbound, and outbound since July 2026) | Generally available |
| Native Apps + SPCS (AWS, Azure, GCP; AWS Virtual Private Snowflake since July 2026) | Generally available |
| FedRAMP on AWS for Native Apps with containers | Generally available |
If you only do one thing after reading this update, check who holds BIND SERVICE ENDPOINT in your account: since May 2026 the answer may be “everyone”.
Snowflake has kept security at the core of its container offering to more efficiently deploy and scale full-stack applications, LLMs, and other containerized workloads in a business and data owner trusted environment.
Parts of the security architecture sections in this article were inspired by a 2024 SPCS security white paper by Seth Youssef, Security Field CTO at Snowflake.
