Copyright © 1996-2024 Balasys IT Zrt. (Private Limited Company)
May 30, 2024
Abstract
This tutorial describes how to configure Zorp to proxy HTTPS traffic
Table of Contents
This tutorial provides guidelines for Zorp administrators on how to enable proxying HTTP traffic embedded into secure SSL and TLS connections. Knowledge in TCP/IP and Zorp administration is required to fully comprehend the contents of this paper. The procedures and concepts described here are applicable to version 7 of Zorp. Detailed information is provided to configure Zorp both from Zorp Management Console and using Python scripts.
Note that explaining the concepts of the different aspects of SSL/TLS proxying is beyond the scope of this tutorial. For background information, see the following documents:
For details on deriving and modifying proxies, see Section 6.6, Proxy classes in Zorp Professional 7 Administrator Guide.
For details on configuring Zorp proxies to handle SSL/TLS connections, see How to configure SSL proxying in Zorp 7.
For an overview on certificates and related topics in connection with Zorp, see Chapter 11, Key and certificate management in Zorp in Zorp Professional 7 Administrator Guide.
For details on the available attributes of the Zorp HTTP proxy that you can adjust and modify to best suit your needs, see Section 4.7, Module Http in Zorp Professional 7 Reference Guide
You can download the above documents at the Balasys Documentation Page.
Zorp can be fully configured using either the graphical Zorp Management Console (ZMC) or manually by editing plain text Python configuration files. The suggestions and the background information provided in this tutorial are equally applicable to both methods. Step-by-step explanation with screenshots are given for ZMC-based configuration, while sample Python code lines can be found at the end of each step. After replacing the sample parameters (for example, IP addresses) with the proper ones for the actual configuration, add these lines to the policy file of Zorp (usually found under /etc/zorp/policy.py
). Also pay attention to the proper indentation of Python code lines. For more details, see Chapter 10, Local firewall administration in Zorp Professional 7 Administrator Guide.
If Zorp Management Console is used and the Python code generated by ZMC needs to be displayed, select a host, then select from the main menu.
For proxying HTTPS connections, a properly configured HTTP proxy is required. The HTTP proxy will handle the external SSL/TLS connection and analyze the HTTP traffic embedded into the encrypted SSL/TLS channel. Two basic scenarios — a transparent and a non-transparent one — will be discussed.
The best way is to derive own proxy classes from the default ones and modify their parameters as required. For details on deriving and modifying proxies, see Section 6.6, Proxy classes in Zorp Professional 7 Administrator Guide.
Purpose:
To proxy HTTPS connections, configure an Encryption Policy to handle SSL/TLS connections, and use this Encryption Policy in your Service. The policy will be configured to:
Require the client and the server to use strong encryption algorithms, the use of weak algorithms will not be permitted.
Enable connections only to servers with certificates signed by CAs that are in the trusted CAs list of the Zorp firewall node. (For details on managing trusted CA groups, see Section 11.3.7.3, Managing trusted groups in Zorp Professional 7 Administrator Guide.)
The clients will only see the certificate of Zorp. To allow the clients to access the certificate information of the server, see Procedure 2.2, Configuring keybridging in How to configure SSL proxying in Zorp 7.
Steps:
Generate a certificate for your firewall. The Zorp component requires its own certificate and keypair to perform SSL/TLS proxying.
ZMC: Create a certificate, set the firewall as the owner host of the certificate, then distribute it to the firewall host. For details, see Chapter 11, Key and certificate management in Zorp in Zorp Professional 7 Administrator Guide.
Python: In configurations managed manually from python, create an X.509 certificate (with its related keypair) using a suitable software (for example, OpenSSL) and deploy it to the Zorp firewall host (for example, copy it to the /etc/key.d/mycert
folder).
Create and configure an Encryption Policy. Complete the following steps.
Navigate to the ZMC component of the firewall host.
Select
.Enter a name into the MyTLSEncryption
.
Select
, then click OK.Select
.Python:
EncryptionPolicy( name="MyTLSEncryption", encryption=TwoSidedEncryption() )
Double-click
, then select .Double-click the
and click to add a certificate entry to a list of certificates.Double-click the Zorp is required to show to the clients (for example, the certificate created in Step 1), then click .
. A window displaying the certificates owned by the host will open up. The lower section of the window shows the information contained in the certificate. Select the list of certificatesPython:
encryption=TwoSidedEncryption( client_certificate_generator=StaticCertificate( certificates=( Certificate.fromFile( certificate_file_path="/etc/key.d/ZMS_Engine/cert.pem", private_key=PrivateKey.fromFile( "/etc/key.d/ZMS_Engine/key.pem") ), ) ) )
If the private key of the certificate is password-protected, double-click
, type the password, then click OK. Otherwise, click OK.Disable mutual authentication. That way, Zorp will not request a certificate from the clients.
Double-click
, select , then click OK.Python:
encryption=TwoSidedEncryption( client_verify=None )
Specify the directory containing the certificates of the trusted CAs. These settings determine which servers can the clients access: the clients will be able to connect only those servers via SSL/TLS which have certificate signed by one of these CAs (or a lower level CA in the CA chain).
Double-click /etc/ca.d/certs/
. Click OK.
Python:
encryption=TwoSidedEncryption( server_verify=ServerCertificateVerifier( ca_directory="/etc/ca.d/certs/" ) )
Note |
---|
CAs cannot be referenced directly, only the trusted group containing them. For details on managing trusted groups, see Section 11.3.7.3, Managing trusted groups in Zorp Professional 7 Administrator Guide. |
Specify the directory containing the CRLs of the trusted CAs.
Double-click /etc/ca.d/crls/
. Click OK.
Python:
encryption=TwoSidedEncryption( server_verify=ServerCertificateVerifier( ca_directory="/etc/ca.d/certs/", crl_directory="/etc/ca.d/crls/" ) )
Optional Step: The Common Name in the certificate of a server or webpage is usually its domain name or URL. By default, Zorp compares this Common Name to the actual domain name it receives from the server, and rejects the connection if they do not match. That way it is possible to detect several types of false certificates and prevent a number of phishing attacks. If this mode of operation interferes with your environment, and you cannot use certificates that have proper Common Names, disable this option.
Double-click FALSE
, then click OK.
Python:
encryption=TwoSidedEncryption( server_verify=ServerCertificateVerifier( ca_directory="/etc/ca.d/certs/", crl_directory="/etc/ca.d/crls/", check_subject=FALSE ) )
Optional Step: Forbid the use of weak encryption algorithms to increase security. The related parameters can be set separately for the client and the server-side of Zorp, using the and parameters of the Encryption Policy. Disabling weak algorithms also eliminates the risk of downgrade attacks, where the attacker modifies the SSL session-initiation messages to force using weak encryption that can be easily decrypted by a third party.
Note |
---|
Certain outdated operating systems, or old browser applications do not properly support strong encryption algorithms. If your clients use such systems or applications, it might be required to permit weak encryption algorithms. |
SSL methods may occasionally fall back to older (thus weaker) protocol versions if one of the peers does not support the newer version. To avoid this situation, explicitly disable undesired protocol versions (SSLv2 and SSLv3 are disabled by default).
For example, to disable TLSv1, double-click TRUE
, then click OK. Repeat this step for the parameter.
Python:
encryption=TwoSidedEncryption( server_ssl_options=ServerSSLOptions( disable_tlsv1=TRUE) client_ssl_options=ClientSSLOptions( disable_tlsv1=TRUE) )
Optional Step: Enable untrusted certificates. Since a significant number of servers use self-signed certificates (with unverifiable trustworthiness), in certain situations it might be needed to permit access to servers that have untrusted certificates.
Note |
---|
When an untrusted certificate is accepted, the generated certificates will be signed with the untrusted CA during keybridge scenarios. For details on configuring keybridging, see Procedure 2.2, Configuring keybridging in How to configure SSL proxying in Zorp 7 |
Double-click UNTRUSTED
, then click OK.
Note |
---|
When the |
Python:
encryption=TwoSidedEncryption( server_verify=ServerCertificateVerifier( trust_level=TLS_TRUST_LEVEL_UNTRUSTED ) )
Python:
The Encryption Policy configured in the previous steps is summarized in the following code snippet.
EncryptionPolicy( name="MyTLSEncryption", encryption=TwoSidedEncryption( client_verify=ClientNoneVerifier(), client_ssl_options=ClientSSLOptions(), server_verify=ServerCertificateVerifier( trust_level=TLS_TRUST_LEVEL_FULL, intermediate_revocation_check_type = TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL, leaf_revocation_check_type = TLS_LEAF_REVOCATION_SOFT_FAIL, trusted_certs_directory="", verify_depth=4, verify_ca_directory="/etc/ca.d/certs/", verify_crl_directory="/etc/ca.d/crls/", check_subject=TRUE ), server_ssl_options=ServerSSLOptions(), client_certificate_generator=StaticCertificate( certificates=( Certificate.fromFile( certificate_file_path= "/etc/key.d/ZMS_Engine/cert.chain.pem", private_key=PrivateKey.fromFile( "/etc/key.d/ZMS_Engine/key.pem")), )) ))
Select
.Note when managing Zorp without ZMC, copy the certificates and CRLs to their respective directories. They are not updated automatically as in configurations managed by ZMC.
By performing the above steps, the proxy has been configured to use the specified certificate and its private key, and also the directory has been set that will store the certificates of the trusted CAs and their CRLs. Client authentication has also been disabled.
Create a service that clients can use to access the Internet in a secure channel. This service will use the MyTLSEncryption
Encryption Policy.
Select intra_HTTPS_inter
), then click OK.
Select
.Select
.Configure the other parameters of the service as neecessary for the environment, then click
.Select Section 6.5, Configuring firewall rules in Zorp Professional 7 Administrator Guide.
, and select the service created in the previous step. For more details on creating firewall rules, seeConfigure the other parameters of the rule as necessary for the environment, then click
.Python:
def demo() : Service( name='demo/intra_HTTPS_inter', router=TransparentRouter(), chainer=ConnectChainer(), proxy_class=HttpProxy, max_instances=0, max_sessions=0, keepalive=Z_KEEPALIVE_NONE, encryption_policy="MyTLSEncryption" ) Rule( rule_id=300, src_subnet=('192.168.1.1/32', ), dst_zone=('internet', ), proto=6, service='demo/intra_HTTPS_inter' )
Commit and upload the changes, then restart Zorp.
Expected result:
Every time a client connects to a server, Zorp checks the certificate of the server. If the signer CA is trusted, Zorp shows a trusted certificate to the client (browser or other application). If the certificate of the server is untrusted, Zorp shows an untrusted certificate to the client, giving a warning to the user. The user can then decide whether the certificate can be accepted or not.
Purpose:
The method described in Procedure 2.1, Enabling SSL-encryption in the connection can be used when the connections of the clients are proxied transparently. In the non-transparent case, use two HttpProxy classes. (A connection is non-transparent if the clients address the firewall host directly, and Zorp selects the target.)
Steps:
Create and configure a transparent Http proxy to handle HTTPS connections as described in Steps 1-4 of Procedure 2.1, Enabling SSL-encryption in the connection. If a transparent HTTPS proxy has already been created and configured, skip this step.
Navigate to HttpProxyNonTransparent
proxy class. Name this new class, for example, HttpSProxyNonTransparent
.
Select this newly created proxy (for example, HttpSProxyNonTransparent
) and add the self.request
attribute to the panel. To configure the self.request
attribute, complete the following steps.
Select the attribute and click
.To accept every request types, enter the *
(asterisk) character, then click OK.
Alternatively, you can add the request types you want to permit. It is recommended to enable the GET, POST, HEAD, and CONNECT requests.
Click on the text in the const_http_req_accept
.
Add the self.connect_proxy
attribute to the panel, then click . Select the proxy to be used for the HTTPS connections from the appearing list (for example, StrongHttpsProxy).
Note |
---|
This proxy is needed to handle the SSL data communicated in the plain-text nontransparent HTTP connection. If you do not want to examine that this traffic is indeed HTTP traffic, use a simple PlugProxy configured to handle SSL connections as well. |
Python:
class HttpSProxyNonTransparent(HttpProxyNonTransparent): def config(self): HttpProxyNonTransparent.config(self) self.connect_proxy=StrongHttpsProxy self.request["*"]=HTTP_REQ_ACCEPT
Create a service that clients can use to access the Internet in a secure channel. This service will use the non-transparent Http proxy class (for example, HttpSProxyNonTransparent
) created in Step 2.
Create a service that clients can use to access the Internet.
Select intra_HTTP_inter
).
Select
.Select a
for the service. Note the following points:When non-transparently proxying HTTP traffic without any parent proxy, the Service must use InbandRouter.
If a parent proxy is used (that is, the clients connect to a web proxy like Squid through Zorp), DirectedRouter or InbandRouter can be used. InbandRouter can only be used if the parent_proxy
and parent_proxy_port
parameters are properly configured. If the firewall host is located network-transparently in front of the proxy server, even TransparentRouter can be used. For further details on Routers, see Section 6.4.5, Routing — selecting routers and chainers in Zorp Professional 7 Administrator Guide.
Configure the other parameters of the service as needed for your environment, then click
.Select
, and select the service created in the previous step.Note |
---|
|
Configure the other parameters of the rule as needed for your environment, then click
.Commit and upload the changes, then restart Zorp.
This section shows how to solve various tasks and problems using one-sided HTTPS connections — sometimes encryption is only required on the client (or the server) side, for example, to decrease the load on the servers (SSL-offloading).
Note that certain issues and side-effects might need to be addressed when using one-sided SSL. These are discussed in Section 3.2, Solving problems in one-sided HTTPS connections.
Purpose:
To disable encryption on one side of the connection for an existing Encryption Policy that is configured to handle HTTPS connections, complete the following steps.
Note |
---|
Obviously it is not possible to use keybridging together with one-sided SSL connections, but for a possible solution, see Procedure 3.2.3, Transferring certificate information in one-sided HTTPS. |
Steps:
Navigate to OnesidedHttpsProxy
).
To disable encryption on the client side, add the self.ssl.client_connection_security
parameter to the panel, then set it to const_ssl_none
.
To disable encryption on the server side, add the self.ssl.server_connection_security
parameter to the panel, then set it to const_ssl_none
.
Python: Add one of the following lines to proxy:
self.ssl.server_connection_security = SSL_NONE self.ssl.client_connection_security = SSL_NONE
When Zorp is used to protect the servers, you must deploy the certificate of the server (including its private key) to Zorp, so that Zorp can show the certificate to the clients that connect to the server. The proxy used in the connection must be configured to use this certificate when communicating with the clients. Complete the following steps.
Import the certificate of the server into ZMS, and set the firewall to be its owner host. For details, see Procedure 11.3.8.6, Importing certificates in Zorp Professional 7 Administrator Guide.
Navigate to OnesidedHttpsProxy
).
Select (or add, if not already present) the self.ssl.server_keypair_files
parameter, then click .
A window showing the certificates available on the host appears. Select the certificate of the server.
Note |
---|
The list displays only the certificates where the firewall host is set as the owner host of the certificate (that is, both the certificate and its private key is available). |
Using absolute URLs in one-sided SSL communication can pose problems and should be avoided whenever possible (relative links will work without any problem). A URL starts with http://www...
on the non-encrypted side should be https://www...
on the encrypted side. Certain applications can be configured to use HTTPS links in the HTTP requests instead of normal HTTP. If your environment uses an application that cannot be configured this way, see the following procedures for a possible solution.
Purpose:
Outlook Web Access (OWA) can generate HTTPS links if it receives a special header in the request. This header notifies OWA that it is located behind an HTTPS frontend. Zorp can be configured to insert this header automatically. Complete the following steps.
Steps:
Navigate to OWAHttpProxy
) from an Http proxy configured to handle one-sided SSL connections.
Add the self.request_header
attribute to the panel.
Select the newly added attribute, then select
.Enter Front-End-Https
for the key name. This will be the name of the header inserted into the requests.
Select the type_http_hdr_insert
.
Click qstring
in its Type column).
Click on
. This will be the content of the inserted header.
Python:
self.request_header["Front-End-Https"]=(HTTP_HDR_INSERT, "on")
Create a service that will use this new proxy (for example, OWAHttpProxy
).
Purpose:
If a server application does not support secure connections, or uses absolute links and this behavior cannot be modified, Zorp can change the URLs in the traffic. This can be accomplished by stacking a sed (stream editor) Linux command (or if needed, a complete shell script) into the proxy.
Steps:
Navigate to HttpSedProxy
).
Add self.response_stack
attribute to the panel, then click . (You need the self.response_stack
attribute, because the response of the server has to be changed.)
Click *
.
Select the type_http_stk_data
.
Click
, select the row containing , then click again.Select sed -e 's|http://|https://|g'
For details on the sed command, see the sed manual pages.
Note |
---|
The example sed command modifies all absolute links that appear in the traffic, that is, even links pointing to an external site will be modified. If possible, use at least the full domain name of the server in the sed command to avoid this problem (for example, |
Python:
self.response_stack["*"]=(HTTP_STK_DATA, (Z_STACK_PROGRAM, "sed -e 's|http://|https://|g'"))
Create a service that will use this new proxy (for example, HttpSedProxy
).
Purpose:
Client authentication in HTTPS is sometimes based on inspecting the certificate of the client. When Zorp is protecting the server, keybridging can be used to transfer the information from the client certificate to the server. However, in one-sided SSL connections (for example, if the communication between Zorp and the server is not encrypted), the server does not receive an SSL certificate, therefore user authentication must use another method. A simple solution to this problem is as follows:
Zorp requests a certificate from the client the usual way, extracts the required information from the client certificate, then inserts this information into an HTTP header. The server then authenticates the user based on the information received in the HTTP header. To accomplish this, create a special HttpProxy using the .
Steps:
Navigate to the ZMC component, and click on the icon in the menu bar.
Click
, then select the tab.Enter a name for the class (for example, HttpsCertProxy
).
Select
.Select
.Type or paste the following Python code. Based on these settings, the header of the proxy class will be generated automatically into the
field. You have to type the remaining part manually, or paste it from this document.Warning |
---|
The source code has to confirm to the syntax requirements of the Python language. Handle indentation with great care, since in Python indentation forms the blocks of code that are on the same level (many other languages use brackets for this purpose, for example, C uses curly brackets). |
Python:
def config(self): OnesidedHttpsProxy.config(self) self.request_header["X-User-Certificate"]=\ (HTTP_HDR_INSERT, self.tls.client_peer_certificate.subject)
Click
and .Create a service that will use this new proxy (for example, HttpsCertProxy
), or modify an existing one.
Name-based virtual hosting is a method to provide services under multiple domain names from a single server (that is, several different domain names point to the same IP address). When receiving an HTTP request, the server decides which domain should receive the connection based on the "Host" header of the HTTP request. Each domain has its own certificate for secure connections. The problem is that the SSL/TLS connection is built before the client sends the first HTTP request: the server should show the certificate of the appropriate domain before receiving the HTTP header specifying the domain name. In earlier Zorp versions, this situation was solved by either assigning a separate IP address to each domain name, or using IP aliasing. In Zorp Professional 7 and later, Server Name Indication (SNI) can be used to overcome the problem.
If IP aliasing is not feasible for some reason, Zorp can be configured to overcome this problem by modifying the target address of the connection based on information arriving in the HTTP request. This solution requires a special Http proxy.
In the following example (Procedure 4.1, Configuring Server Name Indication (SNI)), Zorp determines the target address of the HTTPS connection based on the "Host" header. Note that any other information present in the HTTP traffic can be used for such purpose. For example, it is possible to direct different GET requests to different servers (for example, requests to www.example.com
are directed to Server1, but www.example.com/admin
is redirected to Server2). It is also possible to use different servers to serve the static and the dynamic contents (for example, by redirecting all requests to get jpg, gif, and similar files to a separate server).
Note |
---|
Although the connections can be redirected to different servers, only a single certificate can be shown to the clients, because Zorp must send the client-side certificate to the client before the client sends the first HTTP request. Consequently, Zorp cannot determine the target address at this stage. |
Purpose:
To configure an HttpProxy in a name-based virtual hosting scenario that uses Server Name Indication (SNI) to determine the address of the target server, complete the following steps.
Steps:
Create and configure an Encryption Policy. Complete the following steps.
Navigate to the ZMC component of the firewall host.
Select
.Enter a name into the MySNIEncryption
.
Select
, then click OK.Select
.Python:
EncryptionPolicy( name="MySNIEncryption", encryption=TwoSidedEncryption() )
Double-click
, then select .Double-click
and click to add a certificate entry to a list of certificates.Select the default certificate. Zorp will show this certificate to the clients when none of the other configured certificates match the client request.
Python:
encryption=TwoSidedEncryption( client_certificate_generator=SNIBasedCertificate( default=StaticCertificate( certificates=( Certificate.fromFile( certificate_file_path="/etc/key.d/ZMS_Engine/cert.pem", private_key=PrivateKey.fromFile( "/etc/key.d/ZMS_Engine/key.pem")), ) ) ) )
Configure a mapping that describes to which hostname the list of certificates belongs to. For each certificate, configure a Matcher Policy. If this policy matches the domain name in the client SNI request, Zorp shows the associated certificate to the client. Any type of matcher policy can be used here, but in most scenarios only RegexpMatcher policies will be needed. (For details on Matcher Policies, see Section 6.7.4, Matcher policies in Zorp Professional 7 Administrator Guide.)
The following example configures two matchers and two certificates, one for the myfirstdomain.example.com
domain, one for the myseconddomain.example.com
domain. Complete the following steps:
Double-click
, then click .Select
.Click myfirstdomain.example.com
) into the field. Click .
Click
and click to add a certificate entry to a list of certificates.Double-click
and select the certificate to show if a client tries to access the domain set in the previous step.Click
, then click .Click OK to close the list editor.
Repeat from Step 'a' to Step 'e' for the myseconddomain.example.com
domain and its respective certificate.
Python:
encryption=TwoSidedEncryption( client_certificate_generator=SNIBasedCertificate( default=StaticCertificate( certificates=( Certificate.fromFile( certificate_file_path="/etc/key.d/ZMS_Engine/cert.pem", private_key=PrivateKey.fromFile( "/etc/key.d/ZMS_Engine/key.pem")), )), hostname_certificate_map={ RegexpMatcher( match_list=("myfirstdomain.example.com", )): StaticCertificate( certificates=( Certificate.fromFile( certificate_file_path="/etc/key.d/myfirstdomain/cert.pem", private_key=PrivateKey.fromFile( "/etc/key.d/myfirstdomain/key.pem")), )), RegexpMatcher( match_list=("myseconddomain.example.com", )): StaticCertificate( certificates=( Certificate.fromFile( certificate_file_path="/etc/key.d/myseconddomain/cert.pem", private_key=PrivateKey.fromFile( "/etc/key.d/myseconddomain/key.pem")), )) }, ) )
Configure the other options of the Encryption Policy as needed for your environment.
Create a service and a firewall rule that uses this new Encryption Policy and an HttpProxy class.
Python:
def demo() : Service( name='demo/inter_HttpSNIService', router=TransparentRouter(), chainer=ConnectChainer(), proxy_class=HttpProxy, max_instances=0, max_sessions=0, keepalive=Z_KEEPALIVE_NONE, encryption_policy="MySNIEncryption" ) Rule( rule_id=300, src_subnet=('internet', ), dst_zone=('dmz', ), proto=6, service='demo/inter_HttpSNIService' )
Purpose:
To enable Windows update for the clients protected by the firewall, you have to import the certificate of the Zorp CA that signs the certificates in keybridging into the client machines. To accomplish this, complete the following steps on the client hosts.
Note |
---|
An alternative to this solution is to disable SSL-proxying for the |
Prerequisite:
You will need the certificate of the Zorp CA that signs the certificates in keybridging into the client machines. Export this certificate from ZMS, and make it available on your client hosts.
Steps:
Start the Microsoft Management Console (
).Select
.Click
, then select .Select
, then click .Select
and click . The Certificates module has been added to the Console Root tree.Expand the Certificates
node, select , then click .
Click Zorp CA to be imported.
on the Welcome to the Certificate Import Wizard page. On the File to Import page, click , and locate the certificate of theOn the Certificate Store page, accept the default setting (
), click , then .Note |
---|
Zorp must be able to verify the certificates of the Windows Update servers. To accomplish this, the certificates of the certificate authorities (CAs) issuing the certificates of the Windows update servers have to be imported into Zorp, if not already present. The following certificates have to be imported:
|
When configured according to this tutorial, the policy.py
file of Zorp should look something like this:
Configuring HTTPS proxying:
class HttpsProxy(HttpProxy): def config(self): HttpProxy.config(self) self.ssl.client_keypair_files=\ ("/etc/key.d/Certificate_for_SSL_proxying/cert.pem",\ "/etc/key.d/Certificate_for_SSL_proxying/key.pem") self.ssl.client_verify_type=SSL_VERIFY_NONE self.ssl.client_connection_security = SSL_FORCE_SSL self.ssl.server_connection_security = SSL_FORCE_SSL self.ssl.server_cagroup_directories= \ ("/etc/ca.d/groups/ZMS_Trusted_CA/certs/",\ "/etc/ca.d/groups/ZMS_Trusted_CA/crls/") self.ssl.server_disable_proto_sslv2=TRUE
Nontransparent version:
class HttpSNonTransparent(HttpProxyNonTransparent): def config(self): HttpProxyNonTransparent.config(self) self.connect_proxy= HttpsProxy self.request["GET"]=HTTP_REQ_ACCEPT self.request["POST"]=HTTP_REQ_ACCEPT self.request["HEAD"]=HTTP_REQ_ACCEPT self.request["CONNECT"]=HTTP_REQ_ACCEPT
One-sided HTTPS and Microsoft Outlook Web Access:
class OnesidedHttpsProxy(HttpsProxy): def config(self): HttpsProxy.config(self) self.ssl.server_connection_security=SSL_NONE self.ssl.server_keypair_files = \ ("/etc/key.d/Sample Certificate/cert.pem",\ "/etc/key.d/Sample Certificate/key.pem") self.stack_proxy=(Z_STACK_PROXY, OWAHttpProxy) class OWAHttpProxy(HttpProxy): def config(self): HttpProxy.config(self) self.request_header["Front-End-Https"]=(HTTP_HDR_INSERT, "on")
HTTP Proxy using stream editor
class HttpSedProxy(OnesidedHttpsProxy): def config(self): OnesidedHttpsProxy.config(self) self.response_stack["*"]=(HTTP_STK_DATA, (Z_STACK_PROGRAM, "sed -e 's|http://|https://|g'"))
Transferring certificate information in an HTTP header
class HttpsCertProxy(OnesidedHttpsProxy): def config(self): OnesidedHttpsProxy.config(self) self.request_header["X-User-Certificate"]=(HTTP_HDR_INSERT, self.tls.client_peer_certificate.subject)
Name-based virtual hosting and sidestacking:
class HttpProxyTargetByHostHeader(HttpProxy): def config(self): HttpProxy.config(self) self.request_header["Host"]=(HTTP_HDR_POLICY, self.TargetByHostHeader) self.ssl.client_connection_security=SSL_FORCE_SSL self.ssl.server_connection_security=SSL_NONE self.ssl.server_keypair_files = \ ("/etc/key.d/Sample Certificate/cert.pem",\ "/etc/key.d/Sample Certificate/key.pem") def TargetByHostHeader(self, name, value): if (value == "example.com"): self.session.setServer(SockAddrInet("192.168.0.1", 80)) return HTTP_HDR_ACCEPT elif (value == "example2.com"): self.session.setServer(SockAddrInet("192.168.0.2", 80)) return HTTP_HDR_ACCEPT return HTTP_HDR_ABORT
This tutorial has shown how to configure Zorp to proxy HTTPS traffic, including scenarios where only one side of the traffic is encrypted. Although these examples are relatively simple, they provide a solid base from which more complex configurations can be built — just as the security policy of your organization requires it.[1]
[1] All questions, comments or inquiries should be directed to <info@balasys.hu>
or by post to the following address: BalaSys IT Ltd. 1117 Budapest, Alíz Str. 4 Phone: +36 1 646 4740 Web: https://www.balasys.hu/
Copyright © 2024 BalaSys IT Ltd. All rights reserved.
The latest version is always available at the Balasys Documentation Page.
© BalaSys IT Ltd.
Send your comments to: support@balasys.hu