URLs

Prev Next

In AppGate ZTNA, you typically use a TCP up action to allow or block connections. In that case, define destinations with dns:// or *.domain.com so the Gateway can resolve hostnames to IP addresses.

Alternatively, use URL access when you need to control access by URL instead of by IP and port. To use URL access, set the protocol type to HTTP up and define the host with an http:// or https:// prefix (for example, https://app1.company.com). URL access also supports websockets.


Using URL Access

URL access works as a reverse proxy on the Gateway. The Gateway terminates the client TLS connection, decrypts traffic to evaluate URLs and methods, and then creates a new TLS connection to the protected host. To do this, configure a PKCS#12 certificate bundle (certificate + private key). You can configure multiple PKCS#12 files. If you use a wildcard certificate, keep its scope as narrow as possible.  

NOTE

Configure the PKCS#12 file under Tunneling options in each Site before you create an entitlement that uses an an https:// host. Otherwise, you cannot save the entitlement.

URL access lets you control access by hostname even when multiple applications share the same IP address and port. This is useful for container platforms such as Kubernetes.

When you deploy URL access in front of a Kubernetes cluster, configure the cluster to accept inbound connections only from the AppGate Gateways. Kubernetes ingress is still required to route traffic to the correct services and pods. The Gateway only needs the external URLs users access

NOTE

To control traffic from pods in a Kubernetes environment, use the k8s service client.

Filter operation

URL access filtering follows these rules:

  • URL access matches URLs from left to right. For example, allowing https://application.web.my.co also allows https://application.web.my.co/page, but would not allow https://web.my.co.

  • URL access looks for the most specific match first. If there is no exact match, it evaluates rules that are closer to the URL root (for example, it checks https://application.web.my.co/page after it fails to match https://application.web.my.co/page/home.

  • Wildcards are not supported. For example, you cannot use https://application.web.my.co/*/page or https://application*.web.my.co.

  • Matching is case-sensitve. For example, if you allow https://application.web.my.co, then https://Application.web.my.co is blocked.

  • You cannot include http:// and https:// in the same action. Create separate actions within the same entitlement.

Method filtering

With HTTP up, you can also restrict access by HTTP method (for example, GET or POST). You can select multiple methods in a single action.

Configuration options for filtering by allowed methods when using the HTTP up protocol.

Use cases

Use URL access to control access to applications that share the same IP address and port (for example, apps behind a Kubernetes ingress):

  • Example: app1 to app10 are all hosted at 172.17.1.6:443. A TCP up rule cannot separate access per app. With URL access, you can allow https://app1.company.com and https://app7.company.com, and block the other apps on the same IP and port.

Because wildcards are not supported. explicitly allow every subdomain the app uses:

  • Example (GitHub Enterprise): You may need to allow multiple hosts, such as https://github.company.com, https://statics.github.company.com, https://gist.github.company.com, and https://binary.github.company.com.

URL access uses simple string matching. It is not application-aware and is not designed to secure individual pages within an application:

  • You can allow https://app1.company.com and block https://app1.company.com/admin. This can work, but it is not recommended because web apps often have multiple entry points (for example, REST APIs).

  • Allowing only a single path (for example, https://app1.company.com/admin) often breaks the app because pages typically load content from many other paths.

NOTE

When a BLOCK rule is encountered, the Gateway returns NGX_HTTP_FORBIDDEN 403. When an ALLOW rule is encountered but the user does not meet its condition, the Gateway returns NGX_HTTP_UNAUTHORIZED 401 until the condition is met.

URL access override

URL access adds overhead because the Gateway must decrypt and inspect traffic. As a result, throughput and concurrency can be lower than with TCP up. If some Gateways cannot handle the HTTP up load, you can configure those Gateways to use TCP up even when the action specifies HTTP up. Assign them a lower weighting so they are used only when other Gateways do not respond. This setting is available from the command line using cz-config commands.

Disable Source NAT on Gateways

With URL access (HTTP up), the Gateway acts as a reverse proxy. Even if Source NAT (SNAT) is disabled for the Site, the protected network sees the Gateway IP address as the source. AppGate IP access logs record the user and device details. The Gateway also adds the original client tunnel IP to an HTTP request header so the application can trace the user source IP.