Skip to content
Walkthrough: Settin...
 
Notifications
Clear all

Walkthrough: Setting up granular SaaS app controls in Zscaler Private Access.

2 Posts
2 Users
0 Reactions
32 Views
(@david_chen_data)
Honorable Member
Joined: 6 months ago
Posts: 401
Topic starter   [#10244]

While my primary focus is data infrastructure, the principle of least-privilege access is a cross-domain imperative. In migrating our analytics teams to a SASE model with Zscaler Private Access (ZPA), we needed to move beyond coarse-grained "application on/off" policies for SaaS tools like Snowflake, Looker, and our internal data catalog. The goal was to enable secure, direct-to-app access without a VPN, while enforcing context-aware controls *within* the application itself. This post details our implementation for granular SaaS access controls, using Snowflake as the primary example.

The core mechanism is ZPA's **IdP-initiated authentication flow combined with SCIM provisioning and custom SAML attributes**. Instead of simply granting access to the Snowflake application in ZPA, we use SAML assertions to pass user context (like group membership and role) to Snowflake, which then uses this to make fine-grained authorization decisions via its own RBAC.

**Architecture Overview:**
1. User authenticates via our corporate IdP (Okta).
2. ZPA acts as a SAML Service Provider (SP) proxy.
3. ZPA forwards the authentication to Snowflake (the SAML IdP), but injects additional SAML attributes.
4. Snowflake uses the received attributes to automatically map the user to specific warehouses, roles, and databases.

**Key Configuration Steps in ZPA:**

First, define the ZPA application segment for Snowflake with the correct domain and health check. The critical part is the SAML assertion configuration within the ZPA application's "Access Policy."

```xml

${user.department}

${user.primaryZscalerRole}

```

Second, in Snowflake, configure the SAML integration to accept and utilize these attributes. The `SNOWFLAKE` database's `ACCOUNT_USAGE` views can then be queried to audit the mappings.

```sql
-- Snowflake: Create a mapping rule in the SAML security integration
ALTER SAML2_SECURITY_INTEGRATION snowflake_zpa_integration SET
SAML2_SNOWFLAKE_ACS_URL = 'https://yourtenant.zscaler.net/saml_sso',
SAML2_SNOWFLAKE_ISSUER_URL = 'https://www.zscaler.com',
SAML2_SP_INITIATED_LOGIN_PAGE_LABEL = 'ZPA SSO',
SAML2_ENABLE_SP_INITIATED = TRUE;

-- Use a mapping rule to assign roles based on the incoming SAML attribute
CREATE OR REPLACE MAPPING "ZPA_DEPT_MAPPING"
FOR SNOWFLAKE.USER_ATTRIBUTES ATTRIBUTE_VALUE
AS SELECT
CASE
WHEN VALUE = 'data_engineering' THEN 'ENGINEER_ROLE'
WHEN VALUE = 'business_analytics' THEN 'ANALYST_ROLE'
ELSE 'READER_ROLE'
END AS ROLE_NAME;
```

**Lessons Learned & Benchmarks:**

* **Latency:** The additional SAML assertion parsing adds negligible overhead (<50ms). The dominant factor remains the user's proximity to the ZPA App Connector.
* **Policy Maintenance:** Centralizing policy in ZPA while delegating RBAC to the SaaS app reduces drift. We sync user groups from Okta to ZPA, and ZPA forwards them via SAML.
* **Troubleshooting:** Use ZPA's diagnostic tools (`/debug` on the app connector) and Snowflake's `SAML2_SIGNIN_LOG` to trace attribute flow. Mismatches here are the most common failure point.
* **Cost:** This approach does not consume additional ZPA "advanced" feature licenses, as it relies on standard SAML capabilities.

The outcome is a secure, performant data pipeline where an analyst in Berlin accesses Snowflake via the nearest App Connector in Frankfurt, is automatically granted the `ANALYST_ROLE` with specific warehouse permissions, and never touches the corporate network. This model has proven robust for other data SaaS tools like Looker (controlling access to specific Spaces/Dashboards) and Databricks (controlling workspace access).

--DC


data is the product


   
Quote
(@emmal)
Reputable Member
Joined: 3 months ago
Posts: 320
 

This is a great walkthrough. I've been trying to wrap my head around moving beyond simple app segmentation in ZPA for our support tools.

You mention ZPA injecting SAML attributes. I'm curious about a specific conflict point: how do you handle when the downstream SaaS app, like Snowflake in your case, expects a specific SAML attribute name or format that ZPA doesn't pass by default? Did you have to do a lot of transformation in the ZPA policy, or was the mapping mostly handled in your corporate IdP?

Our team uses Zendesk with similar goals, and the attribute mapping has been the trickiest part to get right without breaking existing SSO.



   
ReplyQuote