Hi Friends,
I want to share this example with the community because this is a common request these days.
Below is a PAC file to apply to your Win/Mac ZCC profile if you want to prevent your users from connecting to the Russia ZEN node.
The example below is for “zscalertwo” cloud with Russian ZEN node IP: 165.225.90.24 . To use this PAC file, you need to use your “cloudname” and obtain your Russian ZEN node IP.
How it works: the PAC compares if the variables ${GATEWAY} or ${SECONDARY_GATEWAY} are equal to the Russian ZEN node IP. If yes, the variable “tozscaler” is changed to “PROXY fra4.sme.zscalertwo.net:80; PROXY muc1.sme.zscalertwo.net:80”; (you can put here the ZEN nodes you want. In this case, are Frankfurt and Munich)
Here the PAC:
function FindProxyForURL(url, host) {
// =========================================================
// Section 1: Zscaler standard PAC values
var privateIP = /^(0|10|127|192\.168|172\.1[6789]|172\.2[0-9]|172\.3[01]|169\.254|192\.88\.99)\.[0-9.]+$/;
var resolved_ip = dnsResolve(host);
/* Don't send non-FQDN or private IP auths to us */
if (isPlainHostName(host) || isInNet(resolved_ip, "192.0.2.0", "255.255.255.0") || privateIP.test(resolved_ip))
return "DIRECT";
/* FTP goes directly */
if (url.substring(0, 4) == "ftp:")
return "DIRECT";
/* test with ZPA */
if (isInNet(resolved_ip, "100.64.0.0", "255.255.0.0"))
return "DIRECT";
// =========================================================
// Traffic to Zscaler Two - Restrict Russia ZEN node - 165.225.90.24
// Direct to Internet
var tozscaler = "PROXY ${GATEWAY}:80; PROXY ${SECONDARY_GATEWAY}:80; DIRECT";
// Get $GATEWAY address
var gatewayZenIP = "165.225.90.24:80";
var gatewayReturned = "${GATEWAY}";
var SecondaryGatewayReturned = "${SECONDARY_GATEWAY}";
// Changing values to "tozscaler" if the user gets Russia ZEN Nodes.
if ((gatewayZenIP == gatewayReturned) || (gatewayZenIP == SecondaryGatewayReturned)) {
var tozscaler = "PROXY fra4.sme.zscalertwo.net:80; PROXY muc1.sme.zscalertwo.net:80";
}
// =========================================================
// Section 4: Default Traffic
/* Default Traffic Forwarding. Forwarding to Zen on port 80, but you can use port 9400 also */
return tozscaler;
}
Finally, you need to configure the PAC URL on the ZCC Win/MAc profile, section PAC Configuration → Custom PAC URL.
Thanks to @Trace_Woodbury for the testing done.
Best regards
Adrian Larsen
Maidenhead Bridge
Cloud Security Connectors for Zscaler.