PTC Quick Start
Set up Package Traffic Controller (PTC) for a first pilot: Artifactory, workstations, and security edge redirect rules.
This Quick Start gets PTC running end-to-end in three ordered phases: configure Artifactory, prepare workstations, then activate your security edge redirect rules. For prerequisites, exhaustive options, and per-vendor portal steps, follow the inline links and Where to Go When You Need More Detail.
For background on what PTC does and how it integrates with your security edge, see the Package Traffic Controller (PTC) overview.
Required Components
PTC deployment involves the following three components. Each must be configured correctly for the integration to work end to end.
| Component | Who owns it | What it needs |
|---|---|---|
| Artifactory | JFrog admin | Remote repo per package type, Package Reroute API mapped |
| Workstations | IT / endpoint team | Traffic forwarded to your security edge, security edge CA cert trusted by each package manager |
| Security edge | Network / security team | Rule to intercept the registry hostnames and redirect them to Artifactory (objects differ per vendor) |
The Setup, Step by Step
To deploy PTC end to end:
Step 1: Configure Artifactory
Note: Curation must be enabled in Artifactory before you call the Package Reroute API. The API auto-enrolls the target remote repository in Curation by default (
linked_curation: true); sendlinked_curation: falseto skip Curation enrollment.
For each package type you want to govern (npm, PyPI, Docker, Hugging Face):
1. Create a remote repository pointing at the public registry.
- Example: an npm remote called
npm-remote-registrywith upstream URLhttps://registry.npmjs.org.
For detailed steps, see Step 1: Create a Remote Repository.
2. Make sure JFrog Curation is enabled in your Artifactory instance. The Package Reroute API in the next sub-step auto-enrolls the repository in Curation by default. See Configure JFrog Curation.
3. Register the repo with Package Reroute using the Update Registry Configuration API:
curl -X PUT "https://<YOUR_ARTIFACTORY_URL>/artifactory/api/package-reroute/config/npm" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"repo_key": "npm-remote-registry"}'Repeat for each ecosystem, replacing npm with pypi, docker, huggingfaceml, gems, or cargo. This call is mandatory; PTC does not work without it. See Step 3: Register Repositories with Package Reroute.
4. Smoke test the redirect endpoint before touching your security edge:
curl -v "https://<YOUR_ARTIFACTORY_URL>/artifactory/api/package-reroute?url=https%3A%2F%2Fregistry.npmjs.org%2Fexpress"You should see an HTTP 302 or 307 response with a Location header pointing at your Artifactory repo path. If you do, Artifactory is ready. See Step 4: Verify the Redirect Endpoint.
Step 2: Prepare Workstations
Each developer machine needs two things:
- A way to route its traffic to your SASE provider, usually a SASE provider's client/forwarder on the workstation. See your SASE provider's guide in Supported Security Edges for the vendor-specific client.
- The security edge CA certificate trusted by every package manager that will be intercepted (npm, pip, Docker, and so on).
Open-source installation scripts available
The package-reroute repository ships ready-to-use scripts that automate CA certificate installation and environment variable setup across macOS, Windows, and Linux for npm, pip, and other clients. Adapt them to your environment before broad rollout.
The CA must be added to application-specific trust stores or environment variables where applicable. The PTC repository ships installation scripts that automate this; adapt them to your environment.
You can distribute the cert via MDM (Intune, Jamf), an imaging script, or manually. MDM is optional.
For trust store requirements per client and OS, see Configure Workstation for PTC.
Test PTC with npm — Manual Workstation Setup (single machine)
Use this procedure to verify PTC is working on a single workstation before running the full installation script. It covers npm only and takes under five minutes.
Before you start:
- Your SASE client must already be configured and running on your machine.
- Artifactory must already be configured for PTC (the Package Reroute API must be set up with an npm remote repository).
- npm must be installed.
Step A — Export the SASE CA Certificate
Your SASE client installs its CA certificate into your OS trust store when it connects. This step extracts it into a file that npm can read.
macOS — run this in Terminal:
security find-certificate -a -p \
/System/Library/Keychains/SystemRootCertificates.keychain \
/Library/Keychains/System.keychain \
> ~/package-route.pemThis exports all trusted root CAs (including your SASE provider's CA) into a single file at ~/package-route.pem. No sudo needed.
Verify Step A succeeded:
Check the file exists and has content:
grep -c 'BEGIN CERTIFICATE' ~/package-route.pemYou should see a number around 100–150. If you get 0 or a "no such file" error, Step A failed.
Check your SASE CA is in the bundle:
openssl crl2pkcs7 -nocrl -certfile ~/package-route.pem | \
openssl pkcs7 -print_certs -noout | \
grep -i "zscaler\|netskope\|cloudflare"You should see at least one line with your SASE provider's name. If you get no output, your SASE client may not be connected — check that it shows as active, then re-run Step A.
Linux — your SASE admin must provide the CA certificate as a .pem file. Use that file path wherever ~/package-route.pem appears below.
Windows — run this in PowerShell (no administrator needed):
First, find your SASE certificate in the Windows cert store (replace Zscaler with your SASE provider name):
Get-ChildItem Cert:\LocalMachine\Root |
Where-Object { $_.Subject -like "*Zscaler*" } |
Select-Object Subject, ThumbprintYou should see one result. If you see none, try -like "*Netskope*" or -like "*Cloudflare*", or ask your IT team what name the certificate is registered under.
Then export that certificate to a PEM file:
$cert = Get-ChildItem Cert:\LocalMachine\Root |
Where-Object { $_.Subject -like "*Zscaler*" } |
Select-Object -First 1
("-----BEGIN CERTIFICATE-----`n" +
[Convert]::ToBase64String($cert.RawData, 'InsertLineBreaks') +
"`n-----END CERTIFICATE-----") |
Set-Content "$env:USERPROFILE\package-route.pem" -Encoding utf8This creates the file at C:\Users\<you>\package-route.pem.
Step B — Tell npm to Trust the Certificate
Set the NODE_EXTRA_CA_CERTS environment variable in your current terminal session. This does not change any permanent settings on your machine.
macOS / Linux:
export NODE_EXTRA_CA_CERTS=~/package-route.pemWindows (PowerShell):
$env:NODE_EXTRA_CA_CERTS = "$env:USERPROFILE\package-route.pem"Step C — Confirm the SASE Redirect Rule Is Active
Ask your SASE admin to confirm that the redirect rule for registry.npmjs.org is enabled and scoped to your machine. If it is not set up yet, point them to the relevant SASE provider guide in Supported Security Edges.
Important: Do this after Step B. If the redirect rule is active before your workstation is configured, npm will fail with an SSL error.
Step D — Run a Test Install
In the same terminal window, run:
npm install express --loglevel verboseThe install should complete normally. If it fails with an SSL error, see the troubleshooting notes below.
Step E — Confirm the Request Went Through PTC
In the verbose output, look for GET requests going to your Artifactory hostname instead of registry.npmjs.org:
npm http fetch GET 200 https://<your-artifactory>/artifactory/api/npm/<repo-key>/express 350msIf you see your Artifactory hostname, PTC is working — the SASE provider intercepted the request and rerouted it through Artifactory.
Troubleshooting
SSL error during npm install
The certificate file is not being picked up. Check:
- The env var is set in this terminal: run
echo $NODE_EXTRA_CA_CERTS(macOS/Linux) or$env:NODE_EXTRA_CA_CERTS(Windows). It must show the path topackage-route.pem. - The file exists and is not empty: run
ls -lh ~/package-route.pem(macOS/Linux) orGet-Item "$env:USERPROFILE\package-route.pem"(Windows). - On macOS, if the file is empty, your SASE client may not be connected. Check that it shows as connected and re-run Step A.
Artifactory hostname not appearing in verbose output
The request was not rerouted. Check:
- Your SASE client is connected and signed in.
- The SASE redirect rule is active and covers
registry.npmjs.org(see Step C). - The redirect rule is scoped to include your machine or group.
- Artifactory has been configured with the npm repo via the Package Reroute Config API.
The npm install was rerouted but Curation blocked the package
This is expected behavior when a Curation policy violation is detected. Check your Curation policy in Artifactory under Curation > Audit to understand why the package was blocked.
Step 3: Activate Security Edge Redirect Rules
Configure your security edge to intercept the public-registry hostnames in scope and redirect them to your Artifactory /artifactory/api/package-reroute endpoint. The exact objects differ per vendor. Follow the guide for your security edge:
- Zscaler ZIA: URL category + SSL inspection rule + URL filtering redirect rule. See Configure Zscaler ZIA.
- Netskope: destination profiles + HTTP header profiles + real-time protection policies (Allow for browsers, Redirect for package-manager traffic). See Configure Netskope.
- Cloudflare Gateway: TLS inspection + firewall redirect policies. See Configure Cloudflare Gateway.
General guidance that applies to any security edge:
- Match only the registry hostnames in scope (per ecosystem).
- Inspect or decrypt that traffic so the redirect can be applied.
- Redirect matching requests to
https://<YOUR_ARTIFACTORY_URL>/artifactory/api/package-reroute. - Configure request methods per ecosystem. Keep POST off where it would cause commands like
npm auditto fail. - If your security edge also inspects traffic to Artifactory, exclude the Artifactory host from the redirect rule so redirected traffic is not re-intercepted (avoids a loop). Inspecting Artifactory traffic itself is fine if you want it.
Save and activate. Allow a few minutes for the policy to propagate.
For the full per-vendor steps, see your SASE provider's guide in Supported Security Edges.
Verify End-to-End
On a workstation with the security edge client running and all rules active:
npm install express --loglevel verboseIn the verbose log, look for HTTP GET lines pointing at your Artifactory hostname (for example, acme.jfrog.io) rather than registry.npmjs.org — that confirms the redirect. Then confirm the express package appears in your remote repo's cached artifacts, and (if Curation is enabled) an Approved entry appears under Curation > Audit.
Setup Checklist
Confirm these items are in place before enabling redirect rules for a pilot group.
☐ Remote repo per package type
☐ Remote repo per package type
☐ Package Reroute API mapped
☐ /artifactory/api/package-reroute returns 302/307
☐ JFrog Curation enabled in Artifactory (auto-enrolled per repo by the API; opt out with linked_curation: false)
☐ Traffic forwarded to your security edge
☐ Security edge CA trusted in OS and application trust stores
☐ Registry hostnames to intercept defined
☐ Traffic inspection/decryption enabled
☐ Redirect rule to /artifactory/api/package-reroute
☐ Request methods configured per ecosystem
☐ Artifactory host excluded from redirect (if you also inspect Artifactory traffic)
☐ Rules scoped to pilot group first
Common Misconfigurations to Avoid
- Activating redirect rules before Artifactory is ready — installs fail until Artifactory is fully configured. Sequence Artifactory first; see Deployment Sequence.
- Redirecting Artifactory's own traffic — if your security edge also inspects Artifactory traffic, exclude the Artifactory host from the redirect rule to avoid a loop.
- Skipping the Package Reroute API call — creating the remote repo alone is not enough; the API mapping is mandatory.
- Redirecting the wrong HTTP methods — causes commands like
npm auditto fail. Use the per-ecosystem method tables. - Going org-wide on day one — roll out gradually using your security edge group controls.
Where to Go When You Need More Detail
| Topic | Page |
|---|---|
| Deployment order and phased rollout | Deploy and Roll Out PTC |
| Prerequisites and installation scripts | Prerequisites and Installation Script |
| Artifactory configuration (all steps) | Configure Artifactory for PTC |
| Package Reroute Config API reference | Package Reroute Config API |
| SASE provider portal steps (choose your vendor) | Supported Security Edges |
| Per-ecosystem setup (npm, PyPI, Docker, Hugging Face) | Configuration by Package Type |
| Known limitations and troubleshooting | Limitations and Troubleshooting |
Related Topics
Updated 5 days ago
