Configure Zscaler ZIA
Configure Zscaler ZIA URL categories, SSL inspection, and redirect rules to send package traffic to Artifactory for Package Traffic Controller (PTC).
Zscaler ZIA Configuration Guide
Disclaimer — Zscaler UI and releases: The procedure below reflects how JFrog configured Zscaler Internet Access (ZIA) in a lab to exercise PTC. Zscaler owns the Admin Portal, navigation, rule types, and defaults; those elements can change across Zscaler versions, SKUs, and tenants without JFrog’s involvement or advance notice. Treat this chapter as a conceptual walkthrough (custom URL category → SSL inspection for that category → URL filtering redirect to <YOUR_ARTIFACTORY_URL>/package-reroute) and always confirm labels, menus, and options against Zscaler’s current ZIA documentation and your Zscaler administrator. JFrog does not control Zscaler’s product and cannot warrant that every screen matches your console.
This section details the steps to configure Zscaler Internet Access (ZIA) to redirect developer traffic to your Artifactory instance. Complete Configure Artifactory for PTC before proceeding.
Important: Workstation trust for Zscaler TLS inspection must be in place before you turn on ZIA rules for registry traffic, otherwise installs break. Follow this order:
- Complete trust deployment per client and OS using
scripts/README.md, Zscaler’s trust guidance, and your process (MDM optional)—see Before Step 2: Verify trust stores for your package clients. - Recommend that developers open new terminal sessions or restart IDEs so updated environment variables apply (full machine reboot is optional, not required—old shells keep the previous env until closed).
- Then configure the ZIA rules in Step 1 through Step 4.
Complete the following procedures in order (after Configure Artifactory for PTC):
- Step 1: Create a Custom URL Category
- Before Step 2: Verify trust stores for your package clients
- Step 2: Enable SSL Inspection for the Category
- Step 3: Configure the Block & Redirect Rule
- Step 4: Save and Activate Changes
No-Inspection Rule for Artifactory Traffic (all deployments)
Create a no-inspection (SSL inspection bypass) rule in ZIA for traffic destined for your Artifactory hostname. For JFrog Cloud this is typically *.jfrog.io; self-hosted deployments use their own DNS name. This prevents ZIA from re-intercepting the redirected traffic on its way from the workstation to Artifactory, which would break the flow.
Reference: Public registry hostnames for the URL category
Add every HTTPS hostname your clients use for the package types you have enabled in Artifactory (Package Reroute / virtual repos). The table below lists typical defaults—confirm with TLS/SNI captures, package-manager docs, or Zscaler logs; corporate mirrors or private edge caches use different hosts. Scope must stay aligned with Supported Package Types (GA) and your entitlements.
| Package ecosystem | Common HTTPS hostnames | Notes |
|---|---|---|
| npm | registry.npmjs.org, registry.yarnpkg.com | Yarn (classic) and some installs still resolve the default registry via registry.yarnpkg.com—include it when Yarn is in scope alongside npm. Avoid accidental mismatch with npmjs.org unless you intend to cover both. |
| Python (PyPI) | pypi.org, files.pythonhosted.org | pip, Poetry, and uv often use both; include each you see in traffic. |
| Docker / OCI (e.g. Docker Hub) | registry-1.docker.io, index.docker.io | auth.docker.io is often redundant for routine image pulls (many environments never need it in the category); adding it does not hurt if you prefer a broader list or see auth-related misses in Zscaler logs. GHCR, Quay, ECR, Artifactory-on-prem registries, etc. each need their hostnames added when those clients are in scope. |
| Hugging Face | huggingface.co | Some clients use additional CDN-style hosts; extend the category if logs show misses. |
This list is not exhaustive for the open internet—it is a starting point for PTC lab validation. JFrog does not control public registry or CDN hostnames; they can change. Re-verify when upgrading clients or regions.
Step 1: Create a Custom URL Category
Define the public registries you want to intercept and route to Artifactory.
To create a custom URL category for PTC:
- Navigate to Administration > URL Categories.
- Click Add URL Category.
- Name: Enter a descriptive name, for example
JFrog_Target_Registries. - URLs: Enter the domains for each ecosystem you redirect—use the reference table above and Supported Package Types (GA). Example when only npm (+ Yarn) is in scope:
registry.npmjs.organdregistry.yarnpkg.com. - Click Save.
The custom URL category is ready for SSL inspection and URL filtering rules.
Before Step 2: Verify trust stores for your package clients
SSL inspection will apply to every hostname in your custom URL category (reference table). Before you enable it in ZIA, your organization must ensure workstations trust TLS through Zscaler for each package client and OS you actually intercept (npm, PyPI, Docker, and so on). The right variables, trust stores, and validation steps differ by product and version; this guide does not maintain that matrix.
Use the following sources of truth instead:
- Installation Script and the PTC repository
scripts/README.md— supported OSes, clients, environment variables, scripts, and tests - Zscaler: Adding Custom Certificate to an Application-Specific Trust Store (also linked from Prerequisites)
- Containers: Docker and Virtual Environments and Docker’s Using Docker with Zscaler when OCI registries are in scope
Have IT or platform engineering smoke-test real installs (the same commands your developers use) on representative machines before widening SSL inspection. After changing trust or environment configuration, new shell sessions pick up updates—see Deployment Sequence, step 3.
Step 2: Enable SSL Inspection for the Category
Critical Step: Zscaler must decrypt the HTTPS traffic destined for these registries to inject the HTTP Redirect header.
To enable SSL inspection for the registry URL category:
- Navigate to Policy > SSL Inspection.
- Click Add SSL Inspection Rule.
- Rule Name: Enter a descriptive name, for example
Inspect_JFrog_Registries. - Rule Order: Ensure this rule is placed above any default rules that might bypass inspection.
- URL Categories: Select the category created in Step 1 (
JFrog_Target_Registries). - Action: Select Inspect.
- Click Save.
SSL inspection applies to traffic matching your PTC URL category.
Scoped Deployment (Optional): To limit SSL inspection to a specific group (e.g., R&D):
- In the same SSL Inspection rule, locate the Groups field.
- Select your target group (e.g.,
R&D).
This ensures that only traffic from the selected group is inspected for redirection.
Step 3: Configure the Block & Redirect Rule
This step implements the routing logic. Zscaler "blocks" the request to the public registry but immediately provides a redirect response pointing to your Artifactory instance.
To create the block and redirect URL filtering rule:
- Navigate to Policy > URL & Cloud App Control > URL Filtering Policy.
- Click Add URL Filtering Rule.
- Rule Name: Enter a descriptive name, for example
Redirect_Registries_to_JFrog. - URL Categories: Select the category created in Step 1 (
JFrog_Target_Registries). - Protocols: Choose HTTPS.
- Request Methods (crucial):
- Select GET and HEAD.
- Do not select POST. Commands like
npm audituse POST and must not be redirected, or they will fail. - Set User Agent to Other.
- Action: Select Block.
- Redirect URL: Enter your Artifactory redirect endpoint. Zscaler appends the original destination URL as the
urlquery parameter (typically percent-encoded, consistent with thecurlexamples in Step 6: Verify the Redirect Endpoint).- Value:
<YOUR_ARTIFACTORY_URL>/package-reroute(no trailing slash before the query string) - Example:
https://<YOUR_ARTIFACTORY_URL>/package-reroute— Zscaler appends?url=<percent-encoded-upstream>(product-defined path; not configurable)
- Value:
- Click Save and Activate Change.
Registry GET traffic is redirected to your Artifactory /package-reroute endpoint.
Scoped Deployment (Optional): To limit the redirect rule to a specific group:
- In the same URL Filtering rule, locate the Groups field.
- Select your target group (e.g.,
R&D).
Step 4: Save and Activate Changes
To save and activate ZIA policy changes:
- Review all rules in the correct order:
- SSL Inspection rule (Step 2) must be above default bypass rules.
- URL Filtering rule (Step 3) must be active.
- Click Activate Change if you have not already done so in Step 3.
- Allow a few minutes for the policy to propagate to all Zscaler enforcement nodes.
ZIA policies are active and ready for end-to-end verification on pilot workstations.
Traffic Flow After Configuration
Once configured, the flow operates as follows:
- Request: Developer runs
npm install. The client requestshttps://registry.npmjs.org/package. - Interception: Zscaler intercepts the request via SSL Inspection.
- URL Match: Zscaler matches the URL against the
JFrog_Target_Registriescategory. - Redirect: Zscaler blocks the direct access and returns an HTTP 307 Redirect to:
<YOUR_ARTIFACTORY_URL>/package-reroute?url=https%3A%2F%2Fregistry.npmjs.org%2Fpackage- Resolution: The JFrog Artifactory parses the request and serves the package from the appropriate remote repository.
Scoped Deployment Summary:
| User Group | Action | Result |
|---|---|---|
| Target group (e.g., R&D) runs package install | Intercepted | Zscaler decrypts and redirects requests to JFrog Artifactory |
| Other users run package install | Ignored | Traffic hits the default ZIA policy (allowed directly to the public registry) |
End-to-End Verification
After both Artifactory and ZIA are configured, verify the full flow with ZCC running on a developer workstation and all Zscaler rules active:
npm install express --loglevel verboseWhere:
express: A public npm package used as a smoke-test artifact
For example:
npm install lodash --loglevel verboseIn the verbose log, look for HTTP GET lines whose URL points at your Artifactory host (for example acme.jfrog.io and your npm-virtual-registry API path), not only at registry.npmjs.org—that confirms the client followed the redirect into JFrog. The install should complete successfully. Also verify by checking:
- Artifactory UI: Navigate to the remote NPM repository. The
expresspackage should appear in the cached artifacts. - If Curation is enabled for that remote: Navigate to Curation > Audit—you should see an entry for the
expresspackage request with an Approved status (if Curation is off, there will be no Curation audit row; that is expected).
Frequently Asked Questions
This section provides answers to frequently asked questions about configuring Zscaler ZIA for Package Traffic Controller (PTC).
FAQs
Q: Why must ZIA redirect rules exclude POST requests?
A: Commands such as npm audit send POST to registry hosts. Redirecting POST breaks those commands. Configure URL filtering for GET and HEAD only. See Step 3: Configure the Block & Redirect Rule.
Q: Which hostnames belong in the custom URL category?
A: Add every HTTPS hostname your clients use for enabled package types—for example registry.npmjs.org for npm. See Reference: Public registry hostnames for the URL category.
Q: Must I configure Artifactory before enabling ZIA rules?
A: Yes. Artifactory repositories, Package Reroute registration, and anonymous access must be ready before SSL inspection and redirect rules intercept traffic. See Configure Artifactory for PTC.
Q: Why bypass SSL inspection for Artifactory traffic?
A: A no-inspection rule for your Artifactory hostname prevents ZIA from re-intercepting redirected traffic on the path to Artifactory. See No-Inspection Rule for Artifactory Traffic (all deployments).
Related Topics
Updated 2 days ago
