Copyright © 1996-2024 Balasys IT Zrt. (Private Limited Company)
This documentation and the product it describes are considered protected by copyright according to the applicable laws.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com)
Linux™ is a registered trademark of Linus Torvalds.
Windows™ 10 is registered trademarks of Microsoft Corporation.
The Balasys™ name and the Balasys™ logo are registered trademarks of Balasys IT Zrt.
The Zorp™ name and the Zorp™ logo are registered trademarks of Balasys IT Zrt.
All other product names mentioned herein are the trademarks of their respective owners.
DISCLAIMER
Balasys is not responsible for any third-party websites mentioned in this document. Balasys does not endorse and is not responsible or liable for any content, advertising, products, or other material on or available from such sites or resources. Balasys will not be responsible or liable for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services that are available on or through any such sites or resources.
May 30, 2024
Abstract
This document is a detailed reference guide for Zorp GPL administrators.
Table of Contents
List of Examples
List of Procedures
Welcome to the Zorp GPL Reference Guide. This book contains reference documentation on the available Zorp proxies and their working environment, the Python framework.
This book contains information about the low-level proxy attributes available to customize proxy behavior and the low-level classes comprising Zorp's access control and service framework. Basic introduction to the various protocols is also provided for reference, but the detailed discussion of the protocols is beyond the scope of this book.
Chapter 1, How Zorp works provides an overview of the internal working of Zorp, for example, how a connection is received.
Chapter 2, Configuring Zorp proxies describes the general concepts of configuring Zorp proxies.
Chapter 3, The Zorp SSL framework explains how to handle SSL-encrypted connections with Zorp.
Chapter 4, Proxies is a complete reference of the Zorp proxies, including their special features and options.
Chapter 5, Core is the reference of Zorp core modules which are directly used by gateway administrators, forming the access control and authentication framework.
Appendix C, Zorp manual pages is a collection of the command-line Zorp utilities.
Appendix B, Global options of Zorp is a reference the global options of Zorp.
The following terms used throughout this documentation might require a brief explanation:
class: A class is a set of attribute and method definitions performing certain specific functionality. Classes can inherit methods and attributes from one or more parent classes. Classes do not contain actual values for attributes; they only describe them.
instance: An instance is a set of attribute values (as described by the class) and associated methods. Instances are also called objects. Instances are created from classes by "calling" the class, with arguments required by the constructor. For example, to create an instance of a class named "class" one would write class(arg1, arg2 [,.. argN]) where arg1 and arg2 are arguments of the constructor.
method: A function working in the context of an instance. It automatically receives a "self" argument which can be used to fetch or set attributes stored in the associated instance.
type: Variables in Python are not strongly typed, meaning that it is possible to assign any kind of values to a variable; typing is assigned to the value.
attribute: An attribute of an object is a variable holding some value, interpreted and manipulated by object methods. Although Python is not strongly typed, types were assigned to the variables in Zorp to indicate what kind of values they are supposed to hold.
actiontuple: A tuple is a simple Python type defined as a list of values. An actiontuple is a special tuple defined by Zorp where the first value must be a value specifying what action to take, and trailing items specify arguments to the action. For example (HTTP_REQ_REJECT, "We don't like this request") is a tuple for rejecting HTTP requests and returning the message specified in the second value.
This guide is intended for use by system administrators and consultants responsible for network security and whose task is the configuration and maintenance of Zorp firewalls. Zorp gives them a powerful and versatile tool to create full control over their network traffic and enables them to protect their clients against Internet-delinquency.
This guide is also useful for IT decision makers evaluating different firewall products because apart from the practical side of everyday Zorp administration, it introduces the philosophy behind Zorp without the marketing side of the issue.
The following skills and knowledge are necessary for a successful Zorp administrator.
Skill | Level/Description |
---|---|
Linux | At least a power user's knowledge is required. |
Experience in system administration | Experience in system administration is certainly an advantage, but not absolutely necessary. |
Programming language knowledge | It is not an explicit requirement to know any programming languages though being familiar with the basics of Python may be an advantage, especially in evaluating advanced firewall configurations or in troubleshooting misconfigured firewalls. |
General knowledge on firewalls | A general understanding of firewalls, their roles in the enterprise IT infrastructure and the main concepts and tasks associated with firewall administration is essential. To fulfill this requirement a significant part of Chapter 3, Architectural overview in the Zorp Administrator's Guide is devoted to the introduction to general firewall concepts. |
Knowledge on Netfilter concepts and IPTables | In-depth knowledge is strongly recommended; while it is not strictly required definitely helps understanding the underlying operations and also helps in shortening the learning curve. |
Knowledge on TCP/IP protocol | High level knowledge of the TCP/IP protocol suite is a must, no successful firewall administration is possible without this knowledge. |
Table 1. Prerequisites
The Zorp Distribution DVD-ROM contains the following software packages:
Current version of Zorp 7 packages.
Current version of () 7.
Current version of () 7 (GUI) for both Linux and Windows operating systems, and all the necessary software packages.
Current version of () 7.
Current version of the () 7, the client for both Linux and Windows operating systems.
For a detailed description of hardware requirements of Zorp, see .
For additional information on Zorp and its components visit the Zorp website containing white papers, tutorials, and online documentations on the above products.
This product is developed and maintained by Balasys IT Zrt..
Contact:
Balasys IT Zrt.
4 Alíz Street
H-1117 Budapest, Hungary
Tel: +36 1 646 4740
E-mail: <info@balasys.hu>
Web: http://balasys.hu/
You can directly contact us with sales related topics at the e-mail address
<sales@balasys.hu>
, or leave us your contact information and we call you back.
To access the Balasys Support System, sign up for an account at the Balasys Support System page. Online support is available 24 hours a day.
Balasys Support System is available only for registered users with a valid support package.
Support e-mail address: <support@balasys.hu>
.
Balasys IT Zrt. holds courses on using its products for new and experienced users. For dates, details, and application forms, visit the https://www.balasys.hu/en/services#training webpage.
This guide is a work-in-progress document with new versions appearing periodically.
The latest version of this document can be downloaded from https://docs.balasys.hu/.
Any feedback is greatly appreciated, especially on what else this document should cover, including protocols and network setups. General comments, errors found in the text, and any suggestions about how to improve the documentation is welcome at <support@balasys.hu>
.
This chapter describes how Zorp works, and provides information about the core Zorp modules, explaining how they interoperate. For a detailed reference of the core modules, see the description of the particular in Chapter 5, Core.
Zorp startup and initialization: The main Zorp thread is started, and the rules listening for incoming connections are initialized.
Handling incoming connections: The client-side connection is established and the service to proxy the connection is selected.
Proxy startup and server-side connections: The proxy instance inspecting the traffic is created and connection to the server is established.
The zorpctl utility loads the
instances.conf
file and starts the main zorp
program. The instances.conf
file stores the parameters of the
configured Zorp instances.
zorp performs the following initialization steps:
Sets the stack limit.
Creates its PID file.
Changes the running user to the user and group specified for the instance.
Initializes the handling of dynamic capabilities and sets the chroot directory.
Loads the firewall policy from the policy.py
file.
The init()
of Zorp initializes the ruleset defined for the Zorp instance.
The kzorp
kernel module uploads packet filtering services,
rules, and zones into the kernel.
Note |
---|
Zorp creates four sockets (one for each type of traffic: TCP IPv6, TCP IPv4, UDP IPv6, UDP IPv4); the kzorp module directs the incoming connections to the appropriate socket. |
Incoming connections are first received by the kzorp kernel module, which is actually a netfilter table. The kzorp module determines the source and destination zones of the connection, and then tries to find a suitable firewall rule. If the rule points to a packet filtering service, the connection is processed according to Procedure 1.2.1, Handling packet filtering services; if it points to an application-level service, the connection is processed according to Procedure 1.2.2, Handling application-level services. If no suitable rule is found, the connection is rejected.
Zorp generates a session ID and creates a CONNTRACK entry for the connection. This ID is based on all relevant information about the connection, including the protocol (TCP/UDP) and the client's address.
The session ID uniquely identifies the connection and is included in every log message related to this particular connection.
Based on the parameters of the connection, the Rule selects the service that will inspect the connection.
The Router defined in the service determines the destination address of the server.
The Router performs the following actions:
Determines the destination address of the server.
Sets the source address of the server-side connection, according to the forge_address
settings
of the router.
If the client is permitted to access the selected service, the packet filter is instructed to let the connection pass Zorp.
The kzorp module performs network address translation (NAT) on the connection, if needed.
For incoming connection requests that are processed on the application level, the main Zorp thread establishes the connection with the client. The connection is further processed in a separate thread; the main thread is listening for new connections.
The Dispatcher creates the MasterSession object of the connection and generates the base session ID. This object stores all relevant information of the connection, including the protocol (TCP/UDP) and the client's address.
The session ID uniquely identifies the connection and is included in every log message related to this particular connection. Other components of Zorp add further digits to the session ID.
For TCP-based connections, Zorp copies the Type of Service (ToS) value of the client-Zorp connection in the Zorp-client connection.
The Rule selects the service that will inspect the connection.
The Router defined in the service determines the destination address of the server. The result is stored in the Session object, where the Chainer can access it later.
The Router performs the following actions:
Determines the destination address of the server.
Sets the source address of the server-side connection (according to the
forge_port
, forge_address
settings
of the router).
Sets the ToS value of the server-side connection.
If the client is permitted to access the selected service, the
startInstance()
method of the service is started. The
startInstance()
method performs the following actions:
Verifies that the new instance does not exceed the number of instances
permitted for the service (max_instances
parameter).
Creates the final session ID.
Creates an instance of the proxy class associated with the service. This proxy instance is associated with a StackedSession object. The startup of the proxy is detailed in Procedure 1.3, Proxy startup and the server-side connection.
To create an instance of the application-level proxy, the
__init__
constructor of the proxy class calls the Proxy.__init__
function of the Proxy module. The proxy
instance is created into a new thread from the ZorpProxy ancestor class.
From the new thread, the proxy loads its configuration.
The proxy initiates connection to the server.
Note |
---|
Some proxies connect the server only after receiving the first client request. |
The
Proxy.connectServer()
method creates the server-side connection using the Chainer assigned to the service. The Chainer
performs the following actions:
Reads the parameters related to the server-side connection from the Session object. These parameters were set by the Router and the Proxy.
Performs source and destination network address translation. This may modify the addresses set by the Router and the Proxy.
Verifies that access to the server is permitted.
Establishes the connection using the Attach subsystem, and passes to the proxy the stream that represents the connection.
Note |
---|
The
|
This chapter describes how Zorp proxies work in general, and how to configure them.
For the details on configuring TLS/SSL connections, see Chapter 2, Configuring Zorp proxies.
For a complete reference of the available Zorp proxies, see Chapter 4, Proxies.
Zorp offers great flexibility in proxy customization. Requests and commands, responses, headers, etc. can be managed individually in Zorp. This means that it is not only possible to enable/disable them one-by-one, but custom actions can be assigned to them as well. The available options are listed in the description of each proxy, but the general guidelines are discussed here.
All important events of a protocol have an associated policy hash: usually there is one for the requests or commands and one for the responses. Where applicable for a protocol, there are other policy hashes defined as well (e.g., for controlling the capabilities available in the IMAP protocol, etc.). The entries of the hash are the possible events of the protocol (e.g., the request hash of the FTP protocol contains the possible commands - RMD, DELE, etc.) and an action associated with the event - what Zorp should do when this event occurs. The available actions may slightly vary depending on the exact protocol and the hash, but usually they are the following:
Action | Description |
---|---|
ACCEPT | Enable the event; the command/response/etc. can be used and is allowed through the firewall. |
REJECT | Reject the event and send an error message. The event is blocked and the client notified. The communication can continue, the connection is not closed. |
DROP | Reject the event without sending an error message. The event is blocked but the client is not notified. The communication can continue, the connection is not closed. In some cases (depending on the protocol) this action is able to remove only a part of the message (e.g., a particular header in HTTP traffic) without rejecting the entire message. |
ABORT | Reject the event and terminate the connection. |
POLICY | Call a Python function to make a decision about the event. The final decision must be one of the above actions (i.e. POLICY is not allowed). The parameters received by the function are listed in the module descriptions. See the examples below and in the module descriptions for details. |
Table 2.1. Action codes for protocol events
The use of the policy hashes and the action codes is illustrated in the following examples.
It must be noted that there is a difference between how Zorp processes the POLICY actions and all the other ones (e.g., ACCEPT, DROP, etc.). POLICY actions are evaluated on the policy (or Python) level of Zorp, while the other ones on the proxy (or C) level. Since the proxies of Zorp are written in C, and operate on the proxy level, the evaluation of POLICY actions is slightly slower, but this can be an issue only in very high-throughput environments with complex policy settings.
Default actions for all events of a hash (e.g., all requests) can be set using the '*' wildcard as the event. (Most hashes have default actions configured by default, these can be found in the description of the proxy classes.) It is important to note that setting the action using the '*' wildcard does NOT override an action explicitly defined for an event, even if the explicit setting precedes the general one in the Python code. This feature is illustrated in the example below.
Warning |
---|
If the relevant hash does not contain a received request or response, the '*' entry is used which matches to every request/response. If there is no '*' entry in the given hash, the request/response is denied. |
Responses in certain protocols include numeric response codes, e.g., in the FTP protocol responses start with a three-digit code. In Zorp it is possible to filter these codes as well, furthermore, to filter them based on the command to which the response arrives to. In these cases the hash contains both the command and the answer, and an action as well. The '*' wildcard character can be used to match for every command or response code.
It is not necessary to specify the full response code, it is also possible to specify only the first, or the first two digits.
For example, all three response codes presented below are valid, but have different effects:
"PWD","200"
Match exactly the answer 200 coming in a reply to a PWD command.
"PWD","2"
Match every answer starting with '2' in a reply to a PWD command.
"*","20"
Match every answer between 200 and 209 in a reply to any command.
This kind of response code lookup is available in the following proxies: FTP, HTTP, NNTP, and SMTP. The precedence how the hash table entries are processed is the following:
Exact match. ("PWD","200")
Exact command match, partial response matches ("PWD","20"; "PWD","2"; "PWD","*")
Wildcard command, with answer codes repeated as above. ("*","200"; "*","20"; "*","2")
Wildcard for both indexes. ("*","*")
Certain proxies support the use of secondary sessions, i.e. several sessions using the same proxy instance (the same thread), effectively reusing proxy instances. As new sessions enter the proxy via a fastpath, using secondary sessions can significantly decrease the load on the firewall.
When a new connection is accepted, Zorp looks for the appropriate proxy instance which is willing to accept secondary sessions. If there is none, a new proxy instance is started. An already running proxy instance is appropriate if it is willing to accept secondary channels and the criteria about secondary sessions are met. (The criteria can be specified in the configuration of the proxy class.)
The criteria are set via the secondary_mask
attribute, while
the number of secondary sessions allowed within the same instance is controlled by the
secondary_sessions
attribute. The
secondary_mask
attribute is an integer specifying which properties
of an established session are considered to be important. If all important properties
match, the connection can be handled as a secondary session by a proxy instance accepting
secondary sessions, provided the new session does not exceed the limit set in
secondary_sessions
. The secondary_mask
attribute is actually a bitfield interpreted as follows: bit 0 means source address; bit 1
means source port; bit 2 means destination address; bit 3 means destination port.
Currently the Plug supports the use of secondary sessions.
Each protocol proxy available in Zorp inspects the traffic for conformance to the given protocol. Often further analysis of the data transferred via the protocol is required, this can be accomplished via stacking. Stacking is a method when the data transferred in the protocol is passed to another proxy or program. After performing the inspection, the stacked proxy or program returns the data to the original proxy, which resumes its transmission.
Proxy stacking is mainly used to inspect embedded protocols, or perform virus filtering: e.g., to inspect HTTPS traffic, the external SSL protocol is examined with a Pssl proxy, and then a HTTP proxy is stacked to inspect the internal protocol. It is possible to stack several layers of proxies into each other if needed, e.g., in the above example, a further virus filtering solution (like a module) could be stacked into the HTTP proxy.
Note |
---|
Starting with Zorp version 3.3FR1, every proxy is able to handle SSL/TLS-encypted connection on its own, making the Pssl proxy redundant. This feature greatly decreases the need of proxy stacking, making it needed only in special cases, for example, to inspect HTTP traffic tunneled in SSH. |
Stacking a proxy to inspect the embedded protocol is possible via the
self.request_stack
attribute; if another attribute has to be
used, it is noted in the description of the given proxy. The HTTP proxy is special in
the sense that it is possible to stack different proxies into the requests and the
responses.
The parameters of the stack attribute has to specify the following:
The protocol elements for which embedded inspection is required. This parameter can be used to specify if all received data should be passed to the stacked proxy ("*"), or only the data related (sent or received) to specific protocol elements (e.g., only the data received with a GET request in HTTP).
The mode how the data is passed to the stacked proxy. This parameter governs if only the data part should be passed to the stacked proxy (XXXX_STK_DATA, where XXXX depends on the protocol), or (if applicable) MIME header information should be included as well (XXXX_STK_MIME) to make it possible to process the data body as a MIME envelope. Please note that while it is possible to change the data part in the stacked proxy, it is not possible to change the MIME headers - they can be modified only by the upper level proxy. The available constants are listed in the respective protocol descriptions. The default value for this argument is XXXX_STK_NONE, meaning that no data is transferred to the stacked proxy. In some proxies it is also possible to call a function (using the XXXX_STK_POLICY action) to decide which part (if any) of the traffic should be passed to the stacked proxy.
The proxy class that will perform inspection of the embedded protocol.
The use of proxy stacking is illustrated in the following example:
For additional information on proxy stacking, see , and the various tutorials available at the Balasys Documentation Page.
When stacking a program, the data received by a proxy within a protocol is directed to the standard input. Arbitrary commands (including command line scripts, or applications) working from the standard input can be run on this data stream. The original proxy obtains the processed data back from the standard output. When stacking a command, the command to be called has to be included in the proper stack attribute of the proxy between double-quotes. This is illustrated in the following example.
This chapter describes the SSL protocol and the SSL framework available for every Zorp proxy.
Secure Socket Layer v3 (SSL) and Transport Layer Security v1 (TLS) are widely used crypto protocols guaranteeing data integrity and confidentiality in many PKI and e-commerce systems. They allow both the client and the server to authenticate each other. SSL/TLS use reliable TCP connection for data transmission and cooperate with any application level protocol. SSL/TLS guarantee that:
Communication in the channel is private, only the other communicating party can decrypt the messages.
The channel is authenticated, so the client can make sure that it communicates with the right server. Optionally, the server can also authenticate the client. Authentication is performed via certificates issued by a Certificate Authority (CA). Certificates identify the owner of an encryption keypair used in encrypted communication.
The channel is reliable, which is ensured by message integrity verification using MAC.
SSL/TLS is almost never used in itself: it is used as a secure channel to transfer other, less secure protocols. The protocols most commonly embedded into SSL/TLS are HTTP and POP3 (i.e. these are the HTTPS and POP3S protocols).
As an initial step, both the client and the server collect information to start the encrypted communication.
The client sends a CLIENT-HELLO message.
The server answers with a SERVER-HELLO message containing the certificate of the server. At this point the parties determine if a new master key is needed.
Note |
---|
The server stores information (including the session ID and other parameters) about past SSL/TLS sessions in its session cache. Clients that have contacted a particular server previously can request to continue a session (by identifying its session ID); this can be used to accelerate the initialization of the connection. Zorp currently does not support this feature, but this does not cause any noticeable difference to the clients. |
The client verifies the server's certificate. If the certificate is invalid the client sends an ERROR message to the server.
Note |
---|
If a new master key is needed the client gets the server certificate from the SERVER-HELLO message and generates a master key, sending it to the server in a CLIENT-MASTER-KEY message. |
The server sends a SERVER-VERIFY message, which authenticates the server itself.
Optionally, the server can also authenticate the client by requesting the client's certificate with a REQUEST-CERTIFICATE message.
The server verifies the certificate received from the client and finishes the handshake with a SERVER-FINISH message.
Note |
---|
In SSL two separate session keys are used, one for outgoing communication (which is of course incoming at the other end), and another key for incoming communication. These are known as SERVER/CLIENT-READ-KEY and SERVER/CLIENT-WRITE-KEY. |
Zorp version 3.3FR1 introduces a common framework that allows every Zorp proxy to use SSL/TLS encryption, and also to support STARTTLS.
Note |
---|
In Zorp 7, the following proxies support STARTTLS: Ftp proxy (to start FTPS sessions), Smtp proxy. |
Warning |
---|
For the details of the attributes related to the SSL framework, see Section 5.10.4, Class Proxy. |
The SSL framework was built for inspecting SSL/TLS connections, and also any other connections embedded into the encrypted SSL/TLS channel. SSL/TLS connections initiated from the client are terminated on the Zorp firewall; and two separate SSL/TLS connections are built: one between the client and the firewall, and one between the firewall and the server. If both connections are accepted by the local security policy (the certificates are valid, and only the allowed encryption algorithms are used), Zorp inspects the protocol embedded into the secure channel as well.
Several configuration examples and considerations are discussed in the Technical White Paper and Tutorial Proxying secure channels - the Secure Socket Layer, available at the Balasys Documentation Page.
The SSL framework starts its operation by inspecting the values set in the ssl.handshake_seq
attribute. When this attribute is set to SSL_HSO_CLIENT_SERVER the client side, otherwise (SSL_HSO_SERVER_CLIENT) the server side handshake is performed first.
As part of the handshake process the proxy checks if SSL is enabled on the given side (ssl.client_connection_security
and ssl.server_connection_security
attributes). It is not necessary for SSL to be enabled on both sides - Zorp can handle one-sided SSL connections as well (e.g., the firewall communicates in an unencrypted channel with the client, but in a secure channel with the server). If SSL is not enabled, the handshake is skipped for that side.
When SSL is needed, the proxy will cooperate with the policy layer to have all required parameters (keys, certificates, etc.) set up. This is achieved using decision points in the hash named ssl.handshake_hash
which is explained later in detail.
The SSL handshake is slightly different for the client (in this case Zorp behaves as an SSL server) and the server (when Zorp behaves as an SSL client).
As an SSL server the first thing to present to an SSL client is a certificate/key pair, thus a call to the 'setup_key' callback is made. It is expected that by the time this callback returns the attributes ssl.client_local_privatekey
and ssl.client_local_certificate
are filled appropriately.
If peer authentication is enabled (by setting the attribute ssl.client_verify_type
) a list of trusted CA certificates must be set up (stored in the hash ssl.client_local_ca_list
). The list can be set up by the 'setup_ca_list' function call. Peer certificates are verified against the trusted CA list and their associated revocation lists. Revocations can be set up in the 'setup_crl_list' callback.
At the end of the verification another callback named 'verify_cert' is called which can either ACCEPT or DENY the certificate possibly overriding the verification against the local CA database.
The server-side handshake is similar to the client-side handshake previously described. The difference is the order of certificate verification. On the server side Zorp verifies the server's certificate first and then sends its own certificate for verification. This is unlike the client side where the local certificate is sent first, and then the peer's certificate is verified.
So the callbacks are called in this order: 'setup_ca_list' and 'setup_crl_list' to set up CA and CRL information, 'verify_cert' to finalize certificate validation, and 'setup_key' to optionally provide a local certificate/key pair.
As described earlier, the SSL framework provides a way to customize the SSL handshake process. This is done using the ssl.client_handshake
and ssl.server_handshake
hashes. These hashes are indexed by the keywords listed below.
The tuple can be separated to two parts: 1) tuple type, 2) parameters for the given type. For now only SSL_HS_POLICY
is valid as tuple type, and it requires a function reference as parameter.
The following keys are accepted as indexes:
This function is called when the proxy needs the private key/certificate pair to be set up. All attributes filled in the earlier phases can be used to decide which key/certificate to use. The function expects two parameters: self, side.
This function is called when the proxy needs the trusted CA list to be set up. The function expects two parameters: self, side.
This function is called when the proxy needs the CRL list to be set up. This function gets a single string parameter which contains the name of the CA whose CRL is to be filled up. The function expects three parameters: self, side, ca_name.
This function is called to finalize the verification process. The function expects two parameters: self, side.
The function arguments as referenced above are defined as:
The proxy instance.
The side where handshake is being performed.
Name of an X.509 certificate.
The functions returns one of the SSL_HS_*
constants. Generally if the function returns SSL_HS_ACCEPT
the handshake continues, otherwise the handshake is aborted. As an exception, verify_cert
may return SSL_HS_VERIFIED
in which case the certificate is accepted without further verification.
Name | Value |
---|---|
SSL_HS_ACCEPT | 0 |
SSL_HS_REJECT | 1 |
SSL_HS_POLICY | 6 |
SSL_HS_VERIFIED | 10 |
Table 3.1. Handshake policy decisions
An X.509 certificate is a public key with a subject name specified as an X.500 DN (distinguished name) signed by a certificate issuing authority (CA). X.509 certificates are represented as Python policy objects having the following attributes:
Subject of the certificate.
Issuer of the certificate (i.e. the CA that signed it).
Serial number of the certificate.
The certificate itself as a string in PEM format.
Zorp uses X.509 certificates to provide a convenient and efficient way to manage and distribute certificates and keys used by the various components and proxies of the managed firewall hosts. It is mainly aimed at providing certificates required for the secure communication between the different parts of the firewall system, e.g. firewall hosts and engine (the actual communication is realized by agents).
Certificates of trusted CAs (and their accompanying CRLs) are used in Zorp to validate the certificates of servers accessed by the clients. The hashes and structures below are used by the various certificate-related attributes of the Zorp Pssl proxy, particularly the ones of certificate
type.
A certificate name behaves as a string, and contains a DN in the following format (also known as one-line format):
/RDN=value/RDN=value/.../RDN=value/
The word RDN stands for relative distinguished name. For example, the DN cn=Root CA, ou=CA Group, o=Foo Ltd, l=Bar, st=Foobar State, c=US
becomes /C=US/ST=Foobar State/L=Bar/O=Foo Ltd/OU=CA Group/CN=Root CA/
Warning |
---|
The format and representation of certificate names may change in future releases. |
A certifying authority may revoke the issued certificates. A revocation means that the serial number and the revocation date is added to the list of revoked certificates. Revocations are published on a regular basis. This list is called the Certificate Revocation List, also known as CRL. A CRL always has an issuer, a date when the list was published, and the expected date of its next update.
The proxy stores trusted CA certificates in a Certificate hash. This hash can be indexed by two different types. If an integer index is used, the slot specified by this value is looked up; if a string index is used, it is interpreted as a one-line DN value, and the appropriate certificate is looked up. Each slot in this hash contains an X.509 certificate.
Similarly to the certificate hash, a separate hash for storing Certificate Revocation Lists was defined. A CRL contains revocation lists associated to CAs.
Zorp is able to automatically verify the certificates received. The types of accepted certificates can be controlled separately on the client and the server side using the ssl.client_verify_type
and the ssl.server_verify_type
attributes. These attributes offer an easy way to restrict encrypted access only to sites having trustworthy certificates. The available options are summarized in the following table.
Name | Value |
---|---|
TLS_TRUST_LEVEL_NONE | Accept invalid for example, expired certificates. |
TLS_TRUST_LEVEL_UNTRUSTED | Both trusted and untrusted certificates are accepted. |
TLS_TRUST_LEVEL_FULL | Only valid certificates signed by a trusted CA are accepted. |
Table 3.2. Constants for trust level selection.
The ssl.server_check_subject
can be used to compare the domain name provided in the Subject
field of the server certificate to application level information about the server. Currently it can compare the Subject
field to the domain name of the HTTP request in HTTPS communication. If the ssl.server_check_subject
is set to TRUE
and ssl.server_verify_type
is SSL_VERIFY_REQUIRED_UNTRUSTED
or SSL_VERIFY_REQUIRED_TRUSTED
, the HTTP proxy using the SSL framework will deny access to the page and return an error if the Subject
field does not match the domain name of the URL.
There are different and sometimes incompatible releases of the TLS protocol. TLS protocols can be set via the ClientSSLOptions and ServerSSLOptions classes, enabling all supported protocols by default. Set the appropriate 'disable_tls*' parameters to disable the selected TLS protocols. Zorp currently supports the TLS v1, TLS v1.1, TLS v1.2 protocols.
The cipher algorithms used for key exchange and mass symmetric
encryption are specified by the attributes ssl.client_ssl_ciphers
and ssl.server_ssl_ciphers
. These attributes contain a cipher
specification as specified by the OpenSSL manuals, see the manual
page ciphers(ssl) for further details.
The default set of ciphers can be set by using the following predefined variables.
Name | Value |
---|---|
SSL_CIPHERS_HIGH | n/a |
SSL_CIPHERS_MEDIUM | n/a |
SSL_CIPHERS_LOW | n/a |
SSL_CIPHERS_ALL | n/a |
SSL_CIPHERS_CUSTOM | n/a |
Table 3.3. Constants for cipher selection
Cipher specifications, as defined above, are sorted by key length. The cipher providing the best key length will be the most preferred one.
Starting with version 3.3FR1, Zorp supports the STARTTLS method for encrypting connections. STARTTLS support can be configured separately for the client- and server side using the ssl.client_connection_security
and ssl.server_connection_security
parameters, respectively. The parameters have the following possible values:
Name | Value |
---|---|
SSL_NONE | Disable encryption between Zorp and the peer. |
SSL_FORCE_SSL | Require encrypted communication between Zorp and the peer. |
SSL_ACCEPT_STARTTLS | Permit STARTTLS sessions. Currently supported only in the Ftp, Smtp and Pop3 proxies. |
Table 3.4. Client connection security type.
Name | Value |
---|---|
SSL_NONE | Disable encryption between Zorp and the peer. |
SSL_FORCE_SSL | Require encrypted communication between Zorp and the peer. |
SSL_FORWARD_STARTTLS | Forward STARTTLS requests to the server. Currently supported only in the Ftp, Smtp and Pop3 proxies. |
Table 3.5. Server connection security type.
Note |
---|
In Zorp 7, the following proxies support STARTTLS: Ftp proxy (to start FTPS sessions), Smtp proxy. |
Keybridging is a method to let the client see a copy of the server's certificate (or vice versa), allowing it to inspect it and decide about its trustworthiness. Because of proxying the SSL/TLS connection, the client is not able to inspect the certificate of the server directly, therefore Zorp generates a certificate based on the server's certificate on-the-fly. This generated certificate is presented to the client.
Purpose:
To configure keybridging in a proxy, complete the following steps.
Steps:
Create the required keys and CAs.
Generate two local CA certificates. One of them will be used to sign bridging certificates for servers having trusted certificates, the other one for servers with untrusted or self-signed certificates. It is useful to reflect this difference somewhere in the CA's certificates, for example, in their common name (CA_for_Untrusted_certs; CA_for_Trusted_certs). These CA certificates can either be self-signed or signed by a local root CA. The certificate of the CA signing the trusted certificates should be imported to your clients to make the generated certificates 'trusted'. The other CA certificate should not be imported to the clients.
Warning |
---|
IMPORTANT: Do NOT set a password for these CAs, as they have to be accessible automatically by Zorp. |
Generate a new certificate. The private key of this keypair will be used in the on-the-fly generated certificates, the public part (DN and similar information) will not be used.
Copy the generated certificate, the CA certificates, and the keys to the firewall, for example, into /etc/zorp/sslbridge/
. This directory will be used in the ssl.client_ca_directory
option.
Note |
---|
If you want to send the root CA of the CA certificates to the clients, also copy the root CA (and any intermediate CA certificates) to this directory. |
Create a cache directory to store the keybridged certificates generated by Zorp, for example, /var/lib/zorp/sslbridge/
, and make it writable for the zorp
user.
Note |
---|
Zorp automatically creates a file called |
Set up a proxy class (for example, a class derived from the HttpProxy class) and set the following attributes with the following values:
Instruct Zorp to perform the handshake with the server first: self.ssl.handshake_seq=SSL_HSO_SERVER_CLIENT
class KeybrideHttpsProxy(HttpProxy): def config(self): self.ssl.handshake_seq=SSL_HSO_SERVER_CLIENT
Enable keybridging. Depending on the direction the keybridging is performed, add the self.ssl.client_keypair_generate
or the self.ssl.server_keypair_generate
parameter, and set it to TRUE. When the generated certificates are shown to the clients, the self.ssl.client_keypair_generate
parameter has to be used. (Actually, if a keypair_generate parameter is set, the proxy will request a keypair from the key_generator
class. This class — discussed a bit later — returns either a newly generated keypair, or if its key_file
parameter is set, a pregenerated keypair. In this example this latter option will be used.)
class KeybrideHttpsProxy(HttpProxy): def config(self): self.ssl.handshake_seq=SSL_HSO_SERVER_CLIENT self.ssl.client_keypair_generate = TRUE
Configure the key_generator
class. Note that the parameters of this class must be added to the proxy as a single line, for example:
class KeybrideHttpsProxy(HttpProxy): def config(self): self.ssl.handshake_seq=SSL_HSO_SERVER_CLIENT self.ssl.client_keypair_generate = TRUE self.ssl.key_generator=X509KeyBridge( \ key_file="/etc/key.d/Keybridging_cert/key.pem", \ key_passphrase="", cache_directory="/var/lib/zorp/sslbridge",\ trusted_ca_files=("/etc/ca.d/certs/0000000070.pem",\ "/etc/ca.d/keys/0000000070.pem"),\ untrusted_ca_files=("/etc/ca.d/certs/0000000069.pem",\ "/etc/ca.d/keys/0000000069.pem"))
Create a service and a rule using the modified proxy class. Use the previously defined proxy class in your Service definition, set up service and access control properties as usual.
Restart Zorp.
Expected result:
Every time the client connects to a previously unknown host, a new certificate will be generated, signed by one of the CAs specified above. This new certificate will be stored under /var/lib/zorp/sslbridge
under a filename based on the original server certificate. It will also be shown to the client as the server certificate, and assuming the signer CA is trusted, the client (browser or other application) will not warn about untrusted certificates in any way. If the certificate is signed by the CA for untrusted certificates, the application will not recognize the issuer CA (since its certificate has not been imported to the client) and give a warning to the user. The user can then decide whether the certificate can be accepted or not.
(Actually, two files are stored on the firewall for each certificate: the original certificate received from the server, and the generated certificate. When a client connects to the server, the certificate provided by the server is compared to the stored one: if the two does not match, a new certificate is generated. This happens for example if the server certificate has been expired and refreshed.)
The SSL protocol is defined by Netscape Ltd. at http://wp.netscape.com/eng/ssl3/ssl-toc.html
The TLS protocol is defined in RFC 2246.
The SSL options are described in detail in the documentation of the Proxy class. See Section 5.10.4, Class Proxy.
This chapter contains reference information on all the available Zorp proxies.
The sections discussing the available proxies are organized as follows. Overall introduction is followed by proxy class descriptions. Each module has an abstract class which is an interface between the policy and the proxy itself. Abstract classes are the point where the low-level attributes implemented by the proxy appear.
Each Python module contains an abstract proxy class (e.g., AbstractFtpProxy) and one or more preconfigured proxy classes derived from the abstract class (e.g., FtpProxy, FtpProxyRO, etc.). These abstract proxies are very low level classes which always require customization to operate at all, thus they are not directly usable. The preconfigured classes customize the base abstract proxy to perform actually useful functionality. These derived classes inherit all their attributes from the class they were derived from, but have some of their parameters set to default values. Consequently, they can be used for certain tasks without any (or only minimal) modification. Most default classes were derived directly from the abstract classes, but it is possible to derive a class from another derived class. In this case this new class inherits the attributes from its parent class and the abstract class as well. Abstract classes should not be used directly for configuring services in Zorp, always derive an own class and modify its attributes to suit the requirements.
The description of each abstract class includes a detailed list and definition of the attributes of the proxy class. The type and default value of the attribute is also provided. Most types of the attributes (e.g., integer, string, boolean, etc.) are self-explanatory; more complicated attributes (listed as complex type) are explained in their respective description or in the general proxy behavior section of the module.
Proxy attributes can be available and modified during configuration time, run time, or
both. Configuration time attributes are set and modified when the proxy is configured,
that is, when the session starts. Run time attributes are available when the connection is
active, for example, information about the HTTP header being processed is available only
when the header is processed. Access to the attributes is indicated in the header of the
description of the attribute in the following format: availability during
configuration time : availability during run time
. The type of availability
can be read (r
) access, write (w
) access,
both, or not available (n/a
). An attribute that is available for
reading and writing during both configuration and run time is indicated as
rw:rw
, an attribute that is available only for reading during run
time is indicated as n/a:r
.
Note |
---|
Unless noted otherwise, default values related to lengths (e.g., line length, etc.) are in bytes. Timeout values are always given in milliseconds. Setting a timeout to
|
The description of every proxy class includes a list or textual description of the attributes modified relative to their parent class. The values of the other attributes are inherited from the parent class.
A number of Python code samples is provided for the proxies to illustrate both their general operation and their capabilities. Most of the proxy configurations shown in the examples can be easily reproduced using the graphical interface. However, some of them utilize the advanced flexibility of Zorp and therefore require the use of configuration scripts written in Python. From these can be implemented, maintained and edited using the Class editor. (The Class editor is available under the Proxies tab of the Zorp component. When creating a new class, click on the button under the list of available classes.)
This module defines an interface to the AnyPy proxy implementation. AnyPy is basically a Python proxy which means that the proxy behaviour is defined in Python by the administrator.
Class | Description |
---|---|
AbstractAnyPyProxy | Class encapsulating an AnyPy proxy. |
AnyPyProxy | Class encapsulating the default AnyPy proxy. |
Table 4.1. Classes of the AnyPy module
This class encapsulates AnyPy, a proxy module calling a Python function to do all of its work. It can be used for defining proxies for protocols not directly supported.
Warning |
---|
This proxy class is a basis for creating a custom proxy, and cannot be used on its own. Create a new proxy class using the AnyPyProxy as its parent, and implement the proxyThread method to handle the traffic. Your code will be running as the proxy to transmit protocol elements. When writing your code, take care and be security conscious: do not make security vulnerabilities. |
Method | Description |
---|---|
__init__(self, session) | Constructor to initialize an AnyPy instance. |
proxyThread(self) | Function called by the low-level proxy core to transfer requests. |
Table 4.2. Method summary
This constructor initializes a new AnyPy instance based on its arguments, and calls the inherited constructor.
This class encapsulates AnyPy, a proxy module calling a Python function to do all of its work. It can be used for defining proxies for protocols not directly supported.
This proxy class can only be used as a basis for creating a custom proxy and cannot be used on its own. Please create a new proxy class with the AnyPyProxy as its parent and implement the proxyThread method for handling traffic.
Your code will be running as the proxy to transmit protocol elements, you'll have to take care and be security conscious not to make security vulnerabilities.
The Finger module defines the classes constituting the proxy for the Finger protocol.
Finger is a request/response based User Information Protocol using port TCP/79. The client opens a connection to the remote machine to initiate a request. The client sends a one line query based on the Finger query specification and waits for the answer. A remote user information program (RUIP) processes the query, returns the result and closes the connection. The response is a series of lines consisting of printable ASCII closed carriage return-line feed (CRLF, ASCII13, ASCII10). After receiving the answer the client closes the connection as well.
The following queries can be used:
<CRLF> This is a simple query listing all users logged in to the remote machine.
USERNAME<CRLF> A query to request all available information about the user USERNAME.
USERNAME@HOST1<CRLF> Request the RUIP to forward the query to HOST1. The response to this query is all information about the user USERNAME available at the remote computer HOST1.
USERNAME@HOST1@HOST2<CRLF> Request HOST1 to forward the query to HOST2. The response to this query is all information about the user USERNAME available at the remote computer HOST2.
Finger is a module built for parsing messages of the Finger protocol. It reads the QUERY at the client side, parses it and - if the local security policy permits - sends it to the server. When the RESPONSE arrives it processes the RESPONSE and sends it back to the client. It is possible to prepend and/or append a string to the response. Requests can also be manipulated in various ways using the fingerRequest function, which is called by the proxy if it is defined.
Length of the username, the line and the hostname can be limited by setting various attributes. Finger proxy also has the capability of limiting the number of hosts in a request, e.g.: finger user@domain@server normally results in fingering 'user@domain' performed by the host 'server'. By default, the proxy removes everything after and including the first '@' character. This behavior can be modified by setting the max_hop_count attribute to a non-zero value.
Class | Description |
---|---|
AbstractFingerProxy | Class encapsulating the abstract Finger proxy. |
FingerProxy | Class encapsulating the default Finger proxy. |
Table 4.3. Classes of the Finger module
This proxy implements the Finger protocol as specified in RFC 1288.
max_hop_count (integer, rw:r) | |
---|---|
Default: 0 | |
Maximum number of '@' characters in the request. Any text after the last allowed '@' character is stripped from the request. |
max_hostname_length (integer, rw:r) | |
---|---|
Default: 30 | |
Maximum number of characters in a single name of the hostname chain. |
max_line_length (integer, rw:r) | |
---|---|
Default: 132 | |
Maximum number of characters in a single line in requests and responses. |
request_detailed (integer, n/a:rw) | |
---|---|
Default: n/a | |
Indicates if multi-line formatting request (/W prefix) was sent by the client (-l parameter). Request for multi-line formatting can be added/removed by the proxy during the fingerRequest event. |
request_hostnames (string, n/a:rw) | |
---|---|
Default: n/a | |
The hostname chain. The hostname chain can be modified by the proxy during the fingerRequest event. |
request_username (string, n/a:rw) | |
---|---|
Default: n/a | |
The username to be queried. The username can be modified by the proxy during the fingerRequest event. |
response_footer (string, rw:rw) | |
---|---|
Default: | |
String to be appended by the proxy to each finger response. |
response_header (string, n/a:rw) | |
---|---|
Default: "" | |
String to be prepended by the proxy to each finger response. |
Method | Description |
---|---|
fingerRequest(self, username, hostname) | Function processing finger requests. |
Table 4.4. Method summary
This function is called by the Finger proxy to process requests. It can also modify request-specific attributes.
The Ftp module defines the classes constituting the proxy for the File Transfer Protocol (FTP).
File Transfer Protocol (FTP) is a protocol to transport files via a reliable TCP connection between a client and a server. FTP uses two reliable TCP connections to transfer files: a simple TCP connection (usually referred to as the Control Channel) to transfer control information and a secondary TCP connection (usually referred to as the Data Channel) to perform the data transfer. It uses a command/response based approach, i.e. the client issues a command and the server responds with a 3-digit status code and associated status information in text format. The Data Channel can be initiated either from the client or the server; the Control Channel is always started from the client.
The client is required to authenticate itself before other commands can be issued. This is performed using the USER and PASS commands specifying username and password, respectively.
The basic protocol is as follows: the client issues a request (also called command in FTP terminology) and the server responds with the result. Both commands and responses are line based: commands are sent as complete lines starting with a keyword identifying the operation to be performed. A response spans one or more lines, each specifying the same 3-digit status code and possible explanation.
Certain commands (for example RETR, STOR or LIST) also have a data attachment which is transferred to the peer. Data attachments are transferred in a separate TCP connection. This connection is established on-demand on a random, unprivileged port when a data transfer command is issued.
Endpoint information of this data channel is exchanged via the PASV and PORT commands, or their newer equivalents (EPSV and EPRT).
The data connection can either be initiated by the client (passive mode) or the server (active mode). In passive mode (PASV or EPSV command) the server opens a listening socket and sends back the endpoint information in the PASV response. In active mode (PORT or EPRT command) the client opens a listening socket and sends its endpoint information as the argument of the PORT command. The source port of the server is usually either 20, or the port number of the Command Channel minus one.
FtpProxy is a module built for parsing commands of the Control Channel in the FTP protocol. It reads the REQUEST at the client side, parses it and - if the local security policy permits - sends it to the server. The proxy parses the arriving RESPONSES and sends them to the client if the policy permits that. FtpProxy uses a PlugProxy to transfer the data arriving in the Data Channel. The proxy is capable of manipulating commands and stacking further proxies into the Data Channel. Both transparent and non-transparent modes are supported.
The default low-level proxy implementation (AbstractFtpProxy) denies all requests by default. Different commands and/or responses can be enabled by using one of the several predefined proxy classes which are suitable for most tasks. Alternatively, use of the commands can be permitted individually using different attributes. This is detailed in the following two sections.
Changing the default behavior of commands can be done by
using the hash attribute request
, indexed by the command name (e.g.: USER or PWD). There is a similar attribute for responses called response
, indexed by the command name and the response code.
The possible values of these hashes are shown in the tables below. See Section 2.1, Policies for requests and responses for details. When looking up entries of the response
attribute hash, the lookup precedence described in Section 2.1.2, Response codes is used.
Action | Description |
---|---|
FTP_REQ_ACCEPT | Allow the request to pass. |
FTP_REQ_REJECT | Reject the request with the error message specified in the second optional parameter. |
FTP_REQ_ABORT | Terminate the connection. |
Table 4.5. Action codes for commands in FTP
Action | Description |
---|---|
FTP_RSP_ACCEPT | Allow the response to pass. |
FTP_RSP_REJECT | Modify the response to a general failure with error message specified in the optional second parameter. |
FTP_RSP_ABORT | Terminate the connection. |
Table 4.6. Action codes for responses in FTP
FTP servers send the list of supported features to the clients. For example, ProFTPD supports the following features: LANG en, MDTM, UTF8, AUTH TLS, PBSZ, PROT, REST STREAM, SIZE
. The default behavior of FTP features can be changed using the hash attribute features
, indexed by the name of the feature (e.g.: UTF8 or AUTH TLS).
The possible actions are shown in the table below. See Section 2.1, Policies for requests and responses for details.
The built-in FTP proxies permit the use of every feature by default.
Action | Description |
---|---|
FTP_FEATURE_ACCEPT | Forward the availability of the feature from the server to the client. |
FTP_FEATURE_DROP | Remove the feature from the feature list sent by the server. |
FTP_FEATURE_INSERT | Add the feature into the list of available features. |
Table 4.7. Policy about enabling FTP features.
For FTPS connections to operate correctly, the FTP server and client applications must comply to the FTP Security Extensions (RFC 2228) and Securing FTP with TLS (RFC 4217) RFCs.
For FTPS connections, the AUTH TLS, PBSZ, PROT
features must be accepted. Also, STARTTLS support must be properly configured. See Section 3.2, Configuring TLS and SSL encrypted connections for details.
If the proxy is configured to disable encryption between Zorp and the client, the proxy automatically removes the AUTH TLS, PBSZ, PROT
features from the list sent by the server.
If STARTTLS connections are accepted on the client side (self.ssl.client_security=SSL_ACCEPT_STARTTLS
), but TLS-forwarding is disabled on the server side, the proxy automatically inserts the AUTH TLS, PBSZ, PROT
features into the list sent by the server. These features are inserted even if encryption is explicitly disabled on the server side or the server does not support the FEAT
command, making one-sided STARTTLS support feasible.
Warning |
---|
When using inband routing with the FTPS protocol, the server's certificate is compared to its hostname. The subject_alt_name parameter (or the Common Name parameter if the subject_alt_name parameter is empty) of the server's certificate must contain the hostname or the IP address (as resolved from the Zorp host) of the server (e.g., Alternatively, the Common Name or the Note that if the Common Name of the certificate contains a generic hostname, do not specify a specific hostname or an IP address in the |
Note |
---|
|
The available stacking modes for this proxy module are listed in the following table. For additional information on stacking, see Section 2.3.1, Proxy stacking.
Action | Description |
---|---|
FTP_STK_DATA | Pass the data to the stacked proxy or program. |
FTP_STK_NONE | No proxy stacked. |
Table 4.8. Stacking policy.
The Ftp proxy supports inband authentication as well to use the built-in authentication method of the FTP and FTPS protocols to authenticate the client. The authentication itself is performed by the backend configured for the service.
If the client uses different usernames on and the remote server (e.g., he uses his own username to authenticate to , but anonymous on the target FTP server), the client must specify the usernames and passwords in the following format:
Username:
<ftp user>@<proxy user>@<remote site>[:<port>]
Password:
<ftp password>@<proxy password>
Alternatively, all the above information can be specified as the username:
<ftp user>@<proxy user>@<remote site>[:<port>]:<ftp password>@<proxy password>
Warning |
---|
When using inband routing with the FTPS protocol, the server's certificate is compared to its hostname. The subject_alt_name parameter (or the Common Name parameter if the subject_alt_name parameter is empty) of the server's certificate must contain the hostname or the IP address (as resolved from the Zorp host) of the server (e.g., Alternatively, the Common Name or the Note that if the Common Name of the certificate contains a generic hostname, do not specify a specific hostname or an IP address in the |
The File Transfer Protocol is described in RFC 959.
FTP Security Extensions including the FTPS protocol and securing FTP with TLS are described in RFC 2228 and RFC 4217.
Class | Description |
---|---|
AbstractFtpProxy | Class encapsulating the abstract FTP proxy. |
FtpProxy | Default Ftp proxy based on AbstractFtpProxy. |
FtpProxyAnonRO | FTP proxy based on AbstractFtpProxy, only allowing read-only access to anonymous users. |
FtpProxyAnonRW | FTP proxy based on AbstractFtpProxy, allowing full read-write access, but only to anonymous users. |
FtpProxyRO | FTP proxy based on AbstractFtpProxy, allowing read-only access to any user. |
FtpProxyRW | FTP proxy based on AbstractFtpProxy, allowing full read-write access to any user. |
Table 4.9. Classes of the Ftp module
This proxy implements the FTP protocol as specified in RFC 959. All traffic and commands are denied by default. Consequently, either customized Ftp proxy classes derived from the abstract class should be used, or one of the predefined classes (e.g.: FtpProxy, FtpProxyRO, etc.).
auth_tls_ok_client (boolean, n/a:r) | |
---|---|
Default: "" | |
Shows whether the client-side authentication was performed over a secure channel. |
auth_tls_ok_server (boolean, n/a:r) | |
---|---|
Default: "" | |
Shows whether the server-side authentication was performed over a secure channel. |
data_port_max (integer, rw:r) | |
---|---|
Default: 41000 | |
On the proxy side, ports equal to or below the value of data_port_max can be allocated as the data channel.
|
data_port_min (integer, rw:r) | |
---|---|
Default: 40000 | |
On the proxy side, ports equal to or above the value of data_port_min can be allocated as the data channel.
|
data_protection_enabled_client (boolean, n/a:r) | |
---|---|
Default: "" | |
Shows whether the data channel is encrypted or not on the client-side. |
data_protection_enabled_server (boolean, n/a:r) | |
---|---|
Default: "" | |
Shows whether the data channel is encrypted or not on the server-side. |
hostname (string, n/a:rw) | |
---|---|
Default: | |
The hostname of the FTP server to connect to, when inband routing is used. |
hostport (integer, n/a:rw) | |
---|---|
Default: | |
The port of the FTP server to connect to, when inband routing is used. |
max_hostname_length (integer, rw:r) | |
---|---|
Default: 128 | |
Maximum length of hostname. Used only in non-transparent mode. |
max_line_length (integer, rw:r) | |
---|---|
Default: 255 | |
Maximum length of a line that the proxy is allowed to transfer. Requests/responses exceeding this limit are dropped. |
proxy_password (string, n/a:rw) | |
---|---|
Default: | |
The password to be used for proxy authentication given by the user, when inband authentication is used. |
proxy_username (string, n/a:rw) | |
---|---|
Default: | |
The username to be used for proxy authentication given by the user, when inband authentication is used. |
request (complex, rw:rw) | |
---|---|
Default: | |
Normative policy hash for FTP requests indexed by command name (e.g.: "USER", "PWD" etc.). See also Section 2.1, Policies for requests and responses. |
request_command (string, n/a:rw) | |
---|---|
Default: n/a | |
When a request is evaluated on the policy level, this variable contains the requested command. |
request_parameter (string, n/a:rw) | |
---|---|
Default: n/a | |
When a request is evaluated on the policy level, this variable contains the parameters of the requested command. |
request_stack (complex, rw:rw) | |
---|---|
Default: | |
Hash containing the stacking policy for the FTP commands. The hash is indexed by the FTP command (e.g. RETR, STOR). See also Section 2.3.1, Proxy stacking. |
response (complex, rw:rw) | |
---|---|
Default: | |
Normative policy hash for FTP responses indexed by command name and answer code (e.g.: "USER","331"; "PWD","200" etc.). See also Section 2.1, Policies for requests and responses. |
response_parameter (string, n/a:rw) | |
---|---|
Default: | |
When a response is evaluated on the policy level, this variable contains answer parameters. |
response_status (string, n/a:rw) | |
---|---|
Default: | |
When a response is evaluated on the policy level, this variable contains the answer code. |
response_strip_msg (boolean, rw:r) | |
---|---|
Default: FALSE | |
Strip the response message and only send the response code. |
target_port_range (string, rw:r) | |
---|---|
Default: "21" | |
The port where the client can connect through a non-transparent FtpProxy. |
timeout (integer, rw:r) | |
---|---|
Default: 300000 | |
General I/O timeout in milliseconds. When there is no specific timeout for a given operation, this value is used. |
A permitting Ftp proxy based on the AbstractFtpProxy, allowing all commands, responses, and features, including unknown ones. The connection is terminated if a response with the answer code 421
is received.
FTP proxy based on AbstractFtpProxy, enabling read-only access (i.e. only downloading) to anonymous users (uploads and usernames other than 'anonymous' or 'ftp' are disabled). Commands and return codes are strictly checked, unknown commands and responses are rejected. Every feature is accepted.
The ABOR; ACCT; AUTH; CDUP; CWD; EPRT; EPSV; FEAT; LIST; MODE; MDTM; NLST; NOOP; OPTS; PASV; PASS; PORT; PWD; QUIT; REST; RETR; SIZE; STAT; STRU; SYST; TYPE; and USER commands are permitted, the CLNT; XPWD; MACB commands are rejected.
FTP proxy based on AbstractFtpProxy, enabling full read-write access to anonymous users (the 'anonymous' and 'ftp' usernames are permitted). Commands and return codes are strictly checked, unknown commands and responses are rejected. Every feature is accepted.
The ABOR; ACCT; APPE; CDUP; CWD; DELE; EPRT; EPSV; LIST; MKD; MODE; MDTM; NLST; NOOP; OPTS; PASV; PASS; PORT; PWD; QUIT; RMD; RNFR; RNTO; REST; RETR; SIZE; STAT; STOR; STOU; STRU; SYST; TYPE; USER and FEAT commands are permitted, the AUTH; CLNT; XPWD; MACB commands are rejected.
FTP proxy based on AbstractFtpProxy, enabling read-only access to any user. Commands and return codes are strictly checked, unknown commands and responses are rejected. Every feature is accepted.
The ABOR; ACCT; AUTH; CDUP; CWD; EPRT; EPSV; FEAT; LIST; MODE; MDTM; NLST; NOOP; OPTS; PASV; PASS; PORT; PWD; QUIT; REST; RETR; SIZE; STAT; STRU; SYST; TYPE; and USER commands are permitted, the CLNT; XPWD; MACB commands are rejected.
FTP proxy based on AbstractFtpProxy, enabling full read-write access to any user. Commands and return codes are strictly checked, unknown commands and responses are rejected. Every feature is accepted.
The ABOR; ACCT; AUTH; CDUP; CWD; EPRT; EPSV; FEAT; LIST; MODE; MDTM; NLST; NOOP; OPTS; PASV; PASS; PORT; PWD; QUIT; REST; RETR; SIZE; STAT; STRU; SYST; TYPE; and USER commands are permitted, the CLNT; XPWD; MACB commands are rejected.
The Http module defines the classes constituting the proxy for the HyperText Transfer Protocol (HTTP). HTTP is the protocol the Web is based on, therefore it is the most frequently used protocol on the Internet. It is used to access different kinds of content from the Web. The type of content retrieved via HTTP is not restricted, it can range from simple text files to hypertext files and multimedia formats like pictures, videos or audio files.
HTTP is an open application layer protocol for hypermedia information systems. It basically allows an open-ended set of methods to be applied to resources identified by Uniform Resource Identifiers (URIs).
HTTP is a text based protocol where a client sends a request comprising of a METHOD, an URI and associated meta information represented as MIME-like headers, and possibly a data attachment. The server responds with a status code, a set of headers, and possibly a data attachment. Earlier protocol versions perform a single transaction in a single TCP connection, HTTP/1.1 introduces persistency where a single TCP connection can be reused to perform multiple transactions.
An HTTP method is a single word - usually spelled in capitals - instructing the server to apply a function to the resource specified by the URI. Commonly used HTTP methods are "GET", "POST" and "HEAD". HTTP method names are not restricted in any way, other HTTP based protocols (such as WebDAV) add new methods to the protocol while keeping the general syntax intact.
Headers are part of both the requests and the responses. Each header consists of a name followed by a colon (':') and a field value. These headers are used to specify content-specific and protocol control information.
The response to an HTTP request starts with an HTTP status line informing the client about the result of the operation and an associated message. The result is represented by three decimal digits, the possible values are defined in the HTTP RFCs.
The protocol has three variants, differentiated by their version number. Version 0.9 is a very simple protocol which allows a simple octet-stream to be transferred without any meta information (e.g.: no headers are associated with requests or responses).
Version 1.0 introduces MIME-like headers in both requests and responses; headers are used to control both the protocol (e.g.: the "Connection" header) and to give information about the content being transferred (e.g.: the "Content-Type" header). This version has also introduced the concept of name-based virtual hosts.
Building on the success of HTTP/1.0, version 1.1 of the protocol adds persistent connections (also referred to as "connection keep-alive") and improved proxy control.
Both requests and responses might have an associated data blob, also called an entity in HTTP terminology. The size of the entity is determined using one of three different methods:
The complete size of the entity is sent as a header (the Content-Length header).
The transport layer connection is terminated when transfer of the blob is completed (used by HTTP/0.9 and might be used in HTTP/1.1 in non-persistent mode).
Instead of specifying the complete length, smaller chunks of the complete blob are transferred, and each chunk is prefixed with the size of that specific chunk. The end of the stream is denoted by a zero-length chunk. This mode is also called chunked encoding and is specified by the Transfer-Encoding header.
The default low-level proxy implementation (AbstractHttpProxy) denies all requests by default. Different requests and/or responses can be enabled by using one of the several predefined proxy classes which are suitable for most tasks. Alternatively, a custom proxy class can be derived from AbstractHttpProxy and the requests and responses enabled individually using different attributes.
Several examples and considerations on how to enable virus filtering in the HTTP traffic are discussed in the Technical White Paper and Tutorial Virus filtering in HTTP, available at the BalaSys Documentation Page http://www.balasys.hu/documentation/.
HttpProxy is able to operate both in transparent and non-transparent mode. In transparent mode, the client does not notice (or even know) that it is communicating through a proxy. The client communicates using normal server-style requests.
In non-transparent mode, the address and the port of the proxy server must be set on the client. In this case the client sends proxy-style requests to the proxy.
In non-transparent mode it is possible to request the use of the SSL protocol through the proxy, which means the client communicates with the proxy using the HTTP protocol, but the proxy uses HTTPS to communicate with the server. This technique is called data tunneling.
Changing the default behavior of requests is possible using the
request
attribute. This hash is indexed by the HTTP method
names (e.g.: GET or POST). The response
attribute (indexed by the request method and the response code) enables the control of HTTP responses. The possible actions are described in the following tables. See also Section 2.1, Policies for requests and responses. When looking up entries of the response
attribute hash, the lookup precedence described in Section 2.1.2, Response codes is used.
Action | Description |
---|---|
HTTP_REQ_ACCEPT |
Allow the request to pass. |
HTTP_REQ_REJECT |
Reject the request. The reason for the rejection can be specified in the optional second argument. |
HTTP_REQ_ABORT |
Terminate the connection. |
HTTP_REQ_POLICY |
Call the function specified to make a decision about the event. The function receives four arguments: self, method, url, version. See Section 2.1, Policies for requests and responses for details. |
Table 4.10. Action codes for HTTP requests
Action | Description |
---|---|
HTTP_RSP_ACCEPT | Allow the response to pass. |
HTTP_RSP_DENY | Reject the response and return a policy violation page to the client. |
HTTP_RSP_REJECT | Reject the response and return a policy violation page to the client, with error information optionally specified as the second argument. |
HTTP_RSP_POLICY | Call the function specified to make a decision about the event. The function receives five parameters: self, method, url, version, response. See Section 2.1, Policies for requests and responses for details. |
Table 4.11. Action codes for HTTP responses
Both request and response headers can be modified by the proxy during
the transfer. New header lines can be inserted, entries can be modified
or deleted. To change headers in the requests and responses use the
request_header
hash or the response_header
hash, respectively.
Similarly to the request hash, these hashes are indexed by the header name (like "User-Agent") and contain an actiontuple describing the action to take.
By default, the proxy modifies only the "Host", "Connection", "Proxy-Connection" and "Transfer-Encoding" headers. "Host" headers need to be changed when the proxy modifies the URL; "(Proxy-)Connection" is changed when the proxy turns connection keep-alive on/off; "Transfer-Enconding" is changed to enable chunked encoding.
Action | Description |
---|---|
HTTP_HDR_ABORT | Terminate the connection. |
HTTP_HDR_ACCEPT | Accept the header. |
HTTP_HDR_DROP | Remove the header. |
HTTP_HDR_POLICY | Call the function specified to make a decision about the event. The function receives three parameters: self, hdr_name, and hdr_value. |
HTTP_HDR_CHANGE_NAME | Rename the header to the name specified in the second argument. |
HTTP_HDR_CHANGE_VALUE | Change the value of the header to the value specified in the second argument. |
HTTP_HDR_CHANGE_BOTH | Change both the name and value of the header to the values specified in the second and third arguments, respectively. |
HTTP_HDR_INSERT | Insert a new header defined in the second argument. |
HTTP_HDR_REPLACE | Remove all existing occurrences of a header and replace them with the one specified in the second argument. |
Table 4.12. Action codes for HTTP headers
URLs or sets of URLs can be easily rejected or redirected to a local mirror by modifying some attributes during request processing.
When an HTTP request is received, normative policy chains are processed
(self.request
, self.request_header
). Policy callbacks for certain events can be configured with the HTTP_REQ_POLICY or HTTP_HDR_POLICY directives. Any of these callbacks may change the request_url
attribute, instructing the proxy to fetch a page different from the one specified by the browser. Please note that this is transparent
to the user and does not change the URL in the browser.
Zorp differentiates between two request types: server requests and proxy request.
Server requests are sent by browsers directly communicating with HTTP servers. These requests include an URL relative to the server root (e.g.: /index.html), and a 'Host' header indicating which virtual server to use.
Proxy requests are used when the browser communicates with an HTTP proxy. These requests include a fully specified URL (e.g.: http://www.example.com/index.html).
Zorp determines the type of the incoming request from the request URL, even if the Proxy-connection header exist. As there is no clear distinction between the two request types, the type of the request cannot always be accurately detected automatically, though all common cases are covered.
Requests are handled differently in transparent and non-transparent modes.
A transparent HTTP proxy (transparent_mode
attribute is TRUE) is
meant to be installed in front of a network where clients do not
know about the presence of the firewall. In this case the proxy
expects to see server type requests only. If clients communicate
with a real HTTP proxy through the firewall, proxy type requests
must be explicitly enabled using the permit_proxy_requests
attribute, or transparent mode has to be used.
The use of non-transparent HTTP proxies (transparent_mode
attribute is FALSE) must be configured in web browsers behind
the firewall. In this case Zorp expects proxy requests only, and
emits server requests (assuming parent_proxy
is not set).
Parent proxies are non-transparent HTTP proxies used behind Zorp. Two things have to be set in order to use parent proxies. First,
select a router which makes the proxy connect to the
parent proxy, this can be either InbandRouter() or
DirectedRouter(). Second, set the parent_proxy
and
parent_proxy_port
attributes in the HttpProxy class. Setting
these attributes results in proxy requests to be emitted to the
target server both in transparent and non-transparent mode.
The parent proxy attributes can be set both in the configuration phase (e.g.: config() event), or later on a per-request basis. This is possible because the proxy re-connects.
In non-transparent mode it is possible to let Zorp process ftp://
URLs, effectively translating HTTP requests to FTP requests on
the fly. This behaviour can be enabled by setting
permit_ftp_over_http
to TRUE and adding port 21 to
target_port_range
. Zorp currently supports passive mode
transfers only.
There are cases when the HTTP proxy must return an error page to
the client to indicate certain error conditions. These error
messages are stored as files in the directory specified by the
error_files_directory
attribute, and can be customized by
changing the contents of the files in this directory.
Each file contains plain HTML text, but some special macros are provided to dynamically add information to the error page. The following macros can be used:
@INFO@ -- further error information as provided by the proxy
@VERSION@ -- Zorp version number
@DATE@ -- current date
@HOST@ -- hostname of Zorp
It is generally recommended not to display error messages to
untrusted clients, as they may leak confidential information. To
turn error messages off, set the error_silent
attribute to TRUE, or
strip error files down to a minimum.
Note |
---|
The language of the messages can be set using the |
HTTP supports stacking proxies for both request and response
entities (e.g.: data bodies). This is controlled by the
request_stack
and response_stack
attribute hashes. See also Section 2.3.1, Proxy stacking.
There are two stacking modes available: HTTP_STK_DATA sends only the data portion to the downstream proxy, while HTTP_STK_MIME also sends all header information to make it possible to process the data body as a MIME envelope. Please note that while it is possible to change the data part in the stacked proxy, it is not possible to change the MIME headers - they can be modified only by the HTTP proxy. The possible parameters are listed in the following tables.
Action | Description |
---|---|
HTTP_STK_NONE | No additional proxy is stacked into the HTTP proxy. |
HTTP_STK_DATA | The data part of the HTTP traffic is passed to the specified stacked proxy. |
HTTP_STK_MIME | The data part including header information of the HTTP traffic is passed to the specified stacked proxy. |
Table 4.13. Constants for proxy stacking
Please note that stacking is skipped altogether if there is no body in the message.
Certain webserver applications may return data entities in 205 responses. This is explicitly prohibited by the RFCs, but Zorp permits such responses for interoperability reasons.
Zorp’s HTTP proxy offers the ‘session persistence in load balancing’ feature, further enhancing Zorp’s load balancing capabilities by that.
With the help of this feature, the Round Robin chainer can identify connections by their session IDs and make sure that every connection with the same session ID is always addressed to the same server, so that the session persists.
For using the ‘session persistence in load balancing’ feature, the administrator has to configure the following three attributes for the HTTP proxy:
Enable_session_persistence
You can switch on or off the ‘Session persistence in load balancing’ feature with that parameter.
Session_persistence_cookie_name
This parameter can only be configured if enable_session_persistence is set to TRUE. The administrator can provide the name of the cookie here: Zorp directs all incoming requests to a web server and each web server sends a session ID back to Zorp. The name of this session ID, that is, the cookie name, can be provided here to ensure that requests with the same session ID are directed to the same web server.
Session_persistence_cookie_salt
This parameter can only be configured if enable_session_persistence is set to TRUE. The administrator can provide the salt here, with which the IP address of the web server can be hashed before the session ID. With the help of this hashed information Zorp can next time identify to which server the next connection attempt of this session has to be directed.
Starting with version 3.3FR1, Zorp supports category-based URL filtering using a regularly updated database.
To configure URL-filtering, see Section Configuring URL-filtering in HTTP.
For the list of categories available by default, see Section List of URL-filtering categories.
To customize or expand the URL-database, see Section Customizing the URL database.
The URLs and domains in the database are organized into thematic categories like adult
, news
, jobsearch
, etc.
To enable url-filtering, set the enable_url_filter
and enable_url_filter_dns
options to TRUE
. The enable_url_filter_dns
option is needed only to ensure that a domain or URL is correctly categorized even when it is listed in the database using its domain name, but the client tries to access it with its IP address (or vice-versa).
Note |
---|
URL-filtering is handled by the Zorp Http proxy, without the need of using ZCV. The URL-filtering capability of Zorp is available only after purchasing the Updates to the URL database are automatically downloaded daily from the BalaSys website using the zavupdate utility. |
Access to specific categories can be set using the url_category
option, which is a hash indexed by the name of the category. The following actions are possible:
Action | Description |
---|---|
HTTP_URL_ACCEPT |
Permit access to the URL. |
HTTP_URL_REJECT |
Reject the request. The error code and reason for the rejection are specified in the second and third arguments. See Section Configuring URL-filtering in HTTP for details. |
HTTP_URL_REDIRECT |
Redirect the connection to the URL specified in the second argument. |
Table 4.14. Action codes for URL filtering
Example 4.14. URL-filtering example |
---|
The following example blocks several categories and accepts the rest. For a complete list of categories, see Section List of URL-filtering categories. class MyHTTPUrlFilter(HttpProxy): def config(self): HttpProxy.config(self) self.enable_url_filter=TRUE self.enable_url_filter_dns=TRUE self.url_category['adult']=(HTTP_URL_REJECT, (403, "Adult website",)) self.url_category['porn']=(HTTP_URL_REJECT, (403, "Porn website",)) self.url_category['malware']=(HTTP_URL_REJECT, (403, "Site contains malware",)) self.url_category['phishing']=(HTTP_URL_REJECT, (403, "Phishing site",)) self.url_category['warez']=(HTTP_URL_REJECT, (403, "Warez site",)) self.url_category['*']=(HTTP_URL_ACCEPT,) The following example redirects access to online gaming sites to a dummy website. class MyHTTPUrlFilter(HttpProxy): def config(self): HttpProxy.config(self) self.enable_url_filter=TRUE self.enable_url_filter_dns=TRUE self.url_category['onlinegames']=(HTTP_URL_REDIRECT, "http://example.com") self.url_category['*']=(HTTP_URL_ACCEPT,) |
The Zorp URL database contains the following thematic categories by default.
abortion: Abortion information excluding when related to religion
ads: Advert servers and banned URLs
adult: Sites containing adult material such as swearing but not porn
aggressive: Similar to violence but more promoting than depicting
antispyware: Sites that remove spyware
artnudes: Art sites containing artistic nudity
astrology: Astrology websites
audio-video: Sites with audio or video downloads
banking: Banking websites
beerliquorinfo: Sites with information only on beer or liquors
beerliquorsale: Sites with beer or liquors for sale
blog: Journal/Diary websites
cellphones: stuff for mobile/cell phones
chat: Sites with chat rooms etc
childcare: Sites to do with childcare
cleaning: Sites to do with cleaning
clothing: Sites about and selling clothing
contraception: Information about contraception
culinary: Sites about cooking et al
dating: Sites about dating
desktopsillies: Sites containing screen savers, backgrounds, cursers, pointers, desktop themes and similar timewasting and potentially dangerous content
dialers: Sites with dialers such as those for pornography or trojans
drugs: Drug related sites
ecommerce: Sites that provide online shopping
entertainment: Sites that promote movies, books, magazine, humor
filehosting: Sites to do with filehosting
frencheducation: Sites to do with french education
gambling: Gambling sites including stocks and shares
games: Game related sites
gardening: Gardening sites
government: Military and schools etc
guns: Sites with guns
hacking: Hacking/cracking information
homerepair: Sites about home repair
hygiene: Sites about hygiene and other personal grooming related stuff
instantmessaging: Sites that contain messenger client download and web-based messaging sites
jewelry: Sites about and selling jewelry
jobsearch: Sites for finding jobs
kidstimewasting: Sites kids often waste time on
mail: Webmail and email sites
marketingware: Sites about marketing products
medical: Medical websites
mixed_adult: Mixed adult content sites
mobile-phone: Sites to do with mobile phones
naturism: Sites that contain nude pictures and/or promote a nude lifestyle
news: News sites
onlineauctions: Online auctions
onlinegames: Online gaming sites
onlinepayment: Online payment sites
personalfinance: Personal finance sites
pets: Pet sites
phishing: Sites attempting to trick people into giving out private information
porn: Pornography
proxy: Sites with proxies to bypass filters
radio: non-news related radio and television
religion: Sites promoting religion
ringtones: Sites containing ring tones, games, pictures and other
searchengines: Search engines such as google
sect: Sites about religious groups
sexuality: Sites dedicated to sexuality, possibly including adult material
shopping: Shopping sites
socialnetworking: Social networking websites
sportnews: Sport news sites
sports: All sport sites
spyware: Sites who run or have spyware software to download
updatesites: Sites where software updates are downloaded from including virus sigs
vacation: Sites about going on holiday
violence: Sites containing violence
virusinfected: Sites who host virus infected files
warez: Sites with illegal pirate software
weather: Weather news sites and weather related
weapons: Sites detailing or selling weapons
webmail: Just webmail sites
whitelist: Contains site suitable for kids
To customize the database, you have to manually edit the relevant files of the database. The URL database is located on the Zorp hosts under the /etc/zorp/urlfilter/
directory. Every thematic category is subdirectory containing two files called domains
and urls
. These files contain the list of domains (e.g., example.com
) and URLs (e.g., example.com/news/
) that fall into the specific category. Optionally, the subdirectory may contain a third file called expressions
, where more complex rules can be defined using regular expressions.
To to allow access (whitelist) to a domain or URL, add it to the domains
or urls
file of the whitelist
category. Do not forget to configure your Http proxies to permit access to the domains of the whitelist
category.
Warning |
---|
Deleting a domain from a category is not equivalent to whitelisting. Deleted domains will be re-added to their original category after the next database update. |
To add a new URL or domain to an existing category, create a new subdirectory under /etc/zorp/urlfilter/
, create the domains
and urls
files for this new category, and add the domain or URL (without the http://www.
prefix) to the domains
or urls
file. Zorp will automatically add these sites to the specific category after the next daily database update, or when the zufupdate command is executed.
To create a new category, create a new subdirectory under /etc/zorp/urlfilter/
, create the domains
and urls
files for this new category, and add domains and URLs to these files. Do not forget to configure your Http proxies to actually use the new category.
Warning |
---|
Manual changes to the URL database are not applied automatically, they become effective only after the next daily database update, or when the zufupdate command is executed. |
Note |
---|
Manual changes are automatically merged with the original database during database updates. If you are using the URL-filter database on several Zorp hosts and modify the database manually, make sure to copy your changes to the other hosts as well. |
The Hypertext Transfer Protocol -- HTTP/1.1 protocol is described in RFC 2616.
The Hypertext Transfer Protocol -- HTTP/1.0 protocol is described in RFC 1945.
Class | Description |
---|---|
AbstractHttpProxy | Class encapsulating the abstract HTTP proxy. |
HttpProxy | Default HTTP proxy based on AbstractHttpProxy. |
HttpProxyNonTransparent | HTTP proxy based on HttpProxy, operating in non-transparent mode. |
HttpProxyURIFilter | HTTP proxy based on HttpProxy, with URI filtering capability. |
HttpProxyURIFilterNonTransparent | HTTP proxy based on HttpProxyURIFilter, with URI filtering capability and permitting non-transparent requests. |
HttpProxyURLCategoryFilter | HTTP proxy based on HttpProxy, with URL filtering capability based on categories. |
HttpWebdavProxy | HTTP proxy based on HttpProxy, allowing WebDAV extensions. |
NontransHttpWebdavProxy | HTTP proxy based on HttpProxyNonTransparent, allowing WebDAV extension in non-transparent requests. |
Table 4.15. Classes of the Http module
This class implements an abstract HTTP proxy - it serves as a starting point for customized proxy classes, but is itself not directly usable. Service definitions should refer to a customized class derived from AbstractHttpProxy, or one of the predefined proxy classes, such as HttpProxy or HttpProxyNonTransparent. AbstractHttpProxy denies all requests by default.
auth_by_cookie (boolean, rw:r) | |
---|---|
Default: FALSE | |
Authentication informations for one-time-password mode is organized by a cookie not the address of the client. |
auth_cache_time (integer, rw:r) | |
---|---|
Default: 0 | |
Caching authentication information this amount of seconds. |
auth_realm (string, w:r) | |
---|---|
Default: "Zorp HTTP auth" | |
The name of the authentication realm to be presented to the user in the dialog window during inband authentication. |
enable_session_persistence (boolean, rw:rw) | |
---|---|
Default: FALSE | |
Allow persistent load balanced connections when accessing session-aware application servers. |
enable_url_filter (boolean, rw:r) | |
---|---|
Default: FALSE | |
Enables URL filtering in HTTP requests. See Section 4.7.2.12, URL filtering in HTTP for details. |
enable_url_filter_dns (boolean, rw:r) | |
---|---|
Default: FALSE | |
Enables DNS- and reverse-DNS resolution to ensure that a domain or URL is correctly categorized even when it is listed in the database using its domain name, but the client tries to access it with its IP address (or vice-versa). See Section 4.7.2.12, URL filtering in HTTP for details. |
error_files_directory (string, rw:rw) | |
---|---|
Default: "/usr/share/zorp/http" | |
Location of HTTP error messages. |
error_headers (string, n/a:rw) | |
---|---|
Default: n/a | |
A string included as a header in the error response. The string must be a valid header and must end with a " " sequence. |
error_silent (boolean, rw:rw) | |
---|---|
Default: FALSE | |
Turns off verbose error reporting to the HTTP client (makes firewall fingerprinting more difficult). |
error_status (integer, rw:rw) | |
---|---|
Default: 500 | |
If an error occurs, this value will be used as the status code of the HTTP response it generates. |
keep_persistent (boolean, rw:r) | |
---|---|
Default: FALSE | |
Try to keep the connection to the client persistent even if the server does not support it. |
language (string, rw:r) | |
---|---|
Default: "en" | |
Specifies the language of the HTTP error pages displayed to the client. English (en ) is the default. Other supported languages: de (German); hu (Hungarian).
|
max_body_length (integer, rw:rw) | |
---|---|
Default: 0 | |
Maximum allowed length of an HTTP request or response body. The default "0" value means that the length of the body is not limited. |
max_chunk_length (integer, rw:rw) | |
---|---|
Default: 0 | |
Maximum allowed length of a single chunk when using chunked transfer-encoding. The default "0" value means that the length of the chunk is not limited. |
max_header_lines (integer, rw:rw) | |
---|---|
Default: 50 | |
Maximum number of header lines allowed in a request or response. |
max_hostname_length (integer, rw:rw) | |
---|---|
Default: 256 | |
Maximum allowed length of the hostname field in URLs. |
max_line_length (integer, rw:r) | |
---|---|
Default: 4096 | |
Maximum allowed length of lines in requests and responses. This value does not affect data transfer, as data is transmitted in binary mode. |
max_url_length (integer, rw:rw) | |
---|---|
Default: 4096 | |
Maximum allowed length of an URL in a request. Note that this directly affects forms using the 'GET' method to pass data to CGI scripts. |
parent_proxy (string, rw:rw) | |
---|---|
Default: "" | |
The address or hostname of the parent proxy to be connected. Either DirectedRouter or InbandRouter has to be used when using parent proxy. |
permit_ftp_over_http (boolean, rw:r) | |
---|---|
Default: FALSE | |
Allow processing FTP URLs in non-transparent mode. |
permit_invalid_hex_escape (boolean, rw:r) | |
---|---|
Default: FALSE | |
Allow invalid hexadecimal escaping in URLs (% must be followed by two hexadecimal digits). |
permit_null_response (boolean, rw:r) | |
---|---|
Default: TRUE | |
Permit RFC incompliant responses with headers not terminated by CRLF and not containing entity body. |
permit_server_requests (boolean, rw:r) | |
---|---|
Default: TRUE | |
Allow server-type requests in non-transparent mode. |
request (complex, rw:rw) | |
---|---|
Default: empty | |
Normative policy hash for HTTP requests indexed by the HTTP method (e.g.: "GET", "PUT" etc.). See also Section 4.7.2.2, Configuring policies for HTTP requests and responses. |
request_header (complex, rw:rw) | |
---|---|
Default: empty | |
Normative policy hash for HTTP header requests indexed by the header names (e.g.: "Set-cookie"). See also Section 4.7.2.3, Configuring policies for HTTP headers. |
request_mime_type (string, n/a:r) | |
---|---|
Default: n/a | |
The MIME type of the request entity. Its value is only defined when the request is processed. |
request_stack (complex, rw:rw) | |
---|---|
Default: n/a | |
Attribute containing the request stacking policy: the hash is indexed based on method names (e.g.: GET). See Section 4.7.2.9, Stacking. |
request_url (string, n/a:rw) | |
---|---|
Default: n/a | |
The URL requested by the client. It can be modified to redirect the current request. |
request_url_proto (string, n/a:r) | |
---|---|
Default: n/a | |
Protocol specifier of the URL. This attribute is an alias for
request_url_scheme .
|
request_url_scheme (string, n/a:r) | |
---|---|
Default: n/a | |
Protocol specifier of the URL (http://, ftp://, etc.). |
response (complex, rw:rw) | |
---|---|
Default: empty | |
Normative policy hash for HTTP responses indexed by the HTTP method and the response code (e.g.: "PWD", "209" etc.). See also Section 4.7.2.2, Configuring policies for HTTP requests and responses. |
response_header (complex, rw:rw) | |
---|---|
Default: empty | |
Normative policy hash for HTTP header responses indexed by the header names (e.g.: "Set-cookie"). See also Section 4.7.2.3, Configuring policies for HTTP headers. |
response_mime_type (string, n/a:r) | |
---|---|
Default: n/a | |
The MIME type of the response entity. Its value is only defined when the response is processed. |
response_stack (complex, rw:rw) | |
---|---|
Default: n/a | |
Attribute containing the response stacking policy: the hash is indexed based on method names (e.g.: GET). See Section 4.7.2.9, Stacking. |
rewrite_host_header (boolean, rw:rw) | |
---|---|
Default: TRUE | |
Rewrite the Host header in requests when URL redirection is performed. |
session_persistence_cookie_name (string, rw:rw) | |
---|---|
Default: "JSESSIONID" | |
The name of the cookie which will be used to persist load balanced connections when accessing session-aware application servers. |
timeout (integer, rw:rw) | |
---|---|
Default: 300000 | |
General I/O timeout in milliseconds. If there is no timeout specified for a given operation, this value is used. |
timeout_request (integer, rw:rw) | |
---|---|
Default: 10000 | |
Time to wait for a request to arrive from the client. |
timeout_response (integer, rw:rw) | |
---|---|
Default: 300000 | |
Time to wait for the HTTP status line to arrive from the server. |
transparent_mode (boolean, rw:r) | |
---|---|
Default: TRUE | |
Set the operation mode of the proxy to transparent (TRUE) or non-transparent (FALSE). |
url_category (complex, rw:rw) | |
---|---|
Default: empty | |
Normative policy hash for category-based URL-filtering. The hash is indexed by the name of the category. |
url_filter_uncategorized_action (enum, rw:rw) | |
---|---|
Default: HTTP_URL_ACCEPT | |
The action applied to uncategorized (unknown) URLs when URL filtering is used.
By default, uncategorized URLs are accepted: |
Method | Description |
---|---|
getRequestHeader(self, header) | Function returning the value of a request header. |
getResponseHeader(self, header) | Function returning the value of a response header. |
setRequestHeader(self, header, new_value) | Function changing the value of a request header. |
setResponseHeader(self, header, new_value) | Function changing the value of a response header. |
Table 4.16. Method summary
This function looks up and returns the value of a header associated with the current request.
This function looks up and returns the value of a header associated with the current response.
This function looks up and changes the value of a header associated with the current request.
This function looks up and changes the value of a header associated with the current response.
HttpProxy is a default HTTP proxy based on AbstractHttpProxy. It is transparent, and enables the most commonly used HTTP methods: "GET", "POST" and "HEAD".
HTTP proxy based on HttpProxy. This class is identical to
HttpProxy
with the only difference being that it is non-transparent
(transparent_mode = FALSE
). Consequently,
clients must be explicitly configured to connect to this proxy
instead of the target server and issue proxy requests. On the server
side this proxy connects transparently to the target server.
For the correct operation the proxy must be able to set the server address on its own. This can be accomplished by using InbandRouter.
HTTP proxy based on HttpProxy, having URL filtering capability. The matcher attribute should be initialized to refer to a Matcher object. The initialization should be done in the class body as shown in the next example.
HTTP proxy based on HttpProxyURIFilter, but operating in non-transparent mode (transparent_mode = FALSE
).
HTTP proxy based on HttpProxy with enabled URL filtering (with DNS and reverse-DNS resolution) and preconfigured default category actions.
The following categories have policy action HTTP_URL_REJECT
:
ads
adult
blacklist
drugs
gambling
hacking
phishing
porn
sexuality
spyware
violence
virusinfected
warez
The following categories have policy action HTTP_URL_ACCEPT
:
whitelist
HTTP proxy based on HttpProxy, also capable of inspecting WebDAV extensions of the HTTP protocol.
The following requests are permitted: PROPFIND; PROPPATCH; MKCOL; COPY; MOVE; LOCK; UNLOCK.
HTTP proxy based on HttpProxyNonTransparent, operating in non-transparent mode (transparent_mode = FALSE
) and capable of inspecting WebDAV extensions of the HTTP protocol.
The following requests are permitted: PROPFIND; PROPPATCH; MKCOL; COPY; MOVE; LOCK; UNLOCK.
This module defines an interface to the Plug proxy. Plug is a simple TCP or UDP circuit, which means that transmission takes place without protocol verification.
This class implements a general plug proxy, and is capable of optionally disabling data transfer in either direction. Plug proxy reads connection on the client side, then creates another connection at the server side. Arriving responses are sent back to the client. However, it is not a protocol proxy, therefore PlugProxy does not implement any protocol analysis. It offers protection to clients and servers from lower level (e.g.: IP) attacks. It is mainly used to allow traffic pass the firewall for which there is no protocol proxy available.
By default plug copies all data in both directions. To change
this behavior, set the copy_to_client
or copy_to_server
attribute
to FALSE.
Plug supports the use of secondary sessions. For details, see Section 2.2, Secondary sessions.
Note |
---|
Copying of out-of-band data is not supported. |
Plug proxy is not a protocol specific proxy module, therefore it is not specified in standards.
Class | Description |
---|---|
AbstractPlugProxy | Class encapsulating the abstract Plug proxy. |
PlugProxy | Class encapsulating the default Plug proxy. |
Table 4.17. Classes of the Plug module
An abstract proxy class for transferring data.
bandwidth_to_client (integer, n/a:r) | |
---|---|
Default: n/a | |
Read-only variable containing the bandwidth currently used in server->client direction. |
bandwidth_to_server (integer, n/a:r) | |
---|---|
Default: n/a | |
Read-only variable containing the bandwidth currently used in client->server direction. |
secondary_mask (secondary_mask, rw:r) | |
---|---|
Default: 0xf | |
Specifies which connections can be handled by the same proxy instance. See Section 2.2, Secondary sessions for details. |
secondary_sessions (integer, rw:r) | |
---|---|
Default: 10 | |
Maximum number of allowed secondary sessions within a single proxy instance. See Section 2.2, Secondary sessions for details. |
Method | Description |
---|---|
packetStats(self, client_bytes, client_pkts, server_bytes, server_pkts) | Function called when the packet_stats_interval is elapsed. |
Table 4.18. Method summary
This function is called whenever the time interval set in packet_stats_interval elapses, or a given number of packets were transmitted. This event receives packet statistics as parameters. It can be used in managing the Quality of Service of the connections; e.g.: to terminate connections with excessive bandwidth requirements (for instance to limit the impact of a covert channel opened when using plug instead of a protocol specific proxy).
The Pop3 module defines the classes constituting the proxy for the POP3 protocol.
Post Office Protocol version 3 (POP3) is usually used by mail user agents (MUAs) to download messages from a remote mailbox. POP3 supports a single mailbox only, it does not support advanced multi-mailbox operations offered by alternatives such as IMAP.
The POP3 protocol uses a single TCP connection to give access to a single mailbox. It uses a simple command/response based approach, the client issues a command and a server can respond either positively or negatively.
The basic protocol is the following: the client issues a request (also called command in POP3 terminology) and the server responds with the result. Both commands and responses are line based, each command is sent as a complete line, a response is either a single line or - in case of mail transfer commands - multiple lines.
Commands begin with a case-insensitive keyword possibly followed by one or more arguments (such as RETR or DELE).
Responses begin with a status indicator ("+OK" or "-ERR") and a possible explanation of the status code (e.g.: "-ERR Permission denied.").
Responses to certain commands (usually mail transfer commands) also contain a data attachment, such as the mail body. See the Section 4.9.1.3, Bulk transfers for further details.
The protocol begins with the server displaying a greeting message, usually containing information about the server.
After the greeting message the client takes control and the protocol enters the AUTHORIZATION state where the user has to pass credentials proving his/her identity.
After successful authentication the protocol enters TRANSACTION state where mail access commands can be issued.
When the client has finished processing, it issues a QUIT command and the connection is closed.
Responses to certain commands (such as LIST or RETR) contain a long data stream. This is transferred as a series of lines, terminated by a "CRLF '.' CRLF" sequence, just like in SMTP.
Pop3Proxy is a module built for parsing messages of the POP3 protocol. It reads and parses COMMANDs on the client side, and sends them to the server if the local security policy permits. Arriving RESPONSEs are parsed as well, and sent to the client if the local security policy permits. It is possible to manipulate both the requests and the responses.
By default, the proxy accepts all commands recommended in RFC 1939. Additionally, the following optional commands are also accepted: USER, PASS, AUTH. The proxy understands all the commands specified in RFC 1939 and the AUTH command. These additional commands can be enabled manually.
Changing the default behavior of commands can be done using the
hash named request
. The hash is indexed by the command name
(e.g.: USER or AUTH). See Section 2.1, Policies for requests and responses for details.
Action | Description |
---|---|
POP3_REQ_ACCEPT |
Accept the request without any modification. |
POP3_REQ_ACCEPT_MLINE |
Accept multiline requests without modification. Use it only if unknown commands has to be enabled (i.e. commands not specified in RFC 1939 or RFC 1734). |
POP3_REQ_REJECT |
Reject the request. The second parameter contains a string that is sent back to the client. |
POP3_REQ_POLICY |
Call the function specified to make a decision about the event. See Section 2.1, Policies for requests and responses for details. This action uses two additional tuple items, which must be callable Python functions. The first function receives two parameters: self and command. The second one is called with an answer, (if the answer is multiline, it is called with every line) and receives two parameters: self and response_param. |
POP3_REQ_ABORT |
Reject the request and terminate the connection. |
Table 4.19. Action codes for POP3 requests
As in many other protocols, POP3 also starts with a server banner. This banner contains the protocol version the server uses, the possible protocol extensions that it supports and, in many situations, the vendor and exact version number of the POP3 server.
This information is useful only if the clients connecting to the POP3 server can be trusted, as it might make bug hunting somewhat easier. On the other hand, this information is also useful for attackers when targeting this service.
To prevent this, the banner can be replaced with a neutral one.
Use the request
hash with the 'GREETING' keyword as shown in the following example.
Note |
---|
Some protocol extensions (most notably APOP) use random characters in the greeting message as salt in the authentication process, so changing the banner when APOP is used effectively prevents APOP from working properly. |
The available stacking modes for this proxy module are listed in the following table. For additional information on stacking, see Section 2.3.1, Proxy stacking.
Action | Description |
---|---|
POP3_STK_POLICY |
Call the function specified to decide which part (if any) of the traffic should be passed to the stacked proxy. |
POP3_STK_NONE |
No additional proxy is stacked into the POP3 proxy. |
POP3_STK_MIME |
The data part of the traffic including the MIME headers is passed to the specified stacked proxy. |
POP3_STK_DATA |
Only the data part of the traffic is passed to the specified stacked proxy. |
Table 4.20. Action codes for proxy stacking
When filtering messages for viruses or spam, the content vectoring modules reject infected and spam e-mails. In such cases the POP3 proxy notifies the client about the rejected message in a special e-mail.
To reject e-mail messages using the ERR
protocol element, set the reject_by_mail
attribute to FALSE
. However, this is not recommended, because several client applications handle
ERR
responses incorrectly.
Note |
---|
Infected e-mails are put into the quarantine and deleted from the server. |
Post Office Protocol Version 3 is described in RFC 1939.
The POP3 AUTHentication command is described in RFC 1734.
The POP3 STLS extension is described in RFC 2595.
Class | Description |
---|---|
AbstractPop3Proxy | Class encapsulating the abstract POP3 proxy. |
Pop3Proxy | Default POP3 proxy based on AbstractPop3Proxy. |
Pop3STLSProxy | POP3 proxy based on Pop3Proxy allowing Start TLS. |
Table 4.21. Classes of the Pop3 module
This class implements an abstract POP3 proxy - it serves as a starting point for customized proxy classes, but is itself not directly usable. Service definitions should refer to a customized class derived from AbstractPop3Proxy, or a predefined Pop3Proxy proxy class. AbstractPop3Proxy denies all requests by default.
max_request_line_length (integer, rw:r) | |
---|---|
Default: 90 | |
Maximum allowed line length for client requests, without the CR-LF line ending characters. |
max_response_line_length (integer, rw:r) | |
---|---|
Default: 512 | |
Maximum allowed line length for server responses, without the CR-LF line ending characters. |
reject_by_mail (boolean, rw:r) | |
---|---|
Default: TRUE | |
If the stacked proxy or content vectoring module rejects an e-mail message, reply with a special e-mail message instead
of an ERR response. See Section 4.9.2.5, Rejecting viruses and spam for details.
|
request (complex, rw:rw) | |
---|---|
Default: | |
Normative policy hash for POP3 requests indexed by the command name (e.g.: "USER", "UIDL", etc.). See also Section 4.9.2.2, Configuring policies for POP3 commands. |
request_command (string, n/a:rw) | |
---|---|
Default: n/a | |
When a command is passed to the policy level, its value can be changed to this value. |
request_param (string, n/a:rw) | |
---|---|
Default: n/a | |
When a command is passed to the policy level, the value of its parameters can be changed to this value. |
response_stack (complex, rw:rw) | |
---|---|
Default: | |
Hash containing the stacking policy for multiline POP3 responses. The hash is indexed by the POP3 response. See also Section 4.9.2.4, Stacking. |
session_timestamp (string, n/a:r) | |
---|---|
Default: n/a | |
If the POP3 server implements the APOP command, with the greeting message it sends a timestamp, which is stored in this parameter. |
Pop3Proxy is the default POP3 proxy based on AbstractPop3Proxy, allowing the most commonly used requests.
The following requests are permitted: APOP; DELE; LIST; LAST; NOOP; PASS; QUIT; RETR; RSET; STAT; TOP; UIDL; USER; GREETING. All other requests (including CAPA) are rejected.
Pop3STLSProxy is based on Pop3Proxy, allowing the most commonly used requests.
The following requests are permitted: APOP; DELE; LIST; LAST; NOOP; PASS; QUIT; RETR; RSET; STAT; TOP; UIDL; USER; CAPA; STLS; GREETING. All other requests are rejected. The self.max_request_line_length is set to 253.
Simple Mail Transport Protocol (SMTP) is a protocol for transferring electronic mail messages from Mail User Agents (MUAs) to Mail Transfer Agents (MTAs). It is also used for exchanging mails between MTAs.
The main goal of SMTP is to reliably transfer mail objects from the client to the server. A mail transaction involves exchanging the sender and recipient information and the mail body itself.
SMTP is a traditional command based Internet protocol; the client issues command verbs with one or more arguments, and the server responds with a 3 digit status code and additional information. The response can span one or multiple lines, the continuation is indicated by an '-' character between the status code and text.
The communication itself is stateful, the client first specifies the sender via the "MAIL" command, then the recipients using multiple "RCPT" commands. Finally it sends the mail body using the "DATA" command. After a transaction finishes the client either closes the connection using the "QUIT" command, or starts a new transaction with another "MAIL" command.
Originally SMTP had a very limited set of commands (HELO, MAIL, RCPT, DATA, RSET, QUIT, NOOP) but as of RFC 1869, an extension mechanism was introduced. The initial HELO command was replaced by an EHLO command and the response to an EHLO command contains all the extensions the server supports. These extensions are identified by an IANA assigned name.
Extensions are used for example to implement inband authentication (AUTH), explicit message size limitation (SIZE) and explicit queue run initiation (ETRN). Each extension might add new command verbs, but might also add new arguments to various SMTP commands. The SMTP proxy has built in support for the most important SMTP extensions, further extensions can be added through customization.
The Smtp module implements the SMTP protocol as specified in RFC 2821. The proxy supports the basic SMTP protocol plus five extensions, namely: PIPELINING, SIZE, ETRN, 8BITMIME, and STARTTLS. All other ESMTP extensions are filtered by dropping the associated token from the EHLO response. If no connection can be established to the server, the request is rejected with an error message. In this case the proxy tries to connect the next mail exchange server.
The abstract SMTP proxy rejects all commands and responses by default. Less restrictive proxies are available as derived classes (e.g.: SmtpProxy), or can be customized as required.
Changing the default behavior of commands can be done by
using the hash attribute request
. These hashes are indexed by the command name (e.g.: MAIL or DATA). Policies for responses can be configured using the response
attribute, which is indexed by the command name and the response code. The possible actions are shown in the tables below. See Section 2.1, Policies for requests and responses for details. When looking up entries of the response
attribute hash, the lookup precedence described in Section 2.1.2, Response codes is used.
Action | Description |
---|---|
SMTP_REQ_ACCEPT | Accept the request without any modification. |
SMTP_REQ_REJECT | Reject the request. The second parameter contains an SMTP status code, the third one an associated parameter which will be sent back to the client. |
SMTP_REQ_ABORT | Reject the request and terminate the connection. |
Table 4.22. Action codes for SMTP requests
Action | Description |
---|---|
SMTP_RSP_ACCEPT | Accept the response without any modification. |
SMTP_RSP_REJECT | Reject the response. The second parameter contains an SMTP status code, the third one an associated parameter which will be sent back to the client. |
SMTP_RSP_ABORT | Reject the response and terminate the connection. |
Table 4.23. Action codes for SMTP responses
SMTP extensions can be controlled using the extension
hash, which is indexed by the extension name. The supported extensions (SMTP_EXT_PIPELINING; SMTP_EXT_SIZE; SMTP_EXT_ETRN; SMTP_EXT_8BITMIME) can be accepted or dropped (SMTP_EXT_ACCEPT or SMTP_EXT_DROP) individually or all at once using the SMTP_EXT_ALL index value.
The available stacking modes for this proxy module are listed in the following table. For additional information on stacking, see Section 2.3.1, Proxy stacking.
Action | Description |
---|---|
SMTP_STK_NONE | No additional proxy is stacked into the SMTP proxy. |
SMTP_STK_MIME | The data part including header information of the traffic is passed to the specified stacked proxy. |
Table 4.24. Stacking options for SMTP
Simple Mail Transfer Protocol is described in RFC 2821.
SMTP Service Extensions are described in the obsoleted RFC 1869.
The STARTTLS extension is described in RFC 3207.
Class | Description |
---|---|
AbstractSmtpProxy | Class encapsulating the abstract SMTP proxy. |
SmtpProxy | Default SMTP proxy based on AbstractSmtpProxy. |
Table 4.25. Classes of the Smtp module
This class implements an abstract SMTP proxy - it serves as a starting point for customized proxy classes, but is itself not directly usable. Service definitions should refer to a customized class derived from AbstractSmtpProxy, or one of the predefined proxy classes.
The following requests are permitted: HELO; MAIL; RCPT; DATA; RSET; QUIT; NOOP; EHLO; AUTH; ETRN. The following extensions are permitted: PIPELINING; SIZE; ETRN; 8BITMIME; STARTTLS.
active_extensions (integer, n/a:r) | |
---|---|
Default: n/a | |
Active extension bitmask, contains bits defined by the constants 'SMTP_EXT_*' |
add_received_header (boolean, rw:rw) | |
---|---|
Default: FALSE | |
Add a Received: header into the email messages transferred by the proxy. |
append_domain (string, rw:rw) | |
---|---|
Default: | |
Domain to append to email addresses which do not specify domain name. An address is rejected if it does not contain a domain and append_domain is empty. |
domain_name (string, rw:rw) | |
---|---|
Default: | |
If you want to set a fix domain name into the added Receive line, set this. Only takes effect if add_received_header is TRUE. |
interval_transfer_noop (integer, rw:rw) | |
---|---|
Default: 600000 | |
The interval between two NOOP commands sent to the server while waiting for the results of stacked proxies. |
max_auth_request_length (integer, rw:r) | |
---|---|
Default: 256 | |
Maximum allowed length of a request during SASL style authentication. |
request (complex, rw:rw) | |
---|---|
Default: | |
Normative policy hash for SMTP requests indexed by the command name (e.g.: "USER", "UIDL", etc.). See also Section 4.10.2.2, Configuring policies for SMTP commands and responses. |
request_command (string, n/a:rw) | |
---|---|
Default: n/a | |
When a command is passed to the policy level, its value can be changed to this value. |
request_param (string, n/a:rw) | |
---|---|
Default: n/a | |
When a command is passed to the policy level, the value of its parameter can be changed to this value. |
request_stack (complex, rw:rw) | |
---|---|
Default: | |
Attribute containing the stacking policy for SMTP commands. See Section 4.10.2.3, Stacking. |
require_crlf (boolean, rw:r) | |
---|---|
Default: TRUE | |
Specifies whether the proxy should enforce valid CRLF line terminations. |
resolve_host (boolean, rw:rw) | |
---|---|
Default: FALSE | |
Resolve the client host from the IP address and add it to the Received line. Only takes effect if add_received_header is TRUE. |
response (complex, rw:rw) | |
---|---|
Default: | |
Normative policy hash for SMTP responses indexed by the command name and the response code. See also Section 4.10.2.2, Configuring policies for SMTP commands and responses. |
response_value (string, n/a:rw) | |
---|---|
Default: n/a | |
When a response is passed to the policy level, its value can be changed to this value. (It has effect only when the return value is not SMTP_*_ACCEPT.) |
timeout (integer, rw:r) | |
---|---|
Default: 600000 | |
Timeout in milliseconds. If no packet arrives within this in interval, the connection is dropped. |
SmtpProxy implements a basic SMTP Proxy based on AbstractSmtpProxy, with relay checking and sender/recipient check restrictions. (Exclamation marks and percent signs are not allowed in the e-mail addresses.)
permit_exclamation_mark (boolean, rw:rw) | |
---|---|
Default: FALSE | |
Allow the '!' sign in the local part of e-mail addresses. |
permit_percent_hack (boolean, rw:rw) | |
---|---|
Default: FALSE | |
Allow the '%' sign in the local part of e-mail addresses. |
recipient_matcher (class, rw:rw) | |
---|---|
Default: | |
Matcher class (e.g.: SmtpInvalidRecipientMatcher) used to check and filter recipient e-mail addresses. |
relay_domains_matcher (class, rw:r) | |
---|---|
Default: | |
Domains mails are accepted for based on a matcher (e.g.: RegexpFileMatcher). |
The Telnet module defines the classes constituting the proxy for the TELNET protocol.
The Telnet protocol was designed to remotely login to computers via the network. Although its main purpose is to access a remote standard terminal, it can be used for many other functions as well.
The protocol follows a simple scenario. The client opens a TCP connection to the server at the port 23. The server authenticates the client and opens a terminal. At the end of the session the server closes the connection. All data is sent in plain text format whithout any encryption.
The communication is based on the network virtual terminal (NVT). Its goal is to map a character terminal so neither the "server" nor "user" hosts need to keep information about the characteristics of each other's terminals and terminal handling conventions. NVT uses 7 bit code ASCII characters as the display device. An end of line is transmitted as a CRLF (carriage return followed by a line feed). NVT ASCII is used by many other protocols as well.
NVT defines three mandatory control codes which must be understood by the participants: NULL, CR (Carriage Return), which moves the printer to the left margin of the current line and LF (Line Feed), which moves the printer to the next line keeping the current horizontal position.
NVT also contains some optional commands which are useful. These are the following:
BELL is an audible or visual sign.
BS (Back Space) moves the printer back one position and deletes a character.
HT (Horizontal Tab) moves the printer to the next horizontal tabular stop.
VT Vertical Tab moves the printer to the next vertical tabular stop.
FF (Form Feed) moves the printer to the top of the next page.
The protocol uses several commands that control the method and various details of the interaction between the client and the server. These commands can be either mandatory commands or extensions. During the session initialization the client and the server negotiates the connection parameters with these commands. Sub-negotiation is a process during the protocol which is for exchanging extra parameters of a command (e.g.: sending the window size). The commands of the protocol are:
Request/Response | Description |
---|---|
SE | End of sub-negotiation parameters. |
NOP | No operation. |
DM | Data mark - Indicates the position of Sync event within the data stream. |
BRK | Break - Indicates that a break or attention key was hit. |
IP | Suspend, interrupt or abort the process. |
AO | Abort output - Run a command without sending the output back to the client. |
AYT | Are you there - Request a visible evidence that the AYT command has been received. |
EC | Erase character - Delete the character last received from the stream. |
EL | Erase line - Erase a line without a CRLF. |
GA | Go Ahead - Instruct the other machine to start the transmission. |
SB | Sub-negotiation starts here. |
WILL | Will (option code) - Indicates the desire to begin performing the indicated option, or confirms that it is being performed. |
WONT | Will not (option code) - Indicates the refusal to perform, or continue performing, the indicated option. |
DO | Do (option code) - Indicates the request that the other party perform, or confirmation that the other party is expected to perform, the indicated option. |
DONT | Do not (option code) - Indicates the request that the other party stop performing the indicated option, or confirmation that its performing is no longer expected. |
IAC | Interpret as command. |
Table 4.26. Telnet protocol commands
TelnetProxy is a module built for parsing TELNET protocol commands and the negotiation process. It reads and parses COMMANDs on the client side, and sends them to the server if the local security policy permits. Arriving RESPONSEs are parsed as well and sent to the client if the local security policy permits. It is possible to manipulate options by using TELNET_OPT_POLICY. It is also possible to accept or deny certain options and suboptions.
The Telnet shell itself cannot be controlled, thus the commands issued by the users cannot be monitored or modified.
The low level abstract Telnet proxy denies every option and suboption negotiation sequences by default. The different options can be enabled either manually in a derived proxy class, or the predefined TelnetProxy class can be used.
The Telnet proxy can enable/disable the use of the options and their suboptions within the session. Changing the default policy
can be done using the option
multi-dimensional hash,
indexed by the option and the suboption (optional). If the suboption is specified, the lookup precedence described in Section 2.1.2, Response codes is used.
The possible action codes are listed in the table below.
Action | Description |
---|---|
TELNET_OPT_ACCEPT |
Allow the option. |
TELNET_OPT_DROP |
Reject the option. |
TELNET_OPT_ABORT |
Reject the option and terminate the Telnet session. |
TELNET_OPT_POLICY |
Call the function specified to make a decision about the event. The function receives two parameters: self, and option (an integer). See Section 2.1, Policies for requests and responses for details. |
Table 4.27. Action codes for Telnet options
Constants have been defined for the easier use of TELNET options and suboptions. These are listed in Table A.1, TELNET options and suboptions.
Policy callback functions can be used to make decisions based on the
content of the suboption negotiation sequence. For example, the suboption negotiation sequences of the Telnet
Environment option transfer environment
variables. The low level proxy implementation parses these variables, and
passes their name and value to the callback function one-by-one. These
values can also be manipulated during transfer, by changing the current_var_name
and
current_var_value
attributes of the proxy class.
In the Telnet protocol, options and the actual commands are represented on one byte. In order to be able to use a command in a session, the option (and its suboptions if there are any) corresponding to the command has to be negotiated between the client and the server. Usually the command and the option is represented by the same value, e.g.: the TELNET_STATUS
command and option are both represented by the value "5". However, this is not always the case. The negotiation
hash is indexed by the code of the command, and contains the code of the option to be negotiated for the given command (or the TELNET_NEG_NONE
when no negotation is needed).
Currently the only command where the code of the command differs from the related option is self.negotiation["239"] = int(TELNET_EOR)
.
The Telnet protocol is described in RFC 854. The different options of the protocol are described in various other RFCs, listed in Table A.1, TELNET options and suboptions.
Class | Description |
---|---|
AbstractTelnetProxy | Class encapsulating the abstract Telnet proxy. |
TelnetProxy | Default Telnet proxy based on AbstractTelnetProxy. |
TelnetProxyStrict | Telnet proxy based on AbstractTelnetProxy, allowing only the minimal command set. |
Table 4.28. Classes of the Telnet module
This class implements the Telnet protocol (as described in RFC 854) and its most common extensions. Although not all possible options are checked by the low level proxy, it is possible to filter any option and suboption negotiation sequences using policy callbacks. AbstractTelnetProxy serves as a starting point for customized proxy classes, but is itself not directly usable. Service definitions should refer to a customized class derived from AbstractTelnetProxy, or one of the predefined TelnetProxy proxy classes. AbstractTelnetProxy denies all options by default.
current_var_value (string, n/a:rw) | |
---|---|
Default: n/a | |
Value of the variable being negotiated (e.g.: value of an environment variable, an X display location value, etc.). |
negotiation (complex, rw:rw) | |
---|---|
Default: | |
Normative hash listing which options must be negotiated for a given command. See Section Option negotiation for details. |
option (complex, rw:rw) | |
---|---|
Default: n/a | |
Normative policy hash for Telnet options indexed by the option and (optionally) the suboption. See also Section 4.11.2.2, Configuring policies for the TELNET protocol. |
TelnetProxy is a proxy class based on AbstractTelnetProxy, allowing the use of all Telnet options.
TelnetProxyStrict is a proxy class based on AbstractTelnetProxy, allowing the use of the options minimally required for a useful Telnet session.
The following options are permitted: ECHO; SUPPRESS_GO_AHEAD; TERMINAL_TYPE; NAWS; EOR; TERMINAL_SPEED; X_DISPLAY_LOCATION; ENVIRONMENT. All other options are rejected.
WHOIS is a protocol providing information about domain and IP owners.
Whois is a netwide service to the Internet users maintained by DDN Network Information Center (NIC).
The protocol follows a very simple method. First the client opens a TCP connection to the server at the port 43 and sends a one line REQUEST closed with <CRLF>. This request can contain only ASCII characters. The server sends the result back and closes the connection.
WhoisProxy is a module build for parsing messages of the WHOIS protocol. It reads and parses the REQUESTs on the client side and sends them to the server if the local security policy permits. Arriving RESPONSEs are not parsed as they do not have any fixed structure or syntax.
Class | Description |
---|---|
AbstractWhoisProxy | Class encapsulating the abstract Whois proxy. |
WhoisProxy | Default proxy class based on AbstractWhoisProxy. |
Table 4.29. Classes of the Whois module
This class implements the WHOIS protocol as specified in RFC 954.
Method | Description |
---|---|
whoisRequest(self, request) | Function to process whois requests. |
Table 4.30. Method summary
This chapter provides detailed description for the core modules of Zorp.
This module contains classes related to authentication and authorization. Together with the AuthDB module it implements the Authentication and Authorization framework.
User authentication verifies the identity of the user trying to access a particular network service. When performed on the connection level, that enables the full auditing of the network traffic. Authentication is often used in conjunction with authorization, allowing access to a service only to clients who have the right to do so.
Authentication is a method to ensure that certain services (access to a server, etc.) can be used only by the clients allowed to access the service. The process generally called as authentication actually consists of three distinct steps:
Identification: Determining the clients identity (e.g.: requesting a username).
Authentication: Verifying the clients identity (e.g.: requesting a password that only the real client knows).
Authorization: Granting access to the service (e.g.: verifying that the authenticated client is allowed to access the service).
Note |
---|
It is important to note that although authentication and authorization are usually used together, they can also be used independently. Authentication verifies the identity of the client. There are situations where authentication is sufficient, because all users are allowed to access the services, only the event and the user's identity has to be logged. On the other hand, authorization is also possible without authentication, for example if access to a service is time-limited (e.g.: it can only be accessed outside the normal work-hours, etc.). In such situations authentication is not needed. |
Zorp can authenticate and authorize access to the services. The aim of authentication is to identify the user and the associated group memberships. When the client initiates a connection, it actually tries to use a service. Zorp checks if an authentication policy is associated to the service. If an authentication policy is present, Zorp contacts the authentication provider specified in the authentication policy. The type of authentication (the authentication class used, e.g., InbandAuthentication) is also specified in the authentication policy. The authentication provider connects to an authentication backend (e.g., a user database) to perform the authentication of the client - Zorp itself does not directly communicate with the database.
If the authentication is successful, the client is verified if it is allowed to access the service (by evaluating the authorization policy and the identity and group memberships of the client). If the client is authorized to access the service, the server-side connection is built. The client is automatically authorized if no authorization policy is assigned to the service.
Currently only one authentication provider, the () is available via the ZAS2AuthenticationBackend class. Authentication providers are actually configured instances of the authentication backends, and it is independent from the database that the backend connects to. The authentication backend is that ties the authentication provider to the server storing the user data. For details on using , see the Connection authentication and authorization chapter of the Zorp Administrator's Guide.
The aim of authentication is to identify
the user and resolve group memberships. The results are stored in
the in the auth_user
and auth_groups
attributes of the
session object.
Note that apart from the information required for authentication, Zorp also sends session information
(e.g., the IP address of the client) to the authentication provider.
Zorp provides the following authentication classes:
InbandAuthentication: Use the built-in authentication of the protocol to authenticate the client on the Zorp.
ServerAuthentication: Enable the client to connect to the target server, and extract its authentication information from the protocol.
ZAAuthentication: Outband authentication using the .
If the authentication is successful, Zorp verifies that the client is allowed to access the service (by evaluating the authorization policy). If the client is authorized to access the service, the server-side connection is built. The client is automatically authorized if no authorization policy is assigned to the service.
Each service can use an authorization policy to determine whether a client is allowed to access the service. If the authorization is based on the identity of the client, it takes place only after a successful authentication - identity-based authorization can be performed only if the client's identity is known and has been verified. The actual authorization is performed by Zorp, based on the authentication information received from or extracted from the protocol.
Zorp provides the following authorization classes:
PermitUser: Authorize listed users.
PermitGroup: Authorize users belonging to the specified groups.
PermitTime: Authorize connections in a specified time interval.
BasicAccessList: Combine other authorization policies into a single rule.
PairAuthorization: Authorize only user pairs.
NEyesAuthorization: Have another client authorize every connection.
Class | Description |
---|---|
AbstractAuthentication | Class encapsulating the abstract authentication interface. |
AbstractAuthorization | Class encapsulating the authorization interface. |
AuthCache | Class encapsulating the authentication cache. |
AuthenticationPolicy | A policy determining how the user is authenticated to access the service. |
AuthorizationPolicy | A policy determining how the user is authorized to access the service. |
BasicAccessList | Class encapsulating the authorization by access list. |
InbandAuthentication | Class encapsulating the inband authentication interface. |
NEyesAuthorization | Class encapsulating N eyes authorization. |
PairAuthorization | Class encapsulating pair-based 4 eyes authorization. |
PermitGroup | Class encapsulating the group membership based authorization. |
PermitTime | Class encapsulating time based authorization. |
PermitUser | Class encapsulating the user-name based authorization. |
SatyrAuthentication | Class encapsulating the outband authentication interface using the Satyr application. |
ServerAuthentication | Class encapsulating the server authentication interface. |
ZAAuthentication | Class encapsulating the outband authentication interface using the Zorp Authentication Agent. |
Table 5.1. Classes of the Auth module
This class encapsulates interfaces for inband and outband authentication procedures. Service definitions should refer to a customized class derived from AbstractAuthentication, or one of the predefined authentication classes, such as InbandAuthentication or ZAAuthentication.
Method | Description |
---|---|
__init__(self, authentication_provider, auth_cache) | Constructor to initialize an AbstractAuthentication instance. |
Table 5.2. Method summary
This class encapsulates an authorization interface. Authorization determines whether the authenticated entity is in fact allowed to access a specific service. Service definitions should refer to a customized class derived from AbstractAuthorization, or one of the predefined authorization classes, such as PermitUser or PermitGroup.
This class encapsulates an authentication cache which associates usernames with client IP addresses. The association between a username and an IP address is valid only until the specified timeout. Caching the authentication results means that the users do not need to authenticate themselves for every request: it is assumed that the same user is using the computer within the timeout. E.g.: once authenticated for an HTTP service, the client can browse the web for Timeout period, but has to authenticate again to use FTP.
To use a single authorization cache for every service request of a client, set
the service_equiv
attribute to TRUE
.
That way Zorp does not make difference between the different services (protocols) used
by the client: after a successful authentication the user can use all available services
without having to perform another authentication. E.g.: if this option is enabled in the
example above, the client does not have to re-authenticate for starting an FTP
connection.
Method | Description |
---|---|
__init__(self, name, timeout, update_stamp, service_equiv, cleanup_threshold) | Constructor to initialize an instance of the AuthCache class. |
Table 5.3. Method summary
This constructor initializes and registers an AuthCache instance that can be referenced in authentication policies.
cleanup_threshold (integer) | |
---|---|
Default: 100 | |
When the number of entries in the cache reaches the value of
cleanup_threshold , old entries are automatically
deleted.
|
service_equiv (boolean) | |
---|---|
Default: FALSE | |
If enabled, then a single authentication of a user applies to every service from that client. |
update_stamp (boolean) | |
---|---|
Default: TRUE | |
If set to TRUE , then cached authentications increase
the validity period of the authentication cache. Otherwise, the authentication
cache expires according to the timeout value set in
attribute timeout.
|
Authentication policies determine how the user is authenticated to access
the service. The authentication_policy
attribute
of a service can reference an instance of the AuthenticationPolicy class.
Example 5.1. A simple authentication policy |
---|
The following example defines an authentication policy that can be referenced in service definitions. This policy uses inband authentication and references an authentication provider. AuthenticationPolicy(name="demo_authentication_policy", cache=None, authentication=InbandAuthentication(), provider="demo_authentication_provider") To use the authentication policy, include it in the definition of the service: Service(name="office_http_inter", proxy_class=HttpProxy, authentication_policy="demo_authentication_policy", authorization_policy="demo_authorization_policy") |
Example 5.2. Caching authentication decisions |
---|
The following example defines an authentication policy that caches the authentication decisions for ten minutes (600 seconds). For details on authentication caching, see see Section 5.1.6, Class AuthCache). AuthenticationPolicy(name="demo_authentication_policy", cache=AuthCache(timeout=600, update_stamp=TRUE, service_equiv=TRUE, cleanup_threshold=100), authentication=InbandAuthentication(), provider="demo_authentication_provider") |
Method | Description |
---|---|
__init__(self, name, provider, authentication, cache) | Constructor to initialize an instance of the AuthenticationPolicy class. |
Table 5.4. Method summary
authentication (class) | |
---|---|
Default: None | |
The authentication method used in the authentication process. See Section 5.1.1, Authentication and authorization basics for details. |
provider (class) | |
---|---|
Default: n/a | |
The authentication provider object used in the authentication process. See Section 5.1.1, Authentication and authorization basics for details. |
Authorization policies determine how the user is authorized to access
the service. The authorization_policy
attribute
of a service can reference an instance of the AuthorizationPolicy class.
authorization (class) | |
---|---|
Default: n/a | |
The authorization method (e.g., PermitGroup ) used in the instance.
See Section 5.1.8, Class AuthorizationPolicy for examples. |
This class encapsulates an access list that uses any class derived from the AbstractAuthorization class. BasicAccessList allows to combine multiple access control requirements into a single decision.
BasicAccessList uses a list of rules. The rules
are evaluated sequentially. Each rule
can specify whether matching the current rule is Sufficient
or
Required
. A connection is
authorized if a Sufficient
rule matches
the connection, or all Required
rules
are fulfilled. If a Required
rule is
not met, the connection is refused.
Rules are represented as a list of Python tuples as the following example shows:
Method | Description |
---|---|
__init__(self, acl) | Constructor to initialize a BasicAccessList instance. |
Table 5.6. Method summary
This class encapsulates inband authentication. Inband
authentication is performed by the proxy using the
rules of the application-level protocol. Only the authentication methods
supported by the particular protocol can be used during inband authentication.
Authentication policies can refer to instances of the
InbandAuthentication class using the auth
parameter.
Warning |
---|
Inband authentication is currently supported only for the Http, Ftp, and Socks proxy classes. |
Method | Description |
---|---|
__init__(self, authentication_provider, auth_cache) | Constructor to initialize an InbandAuthentication instance. |
Table 5.7. Method summary
This class encapsulates an N-eyes based authorization method, which means that connections are authorized if other administrators authenticate themselves within the defined timelimits.
When NEyesAuthorization
is used, the client trying to access
the service has to be authorized by another (already authorized) client (this
authorization chain can be expanded to multiple levels).
NEyesAuthorization
can only be used in conjunction with another
NEyesAuthorization
policy. One of them is the
authorizer set to authorize the authorized
policy.
In a simple 4-eyes scenario the authorizer policy points to the
authorized policy in its Authorization policy
parameter, and has
its wait_authorization
parameter
disabled. The authorized policy has an empty
Authorization policy
parameter (meaning that it is at lower the
end of an N-eyes chain), and has its wait_authorization
parameter enabled, meaning that it has to be authorized by another
policy.
For examples on using the NEyesAuthorization class, see the Proxying secure channels - SSH tutorial available from the BalaSys Documentation Page at http://www.balasys.hu/documentation/.
Method | Description |
---|---|
__init__(self, authorize_policy, wait_authorization, wait_timeout) | Constructor to initialize a NEyesAuthorization instance. |
Table 5.8. Method summary
This constructor initializes an NEyesAuthorization instance.
authorize_policy (class) | |
---|---|
Default: None | |
The authorization policy authorized by the current
NEyesAuthorization policy.
|
This class encapsulates pair-based authorization
method. Only two users simultaneously accessing the
service are authorized, single users are not permitted to access the
service. Set the time (in milliseconds) Zorp will wait for the
second user to access the service using
the wait_timeout
parameter.
Example 5.5. A simple PairAuthorization policy |
---|
The following example permits access to the service only if two users having different usernames authenticate successfully within one minute. AuthorizationPolicy(name="demo_pairauthorization_policy", authorization=PairAuthorization(wait_timeout=60000)) For more detailed examples, see the Proxying secure channels - SSH tutorial available from the BalaSys Documentation Page at http://www.balasys.hu/documentation/. |
Method | Description |
---|---|
__init__(self, wait_timeout) | Constructor to initialize a PairAuthorization instance. |
Table 5.9. Method summary
This constructor initializes a PairAuthorization instance.
This class encapsulates an authorization decision based on group membership. Users who authenticate as a member of a usergroup specified in the policy receive access to the service. Otherwise access is denied.
Method | Description |
---|---|
__init__(self, grouplist) | Constructor to initialize a PermitGroup instance. |
Table 5.10. Method summary
This class encapsulates an authorization decision based on the time when the connection is started. The connection is permitted if it is started in one of the permitted time periods (according to the system time of the host running Zorp).
Specify the permitted time intervals as a comma-separated list, where
each element contains the beginning and ending time of the permitted interval
in HH:MM
format.
Method | Description |
---|---|
__init__(self, intervals) | Constructor to initialize a PermitTime instance. |
Table 5.11. Method summary
This class encapsulates an authorization decision based on usernames. Users who authenticate using one of the usernames specified in the policy receive access to the service. Otherwise access is denied.
Method | Description |
---|---|
__init__(self, userlist) | Constructor to initialize a PermitUser instance. |
Table 5.12. Method summary
This class encapsulates outband authentication using the Satyr application. Satyr has been renamed to Zorp Authentication Agent, therefore this class is obsolete. Use ZAAuthentication instead. See Section 5.1.18, Class ZAAuthentication for details.
This class encapsulates server authentication: Zorp authenticates the user based on the response of the server to the user's authentication request. Server authentication is a kind of inband authentication, it is performed within the application protocol, but the target server checks the credentials of the user instead of Zorp. This authentication method is useful when the server can be trusted for authentication purposes, but you need to include an authorization decision in the service definition.
Method | Description |
---|---|
__init__(self) | Constructor to initialize a ServerAuthentication instance. |
Table 5.13. Method summary
This class encapsulates outband authentication using the Zorp Authentication Agent (ZAA). The Zorp Authentication Agent is an application that runs on the client computers and provides an interface for the users to authenticate themselves when Zorp requests authentication for accessing a service. This way any protocol, even those not supporting authentication can be securely authenticated. All communication between Zorp and ZAA is SSL-encrypted.
Method | Description |
---|---|
__init__(self, authentication_provider, pki, cert_file, key_file, port, timeout, connect_timeout, auth_cache) | Constructor to initialize an instance of the ZAAuthentication class. |
Table 5.14. Method summary
This constructor initializes an instance of the ZAAuthentication authentication class that can be referenced in authentication policies to perform outband authentication.
connect_timeout (integer) | |
---|---|
Default: 60000 | |
Connection timeout (in milliseconds) to the Zorp Authentication Agent. |
pki (certificate) | |
---|---|
Default: None | |
A tuple containing the name of a certificate and a key file. Zorp uses this certificate to encrypt the communication with the Authentication Agents. |
This module contains classes related to authentication databases. Together with the Auth module it implements the Authentication and Authorization framework. See Section 5.1.1, Authentication and authorization basics and Section 5.1.2, Authentication and authorization in Zorp for details.
Class | Description |
---|---|
AbstractAuthenticationBackend | Class encapsulating the abstract authentication backend like ZAS. |
AuthenticationProvider | A database-independent class used by Zorp to connect to an authentication backend. |
ZAS2AuthenticationBackend | Class encapsulating the ZAS authentication backend. |
Table 5.15. Classes of the AuthDB module
This is an abstract class to encapsulate an authentication backend, which is responsible for checking authentication credentials against a backend database. In actual configurations, use one of the derived classes like ZAS2AuthenticationBackend.
The interface defined here is used by various authentication methods like ZAAuthentication and InbandAuthentication.
The authentication provider is an intermediate layer that mediates between Zorp and the authentication backend (e.g., a user database) during connection authentication - Zorp itself does not directly communicate with the database.
Example 5.10. A sample authentication provider |
---|
The following example defines an authentication provider that uses the ZAS2AuthenticationBackend backend. AuthenticationProvider(name="demo_authentication_provider", backend=ZAS2AuthenticationBackend(serveraddr=SockAddrInet('192.168.10.10', 1317), use_ssl=TRUE, ssl_verify_depth=3, pki_cert=("/etc/key.d/ZAS_certificate/cert.pem", "/etc/key.d/ZAS_certificate/key.pem"), pki_ca=("/etc/ca.d/groups/demo_trusted_group/certs/", "/etc/ca.d/groups/demo_trusted_group/crls/"))) |
Method | Description |
---|---|
__init__(self, name, backend) | Constructor to initialize an AbstractAuthorizationBackend instance. |
Table 5.16. Method summary
This class encapsulates a Zorp Authentication Server database and provides interface to other authentication classes to verify against users managed through ZAS. See Section 5.2.3, Class AuthenticationProvider for examples on using the ZAS2AuthenticationBackend class.
Method | Description |
---|---|
__init__(self, serveraddr, use_ssl, pki_cert, cert_file, key_file, pki_ca, ca_dir, crl_dir, ssl_verify_depth) | Constructor to initialize a ZAS2AuthenticationProvider instance. |
Table 5.17. Method summary
This constructor creates a new ZAS2AuthenticationProvider instance that can be used in authentication policies.
pki_ca (cagroup) | |
---|---|
Default: None | |
The name of a trusted CA group. When using SSL, ZAS must show a certificate signed by a CA that belongs to this group. |
pki_cert (certificate) | |
---|---|
Default: None | |
A tuple containing the name of a certificate and a key file. Zorp shows this certificate to ZAS when using SSL. |
serveraddr (sockaddr) | |
---|---|
Default: n/a | |
The IP address of this ZAS instance. ZAS accepts connections on this address. |
Chainers establish a TCP or UDP connection between a proxy and a selected destination. The destination is usually a server, but the SideStackChainer connects an additional proxy before connecting the server.
The client-side and the server-side connections can use different networking protocols if needed.
The protocol
attribute of the chainer classes determines the network protocol used in the
server-side connection. By default, the same protocol is used in both connections.
The following options are available:
Name | Description |
---|---|
ZD_PROTO_AUTO | Use the protocol that is used on the client side. |
ZD_PROTO_TCP | Use the TCP protocol on the server side. |
ZD_PROTO_UDP | Use the UDP protocol on the server side. |
Table 5.18. The network protocol used in the server-side connection
Class | Description |
---|---|
AbstractChainer | Class encapsulating the abstract chainer. |
AvailabilityChainer | This class enables establishing connection with multiple target addresses and using information from the Availability Checker daemon. AvailabilityChainer connects to target hosts in the order they have been specified. |
ConnectChainer | Class to establish the server-side TCP/IP connection. |
FailoverChainer | Class encapsulating the connection establishment with multiple target addresses and keeping down state between connects. FailoverChainer prefers connecting to target hosts in the order they were specified. |
MultiTargetChainer | Class encapsulating connection establishment with multiple target addresses. |
RoundRobinAvailabilityChainer | This class enables establishing connection with multiple target addresses and using information from the Availability Checker daemon. |
RoundRobinChainer | Class encapsulating the connection establishment with multiple target addresses and keeping down state between connects. |
SideStackChainer | Class to pass the traffic to another proxy. |
StateBasedChainer | Class encapsulating connection establishment with multiple target addresses and keeping down state between connects. |
Table 5.19. Classes of the Chainer module
AbstractChainer implements an abstract chainer that establishes a connection between the parent proxy and the selected destination. This class serves as a starting point for customized chainer classes, but is itself not directly usable. Service definitions should refer to a customized class derived from AbstractChainer, or one of the predefined chainer classes, such as ConnectChainer or FailoverChainer.
This class is based on the MultiTargetChainer class and encapsulates a real TCP/IP connection establishment. It is used when a top-level proxy wants to perform chaining. In addition to ConnectChainer, this class adds the capability to perform stateful failover HA functionality across a set of IP addresses.
Note |
---|
Use AvailabilityChainer if you want to connect to servers, the availability of which have been checked by the Availability Checker daemon monitoring them. Hosts which are in Up state are attempted to be connected. |
Method | Description |
---|---|
__init__(self, protocol, timeout_connect) | Constructor to initialize a AvailabilityChainer instance. |
Table 5.20. Method summary
This constructor initializes a AvailabilityChainer class by filling arguments with appropriate values and calling the inherited constructor.
ConnectChainer is the default chainer class based on AbstractChainer. This class establishes a TCP or UDP connection between the proxy and the selected destination address.
ConnectChainer is used by default if no other chainer class is specified in the service definition.
ConnectChainer attempts to connect only a single destination address: if the connection establishment
procedure selects multiple target servers (e.g., a DNSResolver with the
multi=TRUE
parameter or a DirectedRouter with multiple
addresses), ConnectChainer will use the first address and ignore all other addresses. Use FailoverChainer to select from the destination from multiple addresses in a failover fashion, and RoundRobinChainer to distribute connections
in a roundrobin fashion.
Method | Description |
---|---|
__init__(self, protocol, timeout_connect) | Constructor to initialize an instance of the ConnectChainer class. |
Table 5.21. Method summary
This constructor creates a new ConnectChainer instance which can be associated with a Service.
protocol (enum) | |
---|---|
Default: ZD_PROTO_AUTO | |
Optional parameter that specifies the network protocol used in the connection protocol. By default, the server-side communication uses the same protocol that is used on the client side. See Section 5.3.1, Selecting the network protocol for details. |
This class is based on the StateBasedChainer class and encapsulates a real TCP/IP connection establishment, and is used when a top-level proxy wants to perform chaining. In addition to ConnectChainer this class adds the capability to perform stateful, failover HA functionality across a set of IP addresses.
Note |
---|
Use FailoverChainer if you want to connect to the servers in a predefined order: i.e., connect to the first server, and only connect to the second if the first server is unavailable. If you want to distribute connections between the servers (i.e., direct every new connection to a different server to balance the load) use RoundRobinChainer . |
Method | Description |
---|---|
__init__(self, protocol, timeout, timeout_state, timeout_connect, round_robin) | Constructor to initialize a FailoverChainer instance. |
Table 5.22. Method summary
This constructor initializes a FailoverChainer class by filling arguments with appropriate values and calling the inherited constructor.
protocol (enum) | |
---|---|
Default: ZD_PROTO_AUTO | |
Optional, specifies connection protocol (
ZD_PROTO_TCP or ZD_PROTO_UDP
), when not specified it
defaults to the protocol used on the
client side.
|
This class encapsulates a real TCP/IP connection establishment, and is used when a top-level proxy wants to perform chaining. In addition to ConnectChainer, this class adds the capability to perform stateless, simple load balance server connections among a set of IP addresses.
The same mechanism is used to set multiple server addresses as
with a single destination address: the Router class sets a list
of IP addresses in the session.target_address
attribute.
Method | Description |
---|---|
__init__(self, protocol, timeout_connect) | Constructor to initialize a MultiTargetChainer instance. |
Table 5.23. Method summary
This constructor initializes a MultiTargetChainer class by filling arguments with appropriate values and calling the inherited constructor.
This class is based on the AvailabilityChainer class.
Note |
---|
Use RoundRobinAvailabilityChainer if you want to connect to servers, the availability of which have been checked by the Availability Checker daemon monitoring them. Hosts which are in Up state are attempted to be connected. In addition to AvailabilityChainer, this class adds the capability to perform stateful load balance server connections among a set of IP addresses. |
Method | Description |
---|---|
__init__(self, protocol, timeout_connect) | Constructor to initialize a RoundRobinAvailabilityChainer instance. |
Table 5.24. Method summary
This constructor initializes a RoundRobinAvailabilityChainer class by filling arguments with appropriate values and calling the inherited constructor.
This class is based on the StateBasedChainer class and encapsulates a real TCP/IP connection establishment, and is used when a top-level proxy wants to perform chaining. In addition to ConnectChainer this class adds the capability to perform stateful, load balance server connections among a set of IP addresses.
This class encapsulates a special chainer. Instead of
establishing a connection to a server, it creates
a new proxy instance and connects the server side of the current (parent) proxy
to the client side of the new (child) proxy. The right_class
parameter specifies the child proxy.
It is possible to stack multiple proxies side-by-side. The final step of sidestacking is always to specify
a regular chainer via the right_chainer
parameter that connects the last proxy to the
destination server.
Tip |
---|
Proxy sidestacking is useful for example to create one-sided SSL connections. See the tutorials of the BalaSys Documentation Page available at http://www.balasys.hu/documentation/ for details. |
Method | Description |
---|---|
__init__(self, right_class, right_chainer) | Constructor to initialize an instance of the SideStackChainer class. |
Table 5.25. Method summary
This constructor creates a new FailoverChainer instance which can be associated with a Service.
This class encapsulates a real TCP/IP connection establishment, and is used when a top-level proxy wants to perform chaining. In addition to ConnectChainer, this class adds the capability to perform stateful, load balance server connections among a set of IP addresses.
Note |
---|
Both the FailoverChainer and RoundRobinChainer classes are derived from StateBasedChainer. |
Method | Description |
---|---|
__init__(self, protocol, timeout_connect, timeout_state) | Constructor to initialize a StateBasedChainer instance. |
Table 5.26. Method summary
This constructor initializes a StateBasedChainer class by filling arguments with appropriate values and calling the inherited constructor.
protocol (enum) | |
---|---|
Default: ZD_PROTO_AUTO | |
Optional, specifies connection protocol (
ZD_PROTO_TCP or ZD_PROTO_UDP
), when not specified it
defaults to the same protocol used on the
client side.
|
Detectors can be used to determine if the traffic in the incoming connection uses a particular protocol (for example, HTTP, SSH), or if it has other specific characteristics (for example, it uses SSL encryption with a specific certificate). Such characteristics of the traffic can be detected, and start a specific service to inspect the traffic (for example, start a specific HttpProxy for HTTP traffic, and so on).
Class | Description |
---|---|
AbstractDetector | Class encapsulating the abstract detector. |
CertDetector | Class encapsulating a Detector that determines if an SSL/TLS-encrypted connection uses the specified certificate |
DetectorPolicy | Class encapsulating a Detector which can be used by a name. |
HttpDetector | Class encapsulating a Detector that determines if the traffic uses the HTTP protocol |
SniDetector | Class encapsulating a Detector that determines whether a client targets a specific host in a SSL/TLS-encrypted connection. |
SshDetector | Class encapsulating a Detector that determines if the traffic uses the SSHv2 protocol |
Table 5.27. Classes of the Detector module
This abstract class encapsulates a detector that determines whether the traffic in a connection belongs to a particular protocol.
This Detector determines if an SSL/TLS-encrypted connection uses the specified certificate, and rejects any other protocols and certificates.
Method | Description |
---|---|
__init__(self, certificate) | Constructor to initialize a CertDetector instance. |
Table 5.28. Method summary
DetectorPolicy instances are reusable detectors that contain configured
instances of the detector classes (for example, HttpDetector, SshDetector)
that detect if the traffic uses a particular protocol, or a
particular certificate in an SSL/TLS connection.
DetectorPolicy instances can be used in the detect
option of firewall rules.
For examples, see the specific detector classes.
This Detector determines if the traffic uses the HTTP protocol, and rejects any other protocol.
Example 5.17. HttpDetector example |
---|
The following example defines a DetectorPolicy that detects HTTP traffic. DetectorPolicy(name="http", detector=HttpDetector() |
Method | Description |
---|---|
__init__(self, **kw) | Constructor to initialize a HttpDetector instance. |
Table 5.29. Method summary
Class encapsulating a Detector that determines whether a client targets a specific host in a SSL/TLS-encrypted connection and rejects any other protocols and hostnames.
Method | Description |
---|---|
__init__(self, server_name_matcher) | Constructor to initialize a SNIDetector instance. |
Table 5.30. Method summary
The SSL/TLS framework of the proxies is in a separate entity called Encryption policy. That way, you can easily share and reuse encryption settings between different services: you have to configure the Encryption policy once, and you can use it in multiple services. The SSL framework is described in Chapter 3, The Zorp SSL framework.
Note |
---|
STARTTLS support is currently available only for the Ftp proxy to support FTPS sessions and for the SMTP and the Pop3 proxies. |
Name | Value |
---|---|
SSL_CIPHERS_HIGH | n/a |
SSL_CIPHERS_MEDIUM | n/a |
SSL_CIPHERS_LOW | n/a |
SSL_CIPHERS_ALL | n/a |
SSL_CIPHERS_CUSTOM | n/a |
Table 5.31. Constants for cipher selection
Name | Value |
---|---|
TLSV1_3_CIPHERS_DEFAULT | n/a |
TLSV1_3_CIPHERS_CUSTOM | n/a |
Table 5.32. Constants for TLSv1.3 cipher selection
Name | Value |
---|---|
TLS_SHARED_GROUPS_DEFAULT | n/a |
TLS_SHARED_GROUPS_CUSTOM | n/a |
Table 5.33. Constants for shared group selection
Name | Value |
---|---|
SSL_HSO_CLIENT_SERVER | Perform the SSL-handshake with the client first. |
SSL_HSO_SERVER_CLIENT | Perform the SSL-handshake with the server first. |
Table 5.34. Handshake order.
Name | Value |
---|---|
SSL_NONE | Disable encryption between Zorp and the peer. |
SSL_FORCE_SSL | Require encrypted communication between Zorp and the peer. |
SSL_ACCEPT_STARTTLS | Permit STARTTLS sessions. Currently supported only in the Ftp, Smtp and Pop3 proxies. |
Table 5.35. Client connection security type.
Name | Value |
---|---|
SSL_NONE | Disable encryption between Zorp and the peer. |
SSL_FORCE_SSL | Require encrypted communication between Zorp and the peer. |
SSL_FORWARD_STARTTLS | Forward STARTTLS requests to the server. Currently supported only in the Ftp, Smtp and Pop3 proxies. |
Table 5.36. Server connection security type.
Name | Value |
---|---|
TLS_TRUST_LEVEL_NONE | Accept invalid for example, expired certificates. |
TLS_TRUST_LEVEL_UNTRUSTED | Both trusted and untrusted certificates are accepted. |
TLS_TRUST_LEVEL_FULL | Only valid certificates signed by a trusted CA are accepted. |
Table 5.37. Constants for trust level selection.
Name | Value |
---|---|
TLS_INTERMEDIATE_REVOCATION_NONE | Ignore result of CA certificate revocation status check. |
TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | Check every CA certificate revocation state in the certificate chain. Uncertainty is tolerated. |
TLS_INTERMEDIATE_REVOCATION_HARD_FAIL | Check every CA certificate revocation state in the certificate chain. Uncertainty is not tolerated. |
Table 5.38. Constants for intermediate certificates revocation check type.
Name | Value |
---|---|
TLS_LEAF_REVOCATION_NONE | Ignore result of leaf certificate revocation status check. |
TLS_LEAF_REVOCATION_SOFT_FAIL | Check the revocation state of the leaf certificate. Uncertainty is tolerated. |
TLS_LEAF_REVOCATION_HARD_FAIL | Check the revocation state of the leaf certificate. Uncertainty is not tolerated. |
Table 5.39. Constants for leaf certificate revocation check type.
Name | Value |
---|---|
SSL_HS_ACCEPT | 0 |
SSL_HS_REJECT | 1 |
SSL_HS_POLICY | 6 |
SSL_HS_VERIFIED | 10 |
Table 5.41. Handshake policy decisions
Class | Description |
---|---|
AbstractVerifier | Class encapsulating the abstract Certificate verifier. |
Certificate | Class encapsulating a certificate and its private key, and optionally the passphrase for the private key. |
CertificateCA | Class encapsulating the certificate of a Certificate Authority (CA certificate) and its private key, and optionally the passphrase for the private key. |
ClientCertificateVerifier | Class that can be used to verify the certificate of the client-side connection. |
ClientNoneVerifier | Disables certificate verification in client-side connection. |
ClientOnlyEncryption | The ClientOnlyEncryption class handles scenarios when only the client-Zorp connection is encrypted, the Zorp-server connection is not |
ClientOnlyStartTLSEncryption | The client can optionally request STARTTLS encryption, but the server-side connection is always unencrypted. |
ClientSSLOptions | Class encapsulating a set of SSL options used in the client-side connection. |
DHParam | Class encapsulating DH parameters. |
DynamicCertificate | Class to perform SSL keybridging. |
DynamicServerEncryption | The DynamicServerEncryption class handles scenarios when both the client-firewall and the firewall-server connections could be encrypted but the server side encryption parameters set dynamically from proxies. |
EncryptionPolicy | Class encapsulating a named set of encryption settings. |
FakeStartTLSEncryption | The client can optionally request STARTTLS encryption, but the server-side connection is always encrypted. |
ForwardStartTLSEncryption | The ForwardStartTLSEncryption class handles scenarios when the client can optionally request STARTTLS encryption. |
PrivateKey | Class encapsulating a private key. |
SNIBasedCertificate | Class to be used for Server Name Indication (SNI) |
SSLOptions | Class encapsulating the abstract SSL options. |
ServerCertificateVerifier | Class that can be used to verify the certificate of the server-side connection. |
ServerNoneVerifier | Disables certificate verification in server-side connection. |
ServerOnlyEncryption | The ServerOnlyEncryption class handles scenarios when only the Zorp-server connection is encrypted, the client-Zorp connection is not |
ServerSSLOptions | Class encapsulating a set of SSL options used in the server-side connection. |
StaticCertificate | Class encapsulating a static Certificate object. |
TwoSidedEncryption | The TwoSidedEncryption class handles scenarios when both the client-Zorp and the Zorp-server connections are encrypted. |
Table 5.42. Classes of the Encryption module
This class includes the settings and options used to verify the certificates of the peers in SSL and TLS connections. Note that you cannot use this class directly, use an appropriate derived class, for example, ClientCertificateVerifier or ServerCertificateVerifier instead.
intermediate_revocation_check_type (enum) | |
---|---|
Default: TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | |
Specify how intermediate certificates revocation status check should work. |
leaf_revocation_check_type (enum) | |
---|---|
Default: TLS_LEAF_REVOCATION_SOFT_FAIL | |
Specify how leaf certificate revocation status check should work. |
required (boolean) | |
---|---|
Default: trusted | |
If the required is TRUE, a certificate is required from the peer.
|
trust_level (enum) | |
---|---|
Default: TLS_TRUST_LEVEL_FULL | |
Specify which certificate should be accepted as trusted. |
verify_ca_directory (string) | |
---|---|
Default: "" | |
Directory where the trusted CA certificates are stored. CA certificates are loaded on-demand from this directory when the certificate of the peer is verified. |
Method | Description |
---|---|
__init__(self, trust_level, intermediate_revocation_check_type, leaf_revocation_check_type, trusted_certs_directory, required, verify_depth, verify_ca_directory, verify_crl_directory) | Constructor to initialize an AbstractVerifier instance. |
Table 5.43. Method summary
This constructor defines an AbstractVerifier with the specified parameters.
intermediate_revocation_check_type (enum) | |
---|---|
Default: TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | |
Specify how intermediate certificates revocation status check should work. |
leaf_revocation_check_type (enum) | |
---|---|
Default: TLS_LEAF_REVOCATION_SOFT_FAIL | |
Specify how leaf certificate revocation status check should work. |
trust_level (enum) | |
---|---|
Default: TLS_TRUST_LEVEL_FULL | |
Specify which certificate should be accepted as trusted. |
verify_ca_directory (string) | |
---|---|
Default: "" | |
Directory where the trusted CA certificates are stored. CA certificates are loaded on-demand from this directory when the certificate of the peer is verified. |
The Certificate class stores a certificate, its private key, and optionally a passphrase for the private key. The certificate must be in PEM format.
When configuring Zorp manually using its configuration file, use the regular constructor of the Certificate class to load a certificate from a string. To load a certificate from a file, use the Certificate.fromFile method.
Method | Description |
---|---|
__init__(self, certificate, private_key) | Load a certificate from a string, and access it using its passphrase |
fromFile(certificate_file_path, private_key) | Load a certificate from a file, and access it using its passphrase |
Table 5.44. Method summary
Initializes a Certificate instance by loading a certificate from a string, and accesses it using its passphrase. To load a certificate from a file, use the Certificate.fromFile method.
Initializes a Certificate instance by loading a certificate from a file, and accesses it using its passphrase.
The CertificateCA class stores a CA certificate, its private key, and optionally a passphrase for the private key. The certificate must be in PEM format.
Method | Description |
---|---|
__init__(self, certificate, private_key) | Load a CAcertificate from a string, and access it using its passphrase |
Table 5.45. Method summary
Initializes a CertificateCA instance by loading a CA certificate, and accesses it using its passphrase.
This class includes the settings and options used to verify the certificates of the peers in client-side SSL and TLS connections.
ca_hint_directory (string) | |
---|---|
Default: "" | |
Set directory containing certificates to provide the client the list of CA certificates (subject names) that are used for verifying the client certificate. |
intermediate_revocation_check_type (enum) | |
---|---|
Default: TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | |
Specify how intermediate certificates revocation status check should work. |
leaf_revocation_check_type (enum) | |
---|---|
Default: TLS_LEAF_REVOCATION_SOFT_FAIL | |
Specify how leaf certificate revocation status check should work. |
trust_level (enum) | |
---|---|
Default: TLS_TRUST_LEVEL_FULL | |
Specify which certificate should be accepted as trusted. |
verify_ca_directory (string) | |
---|---|
Default: "" | |
Directory where the trusted CA certificates are stored. CA certificates are loaded on-demand from this directory when the certificate of the peer is verified. |
Method | Description |
---|---|
__init__(self, trust_level, intermediate_revocation_check_type, leaf_revocation_check_type, trusted_certs_directory, required, verify_depth, verify_ca_directory, verify_crl_directory, ca_hint_directory) | Constructor to initialize a ClientCertificateVerifier instance. |
Table 5.46. Method summary
This constructor defines a ClientCertificateVerifier with the specified parameters.
ca_hint_directory (string) | |
---|---|
Default: "" | |
Set directory containing certificates to provide the client the list of CA certificates (subject names) that are used for verifying the client certificate. |
intermediate_revocation_check_type (enum) | |
---|---|
Default: TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | |
Specify how intermediate certificates revocation status check should work. |
leaf_revocation_check_type (enum) | |
---|---|
Default: TLS_LEAF_REVOCATION_SOFT_FAIL | |
Specify how leaf certificate revocation status check should work. |
trust_level (enum) | |
---|---|
Default: TLS_TRUST_LEVEL_FULL | |
Specify which certificate should be accepted as trusted. |
verify_ca_directory (string) | |
---|---|
Default: "" | |
Directory where the trusted CA certificates are stored. CA certificates are loaded on-demand from this directory when the certificate of the peer is verified. |
This class disables every certificate verification in client-side SSL and TLS connections.
The ClientOnlyEncryption class handles scenarios when only the client-Zorp connection is encrypted, the Zorp-server connection is not.
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, client_certificate_generator, client_verify, client_ssl_options) | Initializes SSL/TLS connection on the client side. |
Table 5.47. Method summary
The ClientOnlyEncryption class handles scenarios when only the client-Zorp connection is encrypted, the Zorp-server connection is not.
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
Warning |
---|
If the client does not send a STARTTLS request, the client-side communication will not be encrypted at all. The server-side connection will never be encrypted. |
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, client_certificate_generator, client_verify, client_ssl_options) | The client can optionally request STARTTLS encryption, but the server-side connection is always unencrypted. |
Table 5.48. Method summary
Warning |
---|
If the client does not send a STARTTLS request, the client-side communication will not be encrypted at all. The server-side connection will never be encrypted. |
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifier() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
This class (based on the SSLOptions class) collects the TLS and SSL settings directly related to encryption, for example, the permitted protocol versions, ciphers, session reuse settings, and so on.
cipher (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers. For details, see Table 5.31, Constants for cipher selection . |
ciphers_tlsv1_3 (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers for TLSv1.3 connections. For details, see Table 5.32, Constants for TLSv1.3 cipher selection . |
dh_params (dhparams) | |
---|---|
Default: None | |
The DH parameter used by ephemeral DH key generarion. Please be mind that this option is ignored in TLSv1.3 as it does not support custom DH parameters. |
disable_send_root_ca (boolean) | |
---|---|
Default: False | |
Inhibit sending Root CA to client, even if present in local certificate chain. |
disable_ticket (boolean) | |
---|---|
Default: FALSE | |
Session tickets are a method for SSL session reuse, described in RFC 5077. Set this option to TRUE to disable SSL session reuse using session tickets. |
shared_groups (enum) | |
---|---|
Default: n/a | |
Specifies the allowed shared groups. For details, see Table 5.33, Constants for shared group selection . |
Table 5.49. Method summary
This constructor defines a ClientSSLOptions with the specified parameters.
cipher (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers. For details, see Table 5.31, Constants for cipher selection . |
ciphers_tlsv1_3 (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers for TLSv1.3 connections. For details, see Table 5.32, Constants for TLSv1.3 cipher selection . |
disable_renegotiation (boolean) | |
---|---|
Default: TRUE | |
Set this to TRUE to disable client initiated renegotiation. Please be mind that this option is ignored in TLSv1.3 as it does not support renegotiation. |
disable_send_root_ca (boolean) | |
---|---|
Default: FALSE | |
Set this to TRUE to inhibit sending root ca to client, even if present in local chain. |
disable_ticket (boolean) | |
---|---|
Default: FALSE | |
Session tickets are a method for SSL session reuse, described in RFC 5077. Set this option to TRUE to disable SSL session reuse using session tickets. |
shared_groups (enum) | |
---|---|
Default: n/a | |
Specifies the allowed shared groups. For details, see Table 5.33, Constants for shared group selection . |
The DHParam class stores DH parameters. The DH parameters must be in PEM format.
When configuring Zorp manually using its configuration file, use the regular constructor of the DHParam class to load DH parameters key from a string. To load DH parameters key from a file, use the DHParam.fromFile method.
Method | Description |
---|---|
__init__(self, params) | Load DH parameters key from a string |
fromFile(file_path) | Load a DH parameters from a file |
Table 5.50. Method summary
Initializes a DHParam instance by loading DH parameters key from a string. To load a DH parameters from a file, use the DHParam.fromFile method.
This class is able to generate certificates mimicking another certificate, primarily used to transfer the information of a server's certificate to the client in keybridging. Can be used only in TwoSidedEncryption. For details on configuring keybridging, see Section 3.2.7, Keybrigding certificates.
Method | Description |
---|---|
__init__(self, private_key, trusted_ca, untrusted_ca, cache_directory, extension_whitelist) | Initializes a DynamicCertificate instance to use for keybridging |
Table 5.51. Method summary
The DynamicServerEncryption class handles scenarios when both the client-firewall and the firewall-server connections could be encrypted but the server side encryption parameters set dynamically from proxies.
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, client_security, client_certificate_generator, client_verify, client_ssl_options) | Initializes SSL/TLS connection on the client side. |
Table 5.52. Method summary
The DynamicServerEncryption class handles scenarios when both the client-firewall and the firewall-server connections could be encrypted but the server side encryption parameters set dynamically from proxies.
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
This class encapsulates a named set of encryption settings and an associated Encryption policy instance. Encryption policies provide a way to re-use encryption settings without having to define encryption settings for each service individually.
encryption (class) | |
---|---|
Default: n/a | |
An encryption scenario instance that will be used in the Encryption Policy.
This describes the scenario and the settings how encryption is used in the scenario, for example:
To customize the settings of a scenario (for example, to set the used certificates), derive a class from the selected scenario, set its parameters as needed for your environment, and use the customized class. |
Method | Description |
---|---|
__init__(self, name, encryption) | Constructor to create an Encryption policy. |
Table 5.53. Method summary
This constructor initializes an Encryption policy, based on the settings of the encryption
parameter.
This describes the scenario and the settings how encryption is used in the scenario, for example:
Both the client-side and the server-side connections are encrypted (TwoSidedEncryption)
Only the client-side connection is encrypted (ClientOnlyEncryption)
Only the server-side connection is encrypted (ServerOnlyEncryption)
STARTTLS is enabled (ClientOnlyStartTLSEncryption, FakeStartTLSEncryption, or ForwardStartTLSEncryption)
To customize the settings of a scenario (for example, to set the used certificates), derive a class from the selected scenario, set its parameters as needed for your environment, and use the customized class.
Warning |
---|
If the client does not send a STARTTLS request, the client-side communication will not be encrypted at all. The server-side connection will always be encrypted. |
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, client_certificate_generator, client_verify, server_verify, client_ssl_options, server_ssl_options) | Initializes a FakeStartTLSEncryption instance to handle scenarios when the client can optionally request STARTTLS encryption. |
Table 5.54. Method summary
Warning |
---|
If the client does not send a STARTTLS request, the client-side communication will not be encrypted at all. The server-side connection will always be encrypted. |
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
Warning |
---|
If the client does not send a STARTTLS request, the communication will not be encrypted at all. Both the client-Zorp and the Zorp-server connections will be unencrypted. |
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, client_certificate_generator, client_verify, server_verify, client_ssl_options, server_ssl_options) | Initializes a ForwardStartTLSEncryption instance to handle scenarios when the client can optionally request STARTTLS encryption. |
Table 5.55. Method summary
Warning |
---|
If the client does not send a STARTTLS request, the communication will not be encrypted at all. Both the client-Zorp and the Zorp-server connections will be unencrypted. |
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
The PrivateKey class stores a private key and optionally a passphrase for the private key. The private key must be in PEM format.
When configuring Zorp manually using its configuration file, use the regular constructor of the PrivateKey class to load a private key from a string. To load a private key from a file, use the PrivateKey.fromFile method.
Method | Description |
---|---|
__init__(self, key, passphrase) | Load a private key from a string, and access it using its passphrase |
fromFile(key_file_path, passphrase) | Load a private key from a file, and access it using its passphrase |
Table 5.56. Method summary
Initializes a PrivateKey instance by loading a private key from a string, and accesses it using its passphrase. To load a private key from a file, use the PrivateKey.fromFile method.
Initializes a PrivateKey instance by loading a private key from a file, and accesses it using its passphrase.
This class adds support for the Server Name Indication (SNI) TLS extension, as described in RFC 6066. It stores a mapping between hostnames and certificates, and automatically selects the certificate to show to the peer if the peer has sent an SNI request.
default (complex) | |
---|---|
Default: None | |
The certificate to show to the peer if no matching hostname is found in hostname_certificate_map .
|
hostname_certificate_map (complex) | |
---|---|
Default: n/a | |
A hash containing a matcher-certificate map. Each element of the hash contains a matcher and a certificate:
if a matcher matches the hostname in the SNI request, the certificate is showed to the peer.
You can use any matcher policy, though in most cases, RegexpMatcher will be adequate.
Different elements of the hash can use different types of matchers, for example, RegexpMatcher and RegexpFileMatcher.
For details on matcher policies, see Section 5.7, Module Matcher.
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")),)),} |
default (complex) | |
---|---|
Default: None | |
The certificate to show to the peer if no matching hostname is found in hostname_certificate_map .
|
hostname_certificate_map (complex) | |
---|---|
Default: n/a | |
A matcher-certificate map that describes which certificate will be showed to the peer if the matcher part matches the hostname in the SNI request. For details on matcher policies, see Section 5.7, Module Matcher. |
This class collects the TLS and SSL settings directly related to encryption, for example, the permitted protocol versions, ciphers, session reuse settings, and so on. Note that you cannot use this class directly, use an appropriate derived class, for example, ClientSSLOptions or ServerSSLOptions instead.
cipher (complex) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers. For details, see Table 5.31, Constants for cipher selection . |
ciphers_tlsv1_3 (complex) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers for TLSv1.3 connections. For details, see Table 5.32, Constants for TLSv1.3 cipher selection . |
disable_ticket (boolean) | |
---|---|
Default: FALSE | |
Session tickets are a method for SSL session reuse, described in RFC 5077. Set this option to TRUE to disable SSL session reuse using session tickets. |
shared_groups (complex) | |
---|---|
Default: n/a | |
Specifies the allowed shared groups. For details, see Table 5.33, Constants for shared group selection . |
Method | Description |
---|---|
__init__(self, cipher, ciphers_tlsv1_3, shared_groups, timeout, disable_tlsv1, disable_tlsv1_1, disable_tlsv1_2, disable_tlsv1_3, session_cache_size, disable_session_cache, disable_ticket, disable_compression) | Constructor to initialize an SSLOptions instance. |
Table 5.58. Method summary
This constructor defines an SSLOptions with the specified parameters.
cipher (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers. For details, see Table 5.31, Constants for cipher selection . |
ciphers_tlsv1_3 (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers for TLSv1.3 connections. For details, see Table 5.32, Constants for TLSv1.3 cipher selection . |
disable_ticket (boolean) | |
---|---|
Default: FALSE | |
Session tickets are a method for SSL session reuse, described in RFC 5077. Set this option to TRUE to disable SSL session reuse using session tickets. |
shared_groups (enum) | |
---|---|
Default: n/a | |
Specifies the allowed shared groups. For details, see Table 5.33, Constants for shared group selection . |
This class includes the settings and options used to verify the certificates of the peers in server-side SSL and TLS connections. Note that the ServerCertificateVerifier class always requests a certificate from the server.
check_subject (boolean) | |
---|---|
Default: TRUE | |
If the check_subject parameter is TRUE,
the Subject of the server-side certificate is compared
with application-layer information (for example, it checks
whether the Subject matches the hostname in the URL).
For details, see Section 3.2.3.5, Certificate verification options.
|
intermediate_revocation_check_type (enum) | |
---|---|
Default: TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | |
Specify how intermediate certificates revocation status check should work. |
leaf_revocation_check_type (enum) | |
---|---|
Default: TLS_LEAF_REVOCATION_SOFT_FAIL | |
Specify how leaf certificate revocation status check should work. |
trust_level (enum) | |
---|---|
Default: TLS_TRUST_LEVEL_FULL | |
Specify which certificate should be accepted as trusted. |
verify_ca_directory (string) | |
---|---|
Default: "" | |
Directory where the trusted CA certificates are stored. CA certificates are loaded on-demand from this directory when the certificate of the peer is verified. |
Method | Description |
---|---|
__init__(self, trust_level, intermediate_revocation_check_type, leaf_revocation_check_type, trusted_certs_directory, verify_depth, verify_ca_directory, verify_crl_directory, check_subject) | Constructor to initialize a ServerCertificateVerifier instance. |
Table 5.59. Method summary
This constructor defines a ServerCertificateVerifier with the specified parameters.
check_subject (boolean) | |
---|---|
Default: TRUE | |
If the check_subject parameter is TRUE,
the Subject of the server-side certificate is compared
with application-layer information (for example, it checks
whether the Subject matches the hostname in the URL).
For details, see Section 3.2.3.5, Certificate verification options.
|
intermediate_revocation_check_type (enum) | |
---|---|
Default: TLS_INTERMEDIATE_REVOCATION_SOFT_FAIL | |
Specify how intermediate certificates revocation status check should work. |
leaf_revocation_check_type (enum) | |
---|---|
Default: TLS_LEAF_REVOCATION_SOFT_FAIL | |
Specify how leaf certificate revocation status check should work. |
trust_level (enum) | |
---|---|
Default: TLS_TRUST_LEVEL_FULL | |
Specify which certificate should be accepted as trusted. |
verify_ca_directory (string) | |
---|---|
Default: "" | |
Directory where the trusted CA certificates are stored. CA certificates are loaded on-demand from this directory when the certificate of the peer is verified. |
This class disables every certificate verification in server-side SSL and TLS connections.
The ServerOnlyEncryption class handles scenarios when only the Zorp-server connection is encrypted, the client-Zorp connection is not.
server_certificate_generator (class) | |
---|---|
Default: None | |
The class that will generate the certificate that will be showed to the server. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, server_certificate_generator, server_verify, server_ssl_options) | Initializes SSL/TLS connection on the server side. |
Table 5.60. Method summary
The ServerOnlyEncryption class handles scenarios when only the Zorp-server connection is encrypted, the client-Zorp connection is not.
server_certificate_generator (class) | |
---|---|
Default: None | |
The class that will generate the certificate that will be showed to the server. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
This class (based on the SSLOptions class) collects the TLS and SSL settings directly related to encryption, for example, the permitted protocol versions, ciphers, session reuse settings, and so on.
cipher (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers. For details, see Table 5.31, Constants for cipher selection . |
ciphers_tlsv1_3 (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers for TLSv1.3 connections. For details, see Table 5.32, Constants for TLSv1.3 cipher selection . |
disable_ticket (boolean) | |
---|---|
Default: FALSE | |
Session tickets are a method for SSL session reuse, described in RFC 5077. Set this option to TRUE to disable SSL session reuse using session tickets. |
shared_groups (enum) | |
---|---|
Default: n/a | |
Specifies the allowed shared groups. For details, see Table 5.33, Constants for shared group selection . |
Method | Description |
---|---|
__init__(self, method, cipher, ciphers_tlsv1_3, shared_groups, timeout, disable_sslv2, disable_sslv3, disable_tlsv1, disable_tlsv1_1, disable_tlsv1_2, disable_tlsv1_3, session_cache_size, disable_session_cache, disable_ticket, disable_compression) | Constructor to initialize a ServerSSLOptions instance. |
Table 5.61. Method summary
This constructor defines a ServerSSLOptions with the specified parameters.
cipher (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers. For details, see Table 5.31, Constants for cipher selection . |
ciphers_tlsv1_3 (enum) | |
---|---|
Default: n/a | |
Specifies the allowed ciphers for TLSv1.3 connections. For details, see Table 5.32, Constants for TLSv1.3 cipher selection . |
disable_ticket (boolean) | |
---|---|
Default: FALSE | |
Session tickets are a method for SSL session reuse, described in RFC 5077. Set this option to TRUE to disable SSL session reuse using session tickets. |
shared_groups (enum) | |
---|---|
Default: n/a | |
Specifies the allowed shared groups. For details, see Table 5.33, Constants for shared group selection . |
This class encapsulates a static Certificate that can be used in SSL/TLS connections.
Method | Description |
---|---|
__init__(self, certificates, certificate) | Initializes a static Certificate object. |
Table 5.62. Method summary
The TwoSidedEncryption class handles scenarios when both the client-Zorp and the Zorp-server connections are encrypted. If you do not need encryption on the client- or the server-side, use the ServerOnlyEncryption or ClientOnlyEncryption classes, respectively. For a detailed example on keybridging, see Section 3.2.7, Keybrigding certificates.
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
server_certificate_generator (class) | |
---|---|
Default: None | |
The class that will generate the certificate that will be showed to the server. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
Method | Description |
---|---|
__init__(self, client_certificate_generator, server_certificate_generator, client_verify, server_verify, client_ssl_options, server_ssl_options) | Initializes SSL/TLS connection with both peers. |
Table 5.63. Method summary
The TwoSidedEncryption class handles scenarios when both the client-Zorp and the Zorp-server connections are encrypted.
client_certificate_generator (class) | |
---|---|
Default: n/a | |
The class that will generate the certificate that will be showed to the client. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
client_ssl_options (class) | |
---|---|
Default: ClientSSLOptions() | |
The protocol-level encryption settings used on the client side. This must be a ClientSSLOptions instance. |
client_verify (class) | |
---|---|
Default: ClientCertificateVerifierGroup() | |
The settings used to verify the certificate of the client. This must be a ClientCertificateVerifier instance. |
server_certificate_generator (class) | |
---|---|
Default: None | |
The class that will generate the certificate that will be showed to the server. You can use an instance of the StaticCertificate, DynamicCertificate, or SNIBasedCertificate classes. |
server_ssl_options (class) | |
---|---|
Default: ServerSSLOptions() | |
The protocol-level encryption settings used on the server side. This must be a ServerSSLOptions instance. |
server_verify (class) | |
---|---|
Default: ServerCertificateVerifierGroup() | |
The settings used to verify the certificate of the server. This must be a ServerCertificateVerifier instance. |
Keybridging is a method to let the client see a copy of the server's certificate (or vice versa), allowing it to inspect it and decide about its trustworthiness. Because of proxying the SSL/TLS connection, the client is not able to inspect the certificate of the server directly, therefore a certificate based on the server's certificate is generated on-the-fly. This generated certificate is presented to the client.
For details on configuring keybridging, see Section 3.2.7, Keybrigding certificates.
Class | Description |
---|---|
X509KeyBridge | Class to perform SSL keybridging. |
Table 5.64. Classes of the Keybridge module
This class is able to generate certificates mimicking another certificate, primarily used to transfer the information of a server's certificate to the client in keybridging. For details on configuring keybridging, see Section 3.2.7, Keybrigding certificates.
cache_directory (string) | |
---|---|
Default: "" | |
The directory where all automatically generated certificates are cached. |
key_file (string) | |
---|---|
Default: "" | |
Name of the private key to be used for the newly generated certificates. |
key_passphrase (string) | |
---|---|
Default: "" | |
Passphrase required to access the private key stored in key_file . |
Method | Description |
---|---|
_old_init(self, key_file, cache_directory, trusted_ca_files, untrusted_ca_files, key_passphrase, extension_whitelist) | None |
Table 5.65. Method summary
n/a
cache_directory (string) | |
---|---|
Default: "/var/lib/zorp/keybridge-cache" | |
The directory where all automatically generated certificates are cached. |
key_file (certificate) | |
---|---|
Default: n/a | |
Name of the private key to be used for the newly generated certificates. |
key_passphrase (string) | |
---|---|
Default: "" | |
Passphrase required to access the private key stored in key_file . |
In general, matcher policies can be used to find out if a parameter is included in a list (or which elements of a list correspond to a certain parameter), and influence the behavior of the proxy class based on the results. Matchers can be used for a wide range of tasks, for example, to determine if the particular IP address or URL that a client is trying to access is on a black or whitelist, or to verify that a particular e-mail address is valid.
Class | Description |
---|---|
AbstractMatcher | Class encapsulating the abstract string matcher. |
CombineMatcher | Matcher for implementing logical expressions based on other matchers. |
DNSMatcher | DNS matcher |
MatcherPolicy | Class encapsulating a Matcher which can be used by a name. |
RegexpFileMatcher | Class encapsulating Matcher which uses regular expressions stored in files for string matching. |
RegexpMatcher | Class encapsulating a Matcher which uses regular expressions for string matching. |
SmtpInvalidRecipientMatcher | Class verifying the validity of the recipient addresses in E-mails. |
WindowsUpdateMatcher | Windows Update matcher |
Table 5.66. Classes of the Matcher module
This abstract class encapsulates a string matcher that determines whether a given string is found in a backend database.
Specialized subclasses of AbstractMatcher exist such as 'RegexpFileMatcher' which use regular expressions stored in flat files to find matches.
This matcher makes it possible to combine the results of several
matchers using logical operations. CombineMatcher uses
prefix-notation in its expressions and uses the following format:
the operand, a comma, first argument, a comma, second argument.
For example, an AND expression should be formatted the following
way: (Z_AND, matcher1, matcher2)
.
Expressions using more than one operands should be bracketed, e.g.,
(Z_OR (Z_AND, matcher1, matcher2), matcher3)
.
The following oprations are available:
Z_AND : Logical AND operation.
Z_OR : Logical OR operation.
Z_XOR : Logical XOR operation.
Z_NOT : Logical negation.
Z_EQ : Logical equation.
DNSMatcher retrieves the IP addresses of domain names. This can be used in domain name based policy decisions, for example to allow encrypted connections only to trusted e-banking sites.
DNSMatcher operates as follows: it resolves the IP addresses stored in the list of domain names using the specified Domain Name Server, and compares the results to the IP address of the connection (i.e., the IP address of the server or the client). The matcher returns a true value if the IP addresses resolved from the list of domain names include the IP address of the connection.
Method | Description |
---|---|
__init__(self, hosts, server, resolve_on_init) | Constructor to initialize an instance of the DNSMatcher class. |
Table 5.67. Method summary
Matcher policies can be used to find out if a parameter is included in a list, or which elements of a list correspond to a certain parameter), and influence the behavior of the proxy class based on the results. Matchers can be used for a wide range of tasks, for example, to determine if the particular IP address or URL that a client is trying to access is on a black or whitelist, or to verify that a particular e-mail address is valid.
MatcherPolicy instances are reusable matchers that contain configured instances of the matcher classes (e.g., DNSMatcher, RegexpMatcher). For examples, see the specific matcher classes.
This class is similar to RegexpMatcher, but stores the regular expressions to match and ignore in files. For example, this class can be used for URL filtering. The matcher itself stores only the paths and the filenames to the lists. The file is automatically monitored and reloaded when it is modified. Searches are case-insensitive.
Example 5.25. RegexpFileMatcher example |
---|
MatcherPolicy(name="demo_regexpfilematcher", matcher=RegexpFileMatcher(match_fname="/tmp/match_list.txt", ignore_fname="/tmp/ignore_list.txt")) |
Method | Description |
---|---|
__init__(self, match_fname, ignore_fname) | Constructor to initialize a RegexpFileMatcher instance. |
Table 5.68. Method summary
This constructor initializes an instance of the RegexpFileMatcher class.
A simple regular expression based matcher with a match and an ignore list. Searches are case-insensitive.
Method | Description |
---|---|
__init__(self, match_list, ignore_list, ignore_case) | Constructor to initialize a RegexpMatcher instance. |
Table 5.69. Method summary
This constructor initializes a RegexpMatcher instance by setting the
match
and ignore
attributes to an
empty list.
This class encapsulates a VRFY/RCPT based validity checker to transparently verify the existance of E-mail addresses. Instead of immediately sending the e-mail to the recipient SMTP server, an independent SMTP server is queuried about the existance of the recipient e-mail address.
Instances of this class can be referred to in the recipient_matcher
attribute of the SmtpProxy class. The SmtpProxy
will automatically reject unknown recipients even if the recipient SMTP
server would accept them.
Method | Description |
---|---|
__init__(self, server_name, server_port, cache_timeout, attempt_delivery, force_delivery_attempt, sender_address, bind_name) |
Table 5.70. Method summary
bind_name (string) | |
---|---|
Default: "" | |
Specifies the hostname to bind to before initiating the connection to the SMTP server. |
cache_timeout (integer) | |
---|---|
Default: 60 | |
How long will the result of an address verification be retained (in seconds). |
force_delivery_attempt (boolean) | |
---|---|
Default: FALSE | |
Force a delivery attempt even if the autodetection code otherwise would use VRFY. Useful if the server always returns success for VRFY. |
WindowsUpdateMatcher is actually a DNSMatcher used to retrieve the IP addresses currently
associated with the v5.windowsupdate.microsoft.nsatc.net
,
v4.windowsupdate.microsoft.nsatc.net
, and
update.microsoft.nsatc.net
domain names from the specified name server.
Windows Update is running
on a distributed server farm, using the DNS round robin method and a short TTL to constantly change
the set of servers currently visible, consequently the IP addresses of the servers are constantly
changing.
Example 5.28. WindowsUpdateMatcher example |
---|
MatcherPolicy(name="demo_windowsupdatematcher", matcher=WindowsUpdateMatcher()) |
Method | Description |
---|---|
__init__(self, server) | Constructor to initialize an instance of the WindowsUpdateMatcher class. |
Table 5.71. Method summary
Network Address Translation (NAT) is a technology that can be used to change source or destination addresses in a connection from one IP address to another one. This module defines the classes performing the translation for IP addresses.
Several different NAT methods are supported using different NAT classes, like GeneralNAT or StaticNAT. To actually perform network address translation in a service, you have to use a NATPolicy instance that contains a configured NAT class. NAT policies provide a way to re-use NAT instances whithout having to define NAT mappings for each service individually.
Class | Description |
---|---|
AbstractNAT | Class encapsulating the abstract NAT interface. |
GeneralNAT | Class encapsulating a general subnet-to-subnet NAT. |
HashNAT | Class which sets the address from a hash table. |
NAT46 | Class that performs translation from IPv4 to IPv6 addresses (NAT46) |
NAT64 | Class that performs translation from IPv6 to IPv4 addresses (NAT64) |
NATPolicy | Class encapsulating named NAT instances. |
OneToOneMultiNAT | Class translating addresses between two IP ranges. |
OneToOneNAT | Class translating addresses between two IP ranges. |
RandomNAT | Class generating a random IP address. |
StaticNAT | Class that replaces the source or destination address with a predefined address. |
Table 5.72. Classes of the NAT module
This class encapsulates an interface for application level network address translation (NAT). This NAT is different from the NAT used by packet filters: it modifies the outgoing source/destination addresses just before Zorp connects to the server.
Source and destination NATs can be specified when a Service is created.
The NAT settings are used by the ConnectChainer class just before connecting to the server.
Method | Description |
---|---|
__init__(self) | Constructor to initialize an AbstractNAT instance. |
performTranslation(self, session, addrs, nat_type) | Function that performs the address translation. |
Table 5.73. Method summary
This constructor initializes an AbstractNAT instance. Currently it does nothing, but serves as a placeholder for future extensions.
This function is called before connecting a session to the destination server. The function returns the address (a SockAddr instance) to bind to before establishing the connection.
This class encapsulates a general subnet-to-subnet NAT. It
requires a list of from, to, translated to
parameters:
from: the source address of the connection.
to: the destination address of the connection.
translated to: the translated address.
If the NAT policy is used as SNAT, the translated address is used to translate the source address of the connection; if the NAT policy is used as DNAT, the translated address is used to translate the destination address of the connection. The translation occurs according to the first matching rule.
Method | Description |
---|---|
__init__(self, mapping) | Constructor to initialize a GeneralNAT instance. |
Table 5.74. Method summary
HashNAT statically maps an IP address to another using a hash table. The table is indexed by the source IP address, and the value is the translated IP address. Both IP addresses are stored in string format.
Method | Description |
---|---|
__init__(self, ip_hash, default_reject) | Constructor to initialize a HashNAT instance. |
Table 5.75. Method summary
This constructor initializes a HashNAT instance.
NAT46 embeds and IPv4 address into a specific portion of the IPv6 address according to the NAT46 specification as described in RFC6052 (http://tools.ietf.org/html/rfc6052#section-2.2).
Method | Description |
---|---|
__init__(self, prefix, prefix_mask, suffix) | Constructor to initialize a NAT46 instance. |
Table 5.76. Method summary
This constructor initializes a NAT46 instance.
NAT64 maps specific bits of the IPv6 address to IPv4 addresses according to the NAT64 specification as described in RFC6052 (http://tools.ietf.org/html/rfc6052#section-2.2).
Method | Description |
---|---|
__init__(self, prefix_mask) | Constructor to initialize a NAT64 instance. |
Table 5.77. Method summary
This class encapsulates a name and an associated NAT instance. NAT policies provide a way to re-use NAT instances whithout having to define NAT mappings for each service individually.
Method | Description |
---|---|
__init__(self, name, nat, cacheable) | Constructor to initialize a NAT policy. |
Table 5.78. Method summary
This contructor initializes a NAT policy.
Note |
---|
This class is obsolete, use GeneralNAT instead. |
This class is similar to OneToOneNAT as it 1:1 address translation between the source and destination subnets. The difference is that the OneToOneMultiNAT class supports multiple mappings by using a list of mapping pairs.
If the source address
is outside the given source address range, a DACException
is raised.
The source and destination subnets must have the same size.
Method | Description |
---|---|
__init__(self, mapping, default_reject) | Constructor to initialize a OneToOneMultiNAT instance. |
Table 5.79. Method summary
This constructor initializes an instance of the OneToOneMultiNAT class. Arguments must be
Subnet
instances specifying two non-overlapping IP subnets
with the same size.
Note |
---|
This class is obsolete, use GeneralNAT instead. |
This class performs 1:1 address translation between the source
and destination subnets. If the source address
is outside the given source address range, a DACException
is raised.
The source and destination subnets must have the same size.
Tip |
---|
Use OneToOneNAT to redirect a a block of IP addresses to another block, for example, when the webservers located in the DMZ have dedicated IP aliases on the firewall. |
Method | Description |
---|---|
__init__(self, from_domain, to_domain, default_reject) | Constructor to initialize a OneToOneNAT instance. |
Table 5.80. Method summary
This constructor initializes a OneToOneNAT instance. Arguments must be
Subnet
instances specifying two non-overlapping IP subnets
with the same size.
This class randomly selects an address from a list of IP addresses. This can be used for load-balancing several lines by binding each session to a different interface.
Method | Description |
---|---|
__init__(self, addresses) | Constructor to initialize a RandomNAT instance. |
Table 5.81. Method summary
This class assigns a predefined value to the address of the connection.
Method | Description |
---|---|
__init__(self, addr) | Constructor to initialize a StaticNAT instance. |
Table 5.82. Method summary
Class | Description |
---|---|
AbstractNotificationMethod | Class encapsulating the abstract notification method. |
EmailNotificationMethod | Class sending out notifications in e-mail. |
NotificationPolicy | Class encapsulating a NotificationPolicy which describes how to send out notifications. |
Table 5.83. Classes of the Notification module
This abstract class encapsulates a notification that is performed when a certain event occurs.
Specialized classes can be derived from AbstractNotification, such as the EmailNotificationMethod class.
This class encapsulates a notification handler that sends an e-mail with the given mail properties.
Method | Description |
---|---|
__init__(self, recipient) | Constructor to initialize an EmailNotification instance. |
Table 5.84. Method summary
This module encapsulates the Proxy component. The Proxy module provides a common framework for protocol-specific proxies, implementing the functions that are used by all proxies. Protocol-specific proxy modules are derived from the Proxy module, and are described in Chapter 4, Proxies.
Function | Description |
---|---|
proxyLog | Function to send a proxy-specific message to the system log. |
Table 5.85. Function summary
Class | Description |
---|---|
Proxy | Class encapsulating the abstract proxy. |
Table 5.86. Classes of the Proxy module
This function sends a message into the system log. All messages start with the
session_id
that uniquely identifies the connection.
This class serves as the abstact base class for all proxies. When an instance of the Proxy class is created, it loads and starts a protocol-specific proxy. Proxies operate in their own threads, so this constructor returns immediately.
encryption_policy (class) | |
---|---|
Default: None | |
Name of the Encryption policy instance used to encrypt the sessions and verify the certificates used. For details, see Section 5.5, Module Encryption. |
Method | Description |
---|---|
closedByAbort(self) | Function called by the proxy core when an abort has been occured. |
config(self) | Function called by the proxy core to initialize the proxy instance. |
connectServer(self) | Function called by the proxy instance to establish the server-side connection. |
getCredentials(self, method, username, domain, target, port) | Function called when proxy requires credentials for server side authentication. |
invalidPolicyCall(self) | Invalid policy function called. |
setServerAddress(self, host, port) | Function called by the proxy instance to set the address of the destination server. |
setServerSideEncryption(self) | Function called by the proxy instance to set up the server side encryption parameters dynamically. |
userAuthenticated(self, entity, groups, auth_info) | Function called when inband authentication is successful. |
Table 5.87. Method summary
This function is called when a callback gives abort or no result. It simply sets a flag that will be used for logging the reason of the proxy's ending.
This function is called during proxy startup. It sets the attributes of the proxy instance according to the configuration of the proxy.
This function is called to establish the server-side connection.
The function either connects a proxy to the destination server,
or an embedded proxy to its parent proxy. The proxy may set the
address of the destination server using the setServerAddress
function.
The connectServer
function calls the chainer
specified in the service definition to connect to the remote server
using the host name and port parameters.
The connectServer
function returns the descriptor
of the server-side data stream.
The proxy instance calls this function to
retrieve authentication credentials for authentication method
method
and the target user username
.
This function is called when invalid policy function has been called.
The proxy instance calls this function to set the
address of the destination server.
This function attempts to resolve the hostname of the server using the DNS;
the result is stored in the session.server_address
parameter.
The address of the server may be modified later by the router of the service. See
Section 5.12, Module Router for details.
Note |
---|
The |
Function called by the proxy instance when the encryption scenario is dynamic (eg.: DynamicServerEncryption) to set up the server side encryption parameters. It should return with a DynamicServerEncryptionServerParams if DynamicServerEncryption scenario used otherwise with None.
This method unconditionally raises a NotImplementedError exception to indicate that it must be overridden by descendant classes like 'Proxy'.
The proxy instance calls this function to
indicate that the inband authentication was successfully
performed. The name of the client is stored in the
entity
parameter.
This module defines the AbstractResolver interface and various derived classes to perform name lookups.
Class | Description |
---|---|
AbstractResolver | Class encapsulating the abstract Resolver interface. |
DNSResolver | Class encapsulating DNS-based name resolution. |
HashResolver | Class encapsulating hash-based name resolution. |
Table 5.88. Classes of the Resolver module
This class encapsulates an interface for application level name resolution.
DNSResolver policies query the domain name server to resolve domain names.
Method | Description |
---|---|
__init__(self, name_server, timeout, use_search_domain) | Constructor to initialize a DNSResolver instance. |
Table 5.89. Method summary
HashResolver policies are used to locally store the IP addresses belonging to a domain name. A domain name (Hostname) and one or more corresponding IP addresses (Addresses) can be stored in a hash. If the domain name to be resolved is not included in the hash, the name resolution will fail. The HashResolver can be used to direct incoming connections to specific servers based on the target domain name.
Method | Description |
---|---|
__init__(self, mapping) | Constructor to initialize a HashResolver instance. |
Table 5.90. Method summary
Routers define the target IP address and port of the destination server, based on information that is available before started. The simplest router (DirectedRouter) selects a preset destination as the server address, while the most commonly used TransparentRouter connects to the IP address requested by the client. Other routers may make more complex decisions. The destination address selected by the router may be overridden by the proxy and the DNAT classes used in the service.
Routers also define source address and port of the server-side connection. This is the IP address that is used to connect the server. The server sees that the connection originates from this address. The following two parameters determine the source address used in the server-side connection:
forge_addr
: If set to TRUE
, the client's source address is used
as the source of the server-side connection. Otherwise, the IP address of the interface connected to
the server is used.
forge_port
: This parameter defines the source port that is
used in the server-side connection. Specify a port number as an integer value, or use one of the
following options:
Name | Description |
---|---|
Z_PORT_ANY | Selected a random port between 1024
and 65535 . This is the default behavior of every router.
|
Z_PORT_GROUP | Select a random port in the same group as the port used by
the client. The following groups are defined:
0-513 , 514-1024 ,
1025- .
|
Z_PORT_EXACT | Use the same port as the client. |
Z_PORT_RANDOM | Select a random port using a cryptographically secure function. |
Table 5.91. Options defining the source port of the server-side connection
Class | Description |
---|---|
AbstractRouter | Class encapsulating the abstract router. |
DirectedRouter | Class encapsulating a Router which explicitly defines the target address. |
InbandRouter | Class encapsulating the Router which extracts the destination address from the application-level protocol. |
TransparentRouter | Class encapsulating a Router which provides transparent services. |
Table 5.92. Classes of the Router module
AbstractRouter implements an abstract router that determines the destination address of the server-side connection. Service definitions should refer to a customized class derived from AbstractRouter, or one of the predefined router classes, such as TransparentRouter or DirectedRouter. Different implementations of this interface perform Transparent routing (directing the client to its original destination), and Directed routing (directing the client to a given destination).
A proxy can override the destination selected by the router using the the setServerAddress method.
forge_addr (boolean) | |
---|---|
Default: n/a | |
If set to TRUE , the
client's source address is used as the source of the server-side connection.
|
forge_port (unknown) | |
---|---|
Default: n/a | |
Defines the source port that is used in the server-side connection. See Section 5.12.1, The source address used in the server-side connection for details. |
This class implements directed routing, which means that the destination address is a preset address for each session.
Method | Description |
---|---|
__init__(self, dest_addr, forge_addr, overrideable, forge_port) | Constructor to initialize a DirectedRouter. |
Table 5.93. Method summary
This constructor initializes an instance of the DirectedRouter class.
forge_addr (boolean) | |
---|---|
Default: FALSE | |
If set to TRUE ,
the client's source address is used as the source of the
server-side connection.
|
forge_port (complex) | |
---|---|
Default: Z_PORT_ANY | |
Defines the source port that is used in the server-side connection. See Section 5.12.1, The source address used in the server-side connection for details. |
This class implements inband routing, which means that the destination address will be determined by the protocol. Inband routing works only for protocols that can send routing information within the protocol, and is mainly used for non-transparent proxying. The InbandRouter class currently supports only the HTTP and FTP protocols.
Method | Description |
---|---|
__init__(self, forge_addr, forge_port) | Constructor to initialize a InbandRouter. |
Table 5.94. Method summary
This constructor initializes an instance of the InbandRouter class.
forge_addr (boolean) | |
---|---|
Default: FALSE | |
If set to TRUE , the client's source address is used as the source of the server-side connection.
|
forge_port (complex) | |
---|---|
Default: Z_PORT_ANY | |
Defines the source port that is used in the server-side connection. See Section 5.12.1, The source address used in the server-side connection for details. |
This class implements transparent routing, which means that the destination server is the original destination requested by the client.
forced_port (unknown) | |
---|---|
Default: n/a | |
Defines the source port that is used in the server-side connection. See Section 5.12.1, The source address used in the server-side connection for details. |
Method | Description |
---|---|
__init__(self, forced_port, forge_addr, overrideable, forge_port) | Constructor to initialize an instance of the TransparentRouter class. |
Table 5.95. Method summary
This constructor creates a new TransparentRouter instance which can be associated with a Service.
forced_port (integer) | |
---|---|
Default: 0 | |
Modify the destination port to this value. Default value: 0 (do not modify the target port) |
forge_addr (boolean) | |
---|---|
Default: FALSE | |
If set to TRUE , the client's source address is used as
the source of the server-side connection.
|
forge_port (complex) | |
---|---|
Default: Z_PORT_ANY | |
Defines the source port that is used in the server-side connection. See Section 5.12.1, The source address used in the server-side connection for details. |
The Rule module defines the classes needed to create firewall rules.
When Zorp receives a connection request from a client, it tries to select a rule matching the parameters of the connection. The following parameters are considered.
Name in | Name in policy.py |
---|---|
VPN | reqid |
Source Interface | src_iface |
Source Interface Group | src_ifgroup |
Protocol | proto |
Source Port | src_port |
Destination Port | dst_port |
Source Subnet | src_subnet |
Source Zone | src_zone |
Destination Subnet | dst_subnet |
Destination Interface | dst_iface |
Destination Interface Group | dst_ifgroup |
Destination Zone | dst_zone |
Table 5.96. Evaluated Rule parameters
Zorp selects the rule that most specifically matches the connection. Selecting the most specific rule is based on the following method.
The order of the rules is not important.
The parameters of the connection act as filters: if you do not set any parameters, the rule will match any connection.
If multiple connections would match a connection, the rule with the most-specific match is selected.
For example, you have configured two rules: the first has the Source Zone
parameter set as the office
(which is a zone covering all of your client IP addresses), the second has the Source Subnet
parameter set as 192.168.15.15/32
. The other parameters of the rules are the same. If a connection request arrives from the 192.168.15.15/32
address, Zorp will select the second rule. The first rule will match every other client request.
Zorp considers the parameters of a connection in groups. The first group is the least-specific, the last one is the most-specific. The parameter groups are listed below.
The parameter groups are linked with a logical AND operator: if parameters of multiple groups are set in a rule, the connection request must match a parameter of every group. For example, if both the Source Interface
and Destination Port
are set, the connection must match both parameters.
Parameters within the same group are linked with a logical OR operator: if multiple parameters of a group are set for a rule, the connection must match any one of the parameters. If there are multiple similar rules, the rule with the most specific parameter match for the connection will be selected.
Note |
---|
In general, avoid using multiple parameters of the same group in one rule, as it may lead to undesired side-effects. Use only the most specific parameter matching your requirements. For example, suppose that you have a rule with the |
The parameter groups are the following from the least specific to the most specific ones. Parameters within each group are listed from left to right from the least specific to the most specific ones.
Destination Zone
> Destination Interface Group
> Destination Interface
> Destination Subnet
Source Zone
> Source Subnet
Destination Port
(Note that port is more specific than port range.)
Source Port
(Note that port is more specific than port range.)
Protocol
Source Interface Group
> Source Interface
> VPN
If no matching rule is found, Zorp rejects the connection.
Note |
---|
It is possible to create rules that are very similar, making debugging difficult. |
To make the configuration file more readable and informative, you can add descriptions and tags to the rules. Descriptions can be longer texts, while tags are simple labels, for example, to identify rules that belong to the same type of traffic. Adding metadata to rules is not necessary, but can be a great help when maintaining large configurations.
To add a description to a rule, add the text of the description before the rule, enclosed between three double-quotes:
"""This rule is ..."""
To tag a rule, add a comment line before the rule that contains the list of tags applicable to the rule, separated with commas.
#Tags: tag1, tag2
Class | Description |
---|---|
PortRange | Specifies a port range for a rule |
Rule | This class implements firewall rules |
Table 5.97. Classes of the Rule module
This class specifies a port range for a firewall rule. It can be used in the src_port
and dst_port
parameters of a rule. For example: src_port=PortRange(2000, 2100)
, or src_port=(PortRange(2000, 2100), PortRange(2500, 2600))
. When listing multiple elements, ports and port ranges can be mixed, for example: src_port=(4433, PortRange(2000, 2100), PortRange(2500, 2600))
This class implements firewall rules. For details, see Section 5.13, Module Rule.
Initializes a rule
dst_port (integer) | |
---|---|
Default: n/a | |
Permit traffic only if the client targets the listed port. For example, dst_port=80 , or dst_port=(80, 443) . To specify port ranges, use the PortRange class, for example, dst_port=PortRange(2000, 2100) . |
proto (integer) | |
---|---|
Default: n/a | |
Permit only connections using the specified transport protocol. This is the transport layer (Layer 4) protocol of the OSI model, for example, TCP, UDP, ICMP, and so on. The protocol must be specified using a number: the decimal value of the "protocol" field of the IP header. This value is 6 for the TCP and 17 for the UDP protocol. For a list of protocol numbers, see the Assigned Internet Protocol Numbers page of IANA. For example: proto=(6,17) .
To permit any protocol, do not add the |
rule_id (integer) | |
---|---|
Default: n/a | |
A unique ID number for the rule. This parameter is optional, an ID number is automatically generated for the rule during startup. |
src_iface (interface) | |
---|---|
Default: n/a | |
Permit traffic only for connections received on the listed interface. For example, src_iface='eth0', or src_iface=('eth0', 'tun1'), . |
src_port (integer) | |
---|---|
Default: n/a | |
Permit traffic only if the client sends the connection request from the listed port. For example, src_port=4455 . To specify port ranges, use the PortRange class, for example, src_port=PortRange(2000, 2100) . |
This module defines classes encapsulating service descriptions. The
services define how the incoming connection requests are handled.
When a connection is accepted by a Rule, the service specified in the
Rule creates an instance of itself.
This instance handles the connection, and
proxies the traffic between the client and the server.
It also handles TLS and SSL encryption of the traffic if needed, as
configured in the encryption_policy
parameter
of the service.
The instance of the selected service is created using the 'startInstance()'
method.
A service is not usable on its own, it needs a Rule to bind the service to a network interface of the firewall and activate it when a matching connection request is received. New instances of the service are started as the Rule accepts new connections.
The name of the service must be a unique identifier; rules refer to this unique ID.
Use clear, informative, and consistent service names. Include the following information in the service name:
Source zones, indicating which clients may use the service (e.g.,
intranet
).
The protocol permitted in the traffic (e.g.,
HTTP
).
Destination zones, indicating which servers may be accessed using the service
(e.g., Internet
).
Tip |
---|
Name the service that allows internal users to browse the Web
|
Class | Description |
---|---|
AbstractService | Class encapsulating the abstract Service properties. |
DenyService | DenyService prohibits access to certain services |
PFService | Class encapsulating a packet-filter service definition. |
Service | Class encapsulating a service definition. |
Table 5.99. Classes of the Service module
AbstractService implements an abstract service. Service definitions should be based on a customized class derived from AbstractService, or on the predefined Service class.
Method | Description |
---|---|
__init__(self, name) | Constructor to initialize an instance of the AbstractService class. |
Table 5.100. Method summary
This constructor creates an AbstractService instance and sets the attributes of the instance
according to the received arguments. It also registers the Service to the
services
hash so that rules can find the service instance.
The DenyService class is a type of service that rejects connections with a predefined error code. DenyServices can be specified in the service
parameter of Rules. If the rule referencing the DenyService matches a connection request, the connection is rejected. DenyService is a replacement for the obsolete Umbrella zone concept.
ipv6_setting (complex) | |
---|---|
Default: n/a | |
Specifies how to reject IPv6 traffic. By default, the traffic is dropped without notifying the client (DenyIPv6.DROP ). The following values are available: DenyIPv6.DROP , DenyIPv6.TCP_RESET , DenyIPv6.ICMP_NO_ROUTE , DenyIPv6.ICMP_ADMIN_PROHIBITED , DenyIPv6.ICMP_ADDR_UNREACHABLE , DenyIPv6.ICMP_PORT_UNREACHABLE
|
Method | Description |
---|---|
__init__(self, name, logging, ipv4_setting, ipv6_setting, log_verbose, log_spec) | Constructor to initialize a DenyService instance. |
Table 5.101. Method summary
This constructor defines a DenyService with the specified parameters.
PFServices allow you to replace the FORWARD rules of iptables, and configure application-level and packet-filter rules from Zorp.
Note |
---|
The PFService class transfers packet-filter level services. |
Example 5.39. PFService example |
---|
The following packet-filtering service transfers TCP connections
that arrive to port PFService(name="intranet_PF5555_internet", router=TransparentRouter()) The following example defines a few classes: the client and server zones, a simple services, and a rule that starts the service. Zone('internet', ['0.0.0.0/0']) Zone('intranet', ['192.168.0.0/16']) def demo() : PFService(name="intranet_PF5555_internet", router=TransparentRouter()) Rule(dst_port=5555, src_zone='intranet', dst_zone='internet', service='PFService' ) |
dnat_policy (class) | |
---|---|
Default: n/a | |
Name of the NAT policy instance used to translate the destination addresses of the sessions. See Section 5.8, Module NAT for details. |
router (class) | |
---|---|
Default: n/a | |
A router instance used to determine the destination address of the server. See Section 5.12, Module Router for details. |
snat_policy (class) | |
---|---|
Default: n/a | |
Name of the NAT policy instance used to translate the source addresses of the sessions. See Section 5.8, Module NAT for details. |
Method | Description |
---|---|
__init__(self, name, router, snat_policy, dnat_policy, log_verbose, log_spec) | Constructor to initialize a PFService instance. |
Table 5.102. Method summary
This constructor defines a packetfilter-service with the specified parameters.
A service is one of the fundamental objects. It stores the names of proxy-related parameters, and is also used for access control purposes to decide what kind of traffic is permitted.
Note |
---|
The Service class transfers application-level (proxy) services. |
Example 5.40. Service example |
---|
The following service transfers HTTP connections. Every parameter is left at its default. Service(name="demo_http, proxy_class=HttpProxy, router=TransparentRouter()) The following service handles HTTP connections. This service uses authentication and authorization, and network address translation on the client addresses (SNAT). Service(name="demo_http", proxy_class=HttpProxy, authentication_policy="demo_authentication_policy", authorization_policy="demo_permituser", snat_policy="demo_natpolicy", router=TransparentRouter()) The following example defines a few classes: the client and server zones, a simple services, and a rule that starts the service. Zone('internet', ['0.0.0.0/0']) Zone('office', ['192.168.1.0/32', '192.168.2.0/32']) def demo_instance() : Service(name="office_http_inter", proxy_class=HttpProxy, router=TransparentRouter()) Rule(src_zone='office', proto=6, dst_zone='internet', service='office_http_inter' ) |
auth_name (string) | |
---|---|
Default: n/a | |
Authentication name of the service. This string informs the users of the Zorp Authentication Agent about which service they are authenticating for. Default value: the name of the service. |
authentication_policy (class) | |
---|---|
Default: n/a | |
Name of the AuthenticationPolicy instance used to authenticate the clients. See Section 5.1, Module Auth for details. |
authorization_policy (class) | |
---|---|
Default: n/a | |
Name of the AuthorizationPolicy instance used to authorize the clients. See Section 5.1, Module Auth for details. |
chainer (class) | |
---|---|
Default: n/a | |
A chainer instance used to connect to the destination server. See Section 5.3, Module Chainer for details. |
dnat_policy (class) | |
---|---|
Default: n/a | |
Name of the NAT policy instance used to translate the destination addresses of the sessions. See Section 5.8, Module NAT for details. |
encryption_policy (class) | |
---|---|
Default: None | |
Name of the Encryption policy instance used to encrypt the sessions and verify the certificates used. For details, see Section 5.5, Module Encryption. |
keepalive (integer) | |
---|---|
Default: Z_KEEPALIVE_NONE | |
The TCP keepalive option, one of the Z_KEEPALIVE_NONE, Z_KEEPALIVE_CLIENT, Z_KEEPALIVE_SERVER, Z_KEEPALIVE_BOTH values. |
max_instances (integer) | |
---|---|
Default: n/a | |
Permitted number of concurrent instances of this service.
Usually each service instance handles
one connection. The default value is 0 ,
which allows unlimited number of instances.
|
proxy_class (class) | |
---|---|
Default: n/a | |
Name of the proxy class instance used to analyze the traffic transferred in the session. See Section 5.10, Module Proxy for details. |
resolver_policy (unknown) | |
---|---|
Default: n/a | |
Name of the ResolvePolicy instance used to resolve
the destination domain names.
See Section 5.11, Module Resolver for details.
Default value: DNSResolver
|
router (class) | |
---|---|
Default: n/a | |
A router instance used to determine the destination address of the server. See Section 5.12, Module Router for details. |
snat_policy (class) | |
---|---|
Default: n/a | |
Name of the NAT policy instance used to translate the source addresses of the sessions. See Section 5.8, Module NAT for details. |
Method | Description |
---|---|
__init__(self, name, proxy_class, router, chainer, snat_policy, snat, dnat_policy, dnat, authentication_policy, authorization_policy, max_instances, max_sessions, auth_name, resolver_policy, auth, auth_policy, keepalive, encryption_policy, limit_target_zones_to, detector_config, detector_default_service_name, session_counting) | Constructor to initialize a Service instance. |
startInstance(self, session) | Start a service instance. |
Table 5.103. Method summary
This contructor defines a Service with the specified parameters.
auth_name (string) | |
---|---|
Default: None | |
Authentication name of the service. This string informs the users of the Zorp Authentication Agent about which service they are authenticating for. Default value: the name of the service. |
authentication_policy (class) | |
---|---|
Default: None | |
Name of the AuthenticationPolicy instance used to authenticate the clients. See Section 5.1, Module Auth for details. |
authorization_policy (class) | |
---|---|
Default: None | |
Name of the AuthorizationPolicy instance used to authorize the clients. See Section 5.1, Module Auth for details. |
chainer (class) | |
---|---|
Default: None | |
Name of the chainer instance used to connect to the destination server. Defaults to ConnectChainer if no other chainer is specified. |
dnat_policy (class) | |
---|---|
Default: None | |
Name of the NAT policy instance used to translate the destination addresses of the sessions. See Section 5.8, Module NAT for details. |
encryption_policy (class) | |
---|---|
Default: None | |
Name of the Encryption policy instance used to encrypt the sessions and verify the certificates used. For details, see Section 5.5, Module Encryption. |
keepalive (integer) | |
---|---|
Default: Z_KEEPALIVE_NONE | |
The TCP keepalive option, one of the Z_KEEPALIVE_NONE, Z_KEEPALIVE_CLIENT, Z_KEEPALIVE_SERVER, Z_KEEPALIVE_BOTH values. |
limit_target_zones_to (complex) | |
---|---|
Default: None | |
A comma-separated list of zone names permitted as the target of the service. No restrictions
are applied if the list is empty. Use this parameter to replace the obsolete inbound_services parameter of the Zone class.
|
max_instances (integer) | |
---|---|
Default: 0 | |
Permitted number of concurrent instances of this service. Usually each
service instance handles one connection. Default value: 0 (unlimited).
|
proxy_class (class) | |
---|---|
Default: n/a | |
Name of the proxy class instance used to analyze the traffic transferred in the session. See Section 5.10, Module Proxy for details. |
resolver_policy (class) | |
---|---|
Default: None | |
Name of the ResolvePolicy instance used to resolve the destination domain names.
See Section 5.11, Module Resolver for details.
Default value: DNSResolver .
|
router (class) | |
---|---|
Default: None | |
Name of the router instance used to determine the destination address of the server. Defaults to TransparentRouter if no other router is specified. |
snat_policy (class) | |
---|---|
Default: None | |
Name of the NAT policy instance used to translate the source addresses of the sessions. See Section 5.8, Module NAT for details. |
This module defines the abstract session interface in a class named
AbstractSession
, and two descendants MasterSession
and StackedSession
.
Sessions are hierarchically stacked into each other just like proxies.
All sessions except the master session have a parent session from which child sessions inherit variables.
Child sessions are stacked into their master sessions, so stacked sessions can inherit data from the encapsulating
proxy instances.
(Inheritance is implemented using a simple getattr
wrapper.)
Instances of the Session classes store the parameters of the client-side and server-side connections in a session object (for example, the IP addresses and zone of the server and the client, and the username and group memberships of the user when authentication is used). Other components refer to this data when making various policy-based decisions.
Class | Description |
---|---|
StackedSession | Class encapsulating a subsession. |
Table 5.104. Classes of the Session module
This class represents a stacked session, e.g., a session within the session hierarchy. Every subsession inherits session-wide parameters from its parent.
chainer (class) | |
---|---|
Default: n/a | |
The chainer used to connect to the parent proxy. If unset, the
server_stream parameter must be set.
|
server_address (class) | |
---|---|
Default: n/a | |
The IP address to connect. Most often this is the IP address requested by the client, but the client requests can be redirected to different IPs. |
server_local (class) | |
---|---|
Default: n/a | |
The server is connected from this IP address. This is either the IP address of Zorp's external interface, or the IP address of the client (if Forge Port is enabled). The client's original IP address may be modified if SNAT policies are used. |
target_address (class) | |
---|---|
Default: n/a | |
The IP address to connect. Most often this is the IP address requested by the client, but the client requests can be redirected to different IPs. |
Method | Description |
---|---|
setTargetAddress(self, addr) | Set the target server address. |
Table 5.105. Method summary
This module implements inet_ntoa
and inet_aton
. The module also provides an interface
to the SockAddr services of the Zorp core. SockAddr is used for example to define the address of the ZAS server in
AuthenticationProvider policies.
Class | Description |
---|---|
SockAddrInet | Class encapsulating an IPv4 address:port pair. |
SockAddrInet6 | Class encapsulating an IPv6 address:port pair. |
SockAddrInetHostname | Class encapsulating a hostname:port pair. |
SockAddrInetRange | Class encapsulating an IPv4 address and a port range. |
SockAddrUnix | Class encapsulating a UNIX domain socket. |
Table 5.106. Classes of the SockAddr module
This class encapsulates an IPv4 address:port pair, similarly to
the sockaddr_in
struct in C. The class is implemented and exported by
the Zorp core. The SockAddrInet
Python class serves only
documentation purposes, and has no real connection to the
behavior implemented in C.
Example 5.41. SockAddrInet example |
---|
The following example defines an IPv4 address:port pair. SockAddrInet('192.168.10.10', 80) The following example uses SockAddrInet in a dispatcher. Dispatcher(transparent=TRUE, bindto=DBSockAddr(protocol=ZD_PROTO_TCP, sa=SockAddrInet('192.168.11.11', 50080)), service="intra_HTTP_inter", backlog=255, rule_port="50080") |
This class encapsulates an IPv6 address:port pair, similarly to
the sockaddr_in
struct in C. The class is implemented and exported by
the Zorp core. The SockAddrInet
Python class serves only
documentation purposes, and has no real connection to the
behavior implemented in C.
Example 5.42. SockAddrInet example |
---|
The following example defines an IPv6 address:port pair. SockAddrInet('fec0::1', 80) The following example uses SockAddrInet in a dispatcher. Dispatcher(transparent=TRUE, bindto=DBSockAddr(protocol=ZD_PROTO_TCP, sa=SockAddrInet('fec0::1', 50080)), service="intra_HTTP_inter", backlog=255, rule_port="50080") |
This class encapsulates a hostname:port or IPv4 address:port pair. Name resolution is only performed when creating
the SockAddrInetHostname object (that is, during startup and reload).
The class is implemented and exported by the Zorp core. The SockAddrInetHostname
Python class serves only documentation purposes, and has no real connection to the
behavior implemented in C.
Example 5.43. SockAddrInetHostname example |
---|
The following example defines a hostname:port or IPv4 address:port pair. SockAddrInetHostname('www.example.com', 80) SockAddrInetHostname('192.168.10.10', 80) The following example uses SockAddrInetHostname in a dispatcher. Dispatcher(transparent=TRUE, bindto=DBSockAddr(protocol=ZD_PROTO_TCP, sa=SockAddrInetHostname('www.example.com', 50080)), service="intra_HTTP_inter", backlog=255, rule_port="50080") |
A specialized SockAddrInet class which allocates a new port
within the given range of ports when a dispatcher bounds to it.
The class is implemented and exported by
the Zorp core. The SockAddrInetRange
Python class serves only
documentation purposes, and has no real connection to the
behavior implemented in C.
This class encapsulates a UNIX domain socket endpoint.
The socket is represented by a filename. The SockAddrUnix
Python class serves only
documentation purposes, and has no real connection to the
behavior implemented in C.
Example 5.44. SockAddrUnix example |
---|
The following example defines a Unix domain socket. SockAddrUnix('/var/sample.socket') The following example uses SockAddrUnix in a DirectedRouter. Service(name="demo_service", proxy_class=HttpProxy, router=DirectedRouter(dest_addr=SockAddrUnix('/var/sample.socket'), overrideable=FALSE, forge_addr=FALSE)) |
Zorp is capable of stacking, that is, handing over parts of the traffic to other modules for further inspection (e.g., to other proxies to inspect embedded protocols, to content vectoring modules for virus filtering, etc.). The Stack module defines the classes required for this functionality.
Stacking in services is performed using StackingProvider policies, which reference the host that performs the stacked operations using the RemoteStackingBackend class.
Class | Description |
---|---|
AbstractStackingBackend | This is an abstract class, currently without any functionality. |
RemoteStackingBackend | Constructor to initialize an instance of the RemoteStackingBackend class. |
StackingProvider | This is a policy class that is used to reference a configured stacking provider in service definitions. |
Table 5.107. Classes of the Stack module
This is an abstract class, currently without any functionality.
This class contains the address of the host that performs the stacked
operations. It is typically used to access the Zorp Content Vectoring
Server (ZCV) to perform virus filtering in the traffic. The remote
backend can be accessed using the TCP protocol or a local socket,
e.g., RemoteStackingBackend(addrs=(SockAddrInet('192.168.2.3', 1318),))
or RemoteStackingBackend(addrs=(SockAddrUnix('/var/run/zcv/zcv.sock'),)).
.
addrs (complex) | |
---|---|
Default: n/a | |
The address of the remote backend in SockAddrInet or SockAddrUnix format. Separate addresses with commas to list more than one address for a backend. Zorp will connect to these addresses in a failover fashion. |
Instances of the StackingProvider class are policies that define which remote stacking backend a particular service uses to inspect the contents of the traffic.
Example 5.45. A simple StackingProvider class |
---|
The following class creates a simple stacking provider that
can be referenced in service definitions. The remote host that
provides the stacking services is located under the
StackingProvider(name="demo_stackingprovider", backend=RemoteStackingBackend(addrs=(SockAddrInet('192.168.12.12', 1318),))) |
Example 5.46. Using a StackingProvider in an FTP proxy |
---|
The following classes define a stacking provider that can be accesses a local ZCV instance using a domain socket. This service provider is then used to filter FTP traffic. The configuration of the ZCV (i.e., what modules it uses to filter the traffic is not discussed here). class StackingFtpProxy(FtpProxy): def config(self): super(StackingFtpProxy, self).config() self.request_stack["RETR"]=(FTP_STK_DATA, (Z_STACK_PROVIDER, "demo_stackingprovider", "default_rulegroup")) StackingProvider(name="demo_stackingprovider_socket", backend=RemoteStackingBackend(addrs=(SockAddrUnix('/var/run/zcv/zcv.sock'),))) |
Method | Description |
---|---|
__init__(self, name, backend) | Constructor to initialize an instance of the StackingProvider class. |
Table 5.109. Method summary
This constructor creates a StackingProvider instance and sets the attributes of the instance according to the received arguments.
backend (class) | |
---|---|
Default: n/a | |
A configured
RemoteStackingBackend class containing the address
of the remote stacking backend, e.g.,
RemoteStackingBackend(addrs=(SockAddrInet('192.168.2.3', 1318),)) or RemoteStackingBackend(addrs=(SockAddrUnix('/var/run/zcv/zcv.sock'),)).
.
|
This module defines the Zone
class.
Zones are the basis of access control. A zone consists of a set of IP addresses, address ranges, or subnet. For example, a zone can contain an IPv4 or IPv6 subnet.
Zones are organized into a hierarchy created by the administrator. Child zones inherit the security attributes (set of permitted services etc.) from their parents. The administrative hierarchy often reflects the organization of the company, with zones assigned to the different departments.
When it has to be determined what zone a client belongs to, the most specific zone containing the searched IP address is selected. If an IP address belongs to two different zones, the most specific zone is selected.
Example 5.47. Finding IP networks |
---|
Suppose there are three zones configured: This approach is used in the service definitions as well: when a client sends a
connection request, the most specific zone containing the IP address of the
client is looked up. Suppose that the clients in |
Example 5.48. Zone examples |
---|
The following example defines a simple zone hierarchy. The following zones are defined:
Zone('internet', ['0.0.0.0/0', '::0/0']) Zone('office', ['192.168.1.0/32', '192.168.2.0/32']) Zone('management', ['192.168.3.0/32']) Zone('DMZ', ['10.50.0.0/32']) |
This class encapsulates IPv4 and IPv6 zones.
Example 5.49. Determining the zone of an IP address |
---|
An IP address always belongs to the most specific zone.
Suppose that |
Method | Description |
---|---|
__init__(self, name, addrs, hostnames, admin_parent, inbound_services, outbound_services) | Constructor to initialize a Zone instance |
Table 5.111. Method summary
This constructor initializes a Zone object.
addr (complex) | |
---|---|
Default: n/a | |
A string representing an address range interpreted by the domain class (last argument), *or* a list of strings representing multiple address ranges. |
admin_parent (string) | |
---|---|
Default: n/a | |
Name of the administrative parent zone. If set, the current zone inherits the lists of permitted inbound and outbound services from its administrative parent zone. |
This chapter provides information about some of the internal Zorp modules.
Caching is used throughout the policy layer to improve performance. This module includes a couple of general caching classes used by various parts of the policy code.
This module imports all public interfaces and makes it easy to use those from the user policy file by simply importing all symbols from Zorp.Core.
Dispatchers bind to a specific IP address and port of the Zorp firewall and wait for incoming connection requests. For each accepted connection, the Dispatcher creates a new service instance to handle the traffic arriving in the connection.
Note |
---|
Earlier product versions used different classes to handle TCP and UDP connections (Dispatchers, respectively). These classes have been merged into the Dispatcher module. |
For each accepted connection, the Dispatcher creates a new service instance to handle the traffic arriving in the connection. The service started by the dispatcher depends on the type of the dispatcher:
Dispatchers start the same service for every connection.
CSZoneDispatchers start different services based on the zones the client and the destination server belong to.
Note |
---|
Only one dispatcher can bind to an IP address/port pair. |
Dispatchers can start only a predefined service. Use
CSZonedDispatchers to start different services for different connections.
CSZoneDispatchers assign different services to different client-server zone pairs.
Define the zones and the related services in the
services
parameter.
The *
wildcard matches all client or server zones.
Note |
---|
The server zone may be modified by the proxy, the router, the chainer, or the NAT policy used in the service. To select the service, CSZoneDispatcher determines the server zone from the original destination IP address of the incoming client request. Similarly, the client zone is determined from the source IP address of the original client request. |
To accept connections from the child zones of the selected client
zones, set the follow_parent
attribute
to TRUE
. Otherwise, the dispatcher accepts
traffic only from the client zones explicitly listed in the
services
attribute of the dispatcher.
Class | Description |
---|---|
CSZoneDispatcher | Class encapsulating the Dispatcher which starts a service by the client and server zone. |
Dispatcher | Class encapsulating the Dispatcher which starts a service by the client and server zone. |
Table 6.1. Classes of the Dispatch module
This class is similar to a simple Dispatcher, but instead of starting a fixed service, it chooses one based on the client and the destined server zone.
It takes a mapping of services indexed by a client and the server zone name, with an exception of the '*' zone, which matches anything.
NOTE: the server zone might change during proxy and NAT processing, therefore the server zone used here only matches the real destination if those phases leave the server address intact.
Example 6.1. CSZoneDispatcher example |
---|
The following example defines a CSZoneDispatcher that
starts the service called CSZoneDispatcher(bindto=SockAddrInet('192.168.2.1', 50080), services={("internet", "DMZ"):"internet_HTTP_DMZ"}, transparent=TRUE, backlog=255, threaded=FALSE, follow_parent=FALSE) |
Method | Description |
---|---|
__init__(self, bindto, services, **kw) | Constructor to initialize a CSZoneDispatcher instance. |
Table 6.2. Method summary
This constructor initializes a CSZoneDispatcher instance and sets its initial attributes based on arguments.
bindto (sockaddr) | |
---|---|
Default: n/a | |
An existing socket address containing the IP address and port number where the Dispatcher accepts connections. |
This class is the starting point of services. It listens on the given port, and when a connection is accepted it starts a session and the given service.
Example 6.2. Dispatcher example |
---|
The following example defines a transparent dispatcher that
starts the service called Dispatcher(bindto=SockAddrInet('192.168.2.1', 50080), service="demo_http_service", transparent=TRUE, backlog=255, threaded=FALSE) |
backlog (integer) | |
---|---|
Default: n/a | |
Applies only to TCP connections. This parameter sets the queue size (maximum number) of TCP connections that are established by the kernel, but not yet accepted by Zorp. This queue stores the connections that successfully performed the three-way TCP handshake with the Zorp host, until the dispatcher sends the Accept package. |
bindto (sockaddr) | |
---|---|
Default: n/a | |
An existing socket address containing the IP address and port number where the Dispatcher accepts connections. |
threaded (boolean) | |
---|---|
Default: n/a | |
Set this parameter to TRUE
to start a new thread for every client request. The proxy threads
started by the dispatcher will start from the dispatcher's thread
instead of the main thread. Incoming connections are accepted
faster and optimizes queuing if this option is enabled. This
improves user experience, but significantly increases the memory
consumption of Zorp. Use it only if a
very high number of concurrent connections have to be transfered.
|
Method | Description |
---|---|
__init__(self, bindto, service, **kw) | Constructor to initialize a Dispatcher instance. |
Table 6.3. Method summary
This constructor creates a new Dispatcher instance which can be associated with a Service.
bindto (sockaddr) | |
---|---|
Default: n/a | |
An existing socket address containing the IP address and port number where the Dispatcher accepts connections. |
This module defines the Stream class, encapsulating file descriptors and related functions.
Class | Description |
---|---|
Stream | Class encapsulating the file descriptor and related functions. |
Table 6.4. Classes of the Stream module
This class encapsulates a full-duplex data tunnel, represented by
a UNIX file descriptor. Proxies communicate with its peers through
instances of this class. The client_stream
and server_stream
attributes of the Session class contain a
Stream instance.
Method | Description |
---|---|
__init__(self, fd, name) | Constructor to initialize a stream. |
Table 6.5. Method summary
The constants defined for the easier use of TELNET options and suboptions are listed in the table below. Suboptions are listed directly under the option they refer to. All suboptions have the TELNET_SB prefix. The RFC describing the given option is also shown in the table.
Name | Constant value of option/suboption | Detailed in RFC # |
---|---|---|
TELNET_BINARY | 0 | 856 |
TELNET_ECHO | 1 | 857 |
TELNET_SUPPRESS_GO_AHEAD | 3 | 858 |
TELNET_STATUS | 5 | 859 |
TELNET_SB_STATUS_SB_IS | 0 | |
TELNET_SB_STATUS_SB_SEND | 1 | |
TELNET_TIMING_MARK | 6 | 860 |
TELNET_RCTE | 7 | 726 |
TELNET_NAOCRD | 10 | 652 |
TELNET_SB_NAOCRD_DR | 0 | |
TELNET_SB_NAOCRD_DS | 1 | |
TELNET_NAOHTS | 11 | 653 |
TELNET_SB_NAOHTS_DR | 0 | |
TELNET_SB_NAOHTS_DS | 1 | |
TELNET_NAOHTD | 12 | 654 |
TELNET_SB_NAOHTD_DR | 0 | |
TELNET_SB_NAOHTD_DS | 1 | |
TELNET_NAOFFD | 13 | 655 |
TELNET_SB_NAOFFD_DR | 0 | |
TELNET_SB_NAOFFD_DS | 1 | |
TELNET_NAOVTS | 14 | 656 |
TELNET_SB_NAOVTS_DR | 0 | |
TELNET_SB_NAOVTS_DS | 1 | |
TELNET_NAOVTD | 15 | 657 |
TELNET_SB_NAOVTD_DR | 0 | |
TELNET_SB_NAOVTD_DS | 1 | |
TELNET_NAOLFD | 16 | 658 |
TELNET_SB_NAOLFD_DR | 0 | |
TELNET_SB_NAOLFD_DS | 1 | |
TELNET_EXTEND_ASCII | 17 | 698 |
TELNET_LOGOUT | 18 | 727 |
TELNET_BM | 19 | 735 |
TELNET_SB_BM_DEFINE | 1 | |
TELNET_SB_BM_ACCEPT | 2 | |
TELNET_SB_BM_REFUSE | 3 | |
TELNET_SB_BM_LITERAL | 4 | |
TELNET_SB_BM_CANCEL | 5 | |
TELNET_DET | 20 | 1043, 732 |
TELNET_SB_DET_DEFINE | 1 | |
TELNET_SB_DET_ERASE | 2 | |
TELNET_SB_DET_TRANSMIT | 3 | |
TELNET_SB_DET_FORMAT | 4 | |
TELNET_SB_DET_MOVE_CURSOR | 5 | |
TELNET_SB_DET_SKIP_TO_LINE | 6 | |
TELNET_SB_DET_SKIP_TO_CHAR | 7 | |
TELNET_SB_DET_UP | 8 | |
TELNET_SB_DET_DOWN | 9 | |
TELNET_SB_DET_LEFT | 10 | |
TELNET_SB_DET_RIGHT | 11 | |
TELNET_SB_DET_HOME | 12 | |
TELNET_SB_DET_LINE_INSERT | 13 | |
TELNET_SB_DET_LINE_DELETE | 14 | |
TELNET_SB_DET_CHAR_INSERT | 15 | |
TELNET_SB_DET_CHAR_DELETE | 16 | |
TELNET_SB_DET_READ_CURSOR | 17 | |
TELNET_SB_DET_CURSOR_POSITION | 18 | |
TELNET_SB_DET_REVERSE_TAB | 19 | |
TELNET_SB_DET_TRANSMIT_SCREEN | 20 | |
TELNET_SB_DET_TRANSMIT_UNPROTECTED | 21 | |
TELNET_SB_DET_TRANSMIT_LINE | 22 | |
TELNET_SB_DET_TRANSMIT_FIELD | 23 | |
TELNET_SB_DET_TRANSMIT_REST_SCREEN | 24 | |
TELNET_SB_DET_TRANSMIT_REST_LINE | 25 | |
TELNET_SB_DET_TRANSMIT_REST_FIELD | 26 | |
TELNET_SB_DET_TRANSMIT_MODIFIED | 27 | |
TELNET_SB_DET_DATA_TRANSMIT | 28 | |
TELNET_SB_DET_ERASE_SCREEN | 29 | |
TELNET_SB_DET_ERASE_LINE | 30 | |
TELNET_SB_DET_ERASE_FIELD | 31 | |
TELNET_SB_DET_ERASE_REST_SCREEN | 32 | |
TELNET_SB_DET_ERASE_REST_LINE | 33 | |
TELNET_SB_DET_ERASE_REST_FIELD | 34 | |
TELNET_SB_DET_ERASE_UNPROTECTED | 35 | |
TELNET_SB_DET_FORMAT_DATA | 36 | |
TELNET_SB_DET_REPEAT | 37 | |
TELNET_SB_DET_SUPPRESS_PROTECTION | 38 | |
TELNET_SB_DET_FIELD_SEPARATOR | 39 | |
TELNET_SB_DET_FN | 40 | |
TELNET_SB_DET_ERROR | 41 | |
TELNET_SUPDUP | 21 | 736, 734 |
TELNET_SUPDUP_OUTPUT | 22 | 749 |
TELNET_SEND_LOCATION | 23 | 779 |
TELNET_TERMINAL_TYPE | 24 | 1091 |
TELNET_SB_TERMINAL_TYPE_IS | 0 | |
TELNET_SB_TERMINAL_TYPE_SEND | 1 | |
TELNET_EOR | 25 | 885 |
TELNET_TUID | 26 | 927 |
TELNET_OUTMRK | 27 | 933 |
TELNET_TTYLOC | 28 946 | |
TELNET_3270_REGIME | 29 | 1041 |
TELNET_SB_3270_REGIME_IS | 0 | |
TELNET_SB_3270_REGIME_ARE | 1 | |
TELNET_X3_PAD | 30 | 1053 |
TELNET_SB_X3_PAD_SET | 0 | |
TELNET_SB_X3_PAD_RESPONSE_SET | 1 | |
TELNET_SB_X3_PAD_IS | 2 | |
TELNET_SB_X3_PAD_RESPONSE_IS | 3 | |
TELNET_SB_X3_PAD_SEND | 4 | |
TELNET_NAWS | 31 | 1073 |
TELNET_TERMINAL_SPEED | 32 | 1079 |
TELNET_SB_TERMINAL_SPEED_IS | 0 | |
TELNET_SB_TERMINAL_SPEED_SEND | 1 | |
TELNET_TOGGLE_FLOW_CONTROL | 33 | 1372 |
TELNET_SB_TOGGLE_FLOW_CONTROL_OFF | 0 | |
TELNET_SB_TOGGLE_FLOW_CONTROL_ON | 1 | |
TELNET_SB_TOGGLE_FLOW_CONTROL_RESTART_ANY | 2 | |
TELNET_SB_TOGGLE_FLOW_CONTROL_RESTART_XON | 3 | |
TELNET_LINEMODE | 34 | 1184 |
TELNET_SB_LINEMODE_MODE | 1 | |
TELNET_SB_LINEMODE_FORWARDMASK | 2 | |
TELNET_SB_LINEMODE_SLC | 3 | |
TELNET_X_DISPLAY_LOCATION | 35 | 1096 |
TELNET_SB_X_DISPLAY_LOCATION_IS | 0 | |
TELNET_SB_X_DISPLAY_LOCATION_SEND | 1 | |
TELNET_OLD_ENVIRONMENT | 36 | 1408 |
TELNET_SB_OLD_ENVIRONMENT_IS | 0 | |
TELNET_SB_OLD_ENVIRONMENT_SEND | 1 | |
TELNET_SB_OLD_ENVIRONMENT_INFO | 2 | |
TELNET_AUTHENTICATION | 37 | 2941 |
TELNET_SB_AUTHENTICATION_IS | 0 | |
TELNET_SB_AUTHENTICATION_SEND | 1 | |
TELNET_SB_AUTHENTICATION_REPLY | 2 | |
TELNET_SB_AUTHENTICATION_NAME | 3 | |
TELNET_ENCRYPT | 38 | 2946 |
TELNET_SB_ENCRYPT_IS | 0 | |
TELNET_SB_ENCRYPT_SUPPORT | 1 | |
TELNET_SB_ENCRYPT_REPLY | 2 | |
TELNET_SB_ENCRYPT_START | 3 | |
TELNET_SB_ENCRYPT_END | 4 | |
TELNET_SB_ENCRYPT_REQUEST_START | 5 | |
TELNET_SB_ENCRYPT_REQUEST_END | 6 | |
TELNET_SB_ENCRYPT_ENC_KEYID | 7 | |
TELNET_SB_ENCRYPT_DEC_KEYID | 8 | |
TELNET_ENVIRONMENT | 39 | 1572 |
TELNET_SB_ENVIRONMENT_IS | 0 | |
TELNET_SB_ENVIRONMENT_SEND | 1 | |
TELNET_SB_ENVIRONMENT_INFO | 2 | |
TELNET_TN3270E | 40 | 1647 |
TELNET_SB_TN3270E_ASSOCIATE | 0 | |
TELNET_SB_TN3270E_CONNECT | 1 | |
TELNET_SB_TN3270E_DEVICE_TYPE | 2 | |
TELNET_SB_TN3270E_FUNCTIONS | 3 | |
TELNET_SB_TN3270E_IS | 4 | |
TELNET_SB_TN3270E_REASON | 5 | |
TELNET_SB_TN3270E_REJECT | 6 | |
TELNET_SB_TN3270E_REQUEST | 7 | |
TELNET_SB_TN3270E_SEND | 8 | |
TELNET_CHARSET | 42 | 2066 |
TELNET_SB_CHARSET_REQUEST | 1 | |
TELNET_SB_CHARSET_ACCEPTED | 2 | |
TELNET_SB_CHARSET_REJECTED | 3 | |
TELNET_SB_CHARSET_TTABLE_IS | 4 | |
TELNET_SB_CHARSET_TTABLE_REJECTED | 5 | |
TELNET_SB_CHARSET_TTABLE_ACK | 6 | |
TELNET_SB_CHARSET_TTABLE_NAK | 7 | |
TELNET_COM_PORT | 44 | 2217 |
TELNET_SB_COM_PORT_CLI_SET_BAUDRATE | 1 | |
TELNET_SB_COM_PORT_CLI_SET_DATASIZE | 2 | |
TELNET_SB_COM_PORT_CLI_SET_PARITY | 3 | |
TELNET_SB_COM_PORT_CLI_SET_STOPSIZE | 4 | |
TELNET_SB_COM_PORT_CLI_SET_CONTROL | 5 | |
TELNET_SB_COM_PORT_CLI_NOTIFY_LINESTATE | 6 | |
TELNET_SB_COM_PORT_CLI_NOTIFY_MODEMSTATE | 7 | |
TELNET_SB_COM_PORT_CLI_FLOWCONTROL_SUSPEND | 8 | |
TELNET_SB_COM_PORT_CLI_FLOWCONTROL_RESUME | 9 | |
TELNET_SB_COM_PORT_CLI_SET_LINESTATE_MASK | 10 | |
TELNET_SB_COM_PORT_CLI_SET_MODEMSTATE_MASK | 11 | |
TELNET_SB_COM_PORT_CLI_PURGE_DATA | 12 | |
TELNET_SB_COM_PORT_SVR_SET_BAUDRATE | 101 | |
TELNET_SB_COM_PORT_SVR_SET_DATASIZE | 102 | |
TELNET_SB_COM_PORT_SVR_SET_PARITY | 103 | |
TELNET_SB_COM_PORT_SVR_SET_STOPSIZE | 104 | |
TELNET_SB_COM_PORT_SVR_SET_CONTROL | 105 | |
TELNET_SB_COM_PORT_SVR_NOTIFY_LINESTATE | 106 | |
TELNET_SB_COM_PORT_SVR_NOTIFY_MODEMSTATE | 107 | |
TELNET_SB_COM_PORT_SVR_FLOWCONTROL_SUSPEND | 108 | |
TELNET_SB_COM_PORT_SVR_FLOWCONTROL_RESUME | 109 | |
TELNET_SB_COM_PORT_SVR_SET_LINESTATE_MASK | 110 | |
TELNET_SB_COM_PORT_SVR_SET_MODEMSTATE_MASK | 111 | |
TELNET_SB_COM_PORT_SVR_PURGE_DATA | 112 | |
TELNET_KERMIT | 47 | 2840 |
TELNET_SB_KERMIT_START_SERVER | 0 | |
TELNET_SB_KERMIT_STOP_SERVER | 1 | |
TELNET_SB_KERMIT_REQ_START_SERVER | 2 | |
TELNET_SB_KERMIT_REQ_STOP_SERVER | 3 | |
TELNET_SB_KERMIT_SOP | 4 | |
TELNET_SB_KERMIT_RESP_START_SERVER | 8 | |
TELNET_SB_KERMIT_RESP_STOP_SERVER | 9 | |
TELNET_EXOPL | 255 | 861 |
TELNET_SUBLIMINAL_MSG | 257 | 1097 |
Table A.1. TELNET options and suboptions
Zorp has a number of global options and variables that are used during the initialization of the engine, before any proxies or services are started. These options control the swapping of large data chunks (blobs) to disk, the handling of audit trails, and other miscellaneous parameters. To set these options, complete the following steps:
Select the Zorp component, then select Variables > New.
Enter the name of the global option into the Name field, and select the type of the option in the Type field.
Select OK, then Edit.
Enter the desired value of the option, then select OK.
Note |
---|
Global options can be also set at the beginning of the |
blob
These options control the handling of large data chunks (blobs), determine when the are swapped to disk, and also how much disk space and memory can be used by Zorp.
The directory where the blobs are swapped to. Default value:
/var/lib/zorp/tmp/
Zorp tries to store everything in the memory if possible. If the
memory usage of Zorp reaches hiwat, it starts to swap the data onto the
hard disk, until the memory usage reaches lowat. Default value:
128*0x100000
(128 MB)
Global options can be also set at the beginning of the
Config.py
file if managing the configuration of Zorp manually.
Lower threshold of data swapping. Default value:
96*0x100000
(96 MB)
The maximum amount of hard disk space that Zorp is allowed to use.
Default value: 1024*0x100000
(1 GB)
The maximum amount of memory that Zorp is allowed to use. Default
value: 256*0x100000
(256 MB)
Objects smaller than this value (in bytes) are never swapped to hard
disk. Default value: 16384
audit
Enable the compression of audit trail files. The level of compression
can be set via the config.audit.compress_level
parameter. Default value: TRUE
The level of compression ranging from 1 (lowest, default) to 9
(highest). Please note that higher compression levels use significantly
more CPU, therefore it is usually not recommended to set it to higher
than 4. Default value: 1
Encrypt the audit trail files using the key provided in the
config.audit.encrypt_certificate
parameter.
Default value: FALSE
The X.509 PEM certificate used to encrypt the audit trail files. Default value: empty.
The certificate should be placed in the following format:
-----BEGIN CERTIFICATE----- insert key here -----END CERTIFICATE-----
Name and path of the file containing the X.509 PEM certificate used to
encrypt the audit trail files. If this parameter is set, it overrides
the settings of config.audit.encrypt_certificate
.
Default value: empty.
The maximum size of a single audit trail file in bytes. Default value:
2000000000L
(2 GB)
Store each session in its own audit file. Default value:
FALSE
The maximum time frame of a single audit file in seconds. Default
value: 28800
(8 hours)
Zorp considers it abnormal if the size of an audit trail is increasing
faster than this value in byte/second. Default value:
2097152
(2 MB)
Time in seconds before repeating the notification about abnormally
growing audit trails. Default value: 300
(5
minutes)
Maximum size of an audit trail file in bytes. Default value:
52428800
(50 MB)
If set to TRUE
, Zorp terminates the connection
if the corresponding audit trail file reaches the size limit set in
config.audit.write_size_max
. Default value:
FALSE
options
Priority mapping for transferring Differentiated Services Code Point
(DSCP, also known as Type of Service or ToS). The low
(0
), normal (1
), high
(2
), and urgent (3
)
priorities can be assigned to the DSCP classes. The assigned priority
determines the priority of the Zorp thread that handles the connection.
The mapping is actually a hash table consisting of the DSCP class ID, a
colon (:
), the priority of the class
(0-3
), and a comma (,
)
except for the last row. For example:
config.options.dscp_mapping = { 1: 3, 2: 2, 3: 2, 4: 0 }
The default language used to display user-visible messages, e.g., HTTP
error pages. Default value: en
(English). Other
supported languages: de
(German);
hu
(Hungarian).
The timeout (in milliseconds) used when establishing server-side
connections. Default value: 30000
(30 sec)
Zorp caches certain data (e.g., to which zone a particular IP address belongs to)
to decrease the time required to process a connection. The following parameters
determine the size of these caches (the number of decisions stored in the cache).
Adjusting these parameters is required only in environments having very complex zone
structure and a large number of services. The following log message indicates that a
cache is full: Cache over shift-threshold, shifting
Stores IP addresses and the zone they belong to. Default value:
1000
Stores service-zone pairs, and if the service is permitted to enter
the zone. Default value: 1000
Stores service-zone pairs, and if the service is permitted to leave
the zone. Default value: 1000
instances.conf — zorp(8) instances database
The instances.conf
file describes the
zorp(8)
instances to be run on the system. It is processed by
zorpctl(8)
line by line, each line having the structure described below. Empty lines and lines
beginning with '#' are comments ignored by zorpctl.
instance-name parameters [-- zorpctl-options]
instance-name is the name of the Zorp instance to be started; it is passed to zorp with its --as parameter. Instance names may consist of the characters [a-zA-Z0-9_] and must begin with a letter.
parameters are space separated parameters entered into the zorp command-line. For details on these command-line parameters see zorp(8).
zorpctl-options are space separated parameters control startup specific options. They are processed by zorpctl itself. The following zorpctl options are available:
Enable the automatic restart feature of zorpctl. When an instance is in auto-restart mode, it is restarted automatically in case the instance exits.
Disable automatic restart for this instance.
Set the file descriptor limit to <number>. The file descriptor limit defaults to the number of threads (specified by the --threads parameter of zorp(8)) multiplied by 4.
Run <number> of processes for the instance. zorpctl starts exactly one Zorp process in master mode and <number> of slave Zorp processes. This mode of operation is incompatible with old-style dispatchers, you must use the new rule-based policy with this option.
zorp_ftp --policy /etc/zorp/policy.py --verbose 5
The line above describes a Zorp instance named zorp_ftp using policy file /etc/zorp/policy.py, and having verbosity level 5.
zorp_intra -v4 -p /etc/zorp/policy.py --threads 500 --no-auto-restart --fd-limit 1024 --process-limit 512
This line describes a zorp instance named zorp_intra using the policy
file /etc/zorp/policy.py
, verbosity level 4. The maximum number of
threads is set to 500, file descriptor limit to 1024, process limit to 512.
policy.py — zorp(8) policy file.
The policy.py
file is a Python module containing the zone and service
definitions and other policy related settings used by
zorp(8)
. Empty lines and lines beginning with '#' are comments and are ignored.
The policy.py
file is generated automatically by ZMC, the Zorp
Management Console, or it can be edited manually.
IMPORTANT: Do not edit manually a file generated by ZMC, because the manual changes will not be retained by ZMC and will be lost when re-generating the file.
For further information on policy.py
refer to the following sources:
A tutorial on manually editing the policy.py
file can be found at
http://www.balasys.hu/documentation/.
Additional information can also be found in the Zorp Administrator's Guide, the Zorp Reference Guide, and in the various tutorials available at the BalaSys Documentation Page at http://www.balasys.hu/documentation.
zorp — Zorp Firewall Suite
zorp [options]
The zorp command is the main entry point for a Zorp instance, and as
such it is generally called by zorpctl(8) with command line
parameters specified in
instances.conf(5)
.
Display version number and compilation information.
Set instance name to <name>. Instance names may consist of the characters [a-zA-Z0-9_] and must begin with a letter. Log messages of this instance are prefixed with this name.
Send log messages to the standard output instead of syslog. This option implies foreground mode, overriding the contradicting process options if present.
Prepend log category and log level to each message.
Escape non-printable characters to avoid binary log files. Each character less than 0x20 and greater than 0x7F are escaped in the form <XX>.
Set verbosity mask on a per category basis. Each log message has an assigned multi-level category, where levels are separated by a dot. For example, HTTP requests are logged under http.request. <spec> is a comma separated list of log specifications. A single log specification consists of a wildcard matching log category, a colon, and a number specifying the verbosity level of that given category. Categories match from left to right. E.g.: --logspec 'http.*:5,core:3'. The last matching entry will be used as the verbosity of the given category. If no match is found the default verbosity specified with --verbose is used.
Set the maximum number of threads that can be used in parallel by this Zorp instance.
Set the maximum number of idle threads; this option has effect only if threadpools are enabled (see the option --threadpools).
Enable the use of threadpools, which means that threads associated with sessions are not automatically freed, only if the maximum number of idle threads is exceeded.
Switch to the supplied user after starting up.
Switch to the supplied group after starting up.
Change root to the specified directory before reading the configuration file. The directory must be set up accordingly.
Switch to the supplied set of capabilities after starting up. This should contain the required capabilities in the permitted set. For the syntax of capability description see the man page of cap_from_text(3).
Do not change capabilities at all.
Set the OpenSSL crypto engine to be used for hardware accelerated crypto support.
zorpctl — Start and stop zorp instances.
zorpctl command [options [instances/@instance-list-file]]
zorpctl starts and stops zorp(8) instances
based on the contents of the
instances.conf(5)
file. Multiple instance names can be specified in the
command-line or in a file to start or stop several instances. If an
error occurs while stopping or starting an instance, an exclamation
mark is appended to the instance name as zorpctl
processes the request, and a summary is printed when the program
exits. If no instance is specified, the command is executed on all
instances. The instances to be controlled can be specified in a file instead
of listing them in the command line, e.g.: zorpctl command options
instances.txt. The instances.txt
should contain every instance
name in a new line.
Starts the specified Zorp instance(s).
Starts the specified Zorp instance(s) even if they are disabled.
Stops the specified Zorp instance(s).
Forces the specified Zorp instance(s) to stop using the KILL signal.
Restart the specified Zorp instance(s).
Forces the specified Zorp instance(s) to restart by stopping them using the KILL signal.
Reload the specified Zorp instance(s).
Display the status of the specified Zorp instance(s).
Display detailed status information.
Display the status of the specified Zorp instance(s) in an internal format easily parsable by ZMC. NOTE: This command is mainly used internally within Zorp, and the structure of its output may change.
Display version information on Zorp.
Raise the verbosity (log) level of the specified Zorp instance(s) by one.
Decrease the verbosity (log) level of the specified Zorp instance(s) by one.
Change various log related settings in the specified Zorp instance(s) using the following options:
Increase verbosity level by one.
Decrease verbosity level by one.
Set verbosity level to <verbosity>.
Set verbosity mask on a per category basis. The format of this value is described in zorp(8).
Display this help screen on the options of the log command.
Display internal information from the specified Zorp instance(s). The information to be disblayed can be specified with the following options:
Walk the specified tree.
Set the root node of the walk operation to [node].
Display a brief help on the options of the szig command.
Display a brief help message.
zorpctl.conf — zorpctl(8) configuration file.
The zorpctl.conf
file describes various global options ifluencing the
behavior of
zorpctl(8)
.
zorpctl(8)
processes the file line by line, each line having the structure described below. Empty
lines and lines beginning with '#' are comments and are ignored.
variable name = variable value
Each non-empty line specifies a variable name and its value separated by the equal sign ('='). The following variables are available:
Enable the automatic restart feature of zorpctl. Instances in auto-restart mode are restarted automatically when they exit. Default value: 1 (TRUE).
The number of seconds to wait for a stopping Zorp instance. Default value: 3.
In auto-restart mode there is no real way to detect whether Zorp failed to load or not. Zorpctl waits START_CHECK_TIMEOUT seconds and assumes that Zorp loaded successfully if it did not exit within this interval. Default value: 5 seconds.
In no-auto-restart mode the successful loading of a Zorp instance can be verified by instructing Zorp to daemonize itself and waiting for the parent to exit. This parameter specifies the number of seconds to wait for Zorp to daemonize itself. Default value: 60 seconds.
Zorp-specific arguments to be appended to the command line of each Zorp instance. Also recognised as APPEND_ARGS (deprecated). Default value: "".
Zorpctl-specific arguments to be appended to the command line of each instance. Default value: "".
Specifies whether to check the permissions of the Zorp configuration directory. If
set, Zorp refuses to run if the /etc/zorp
directory can be written
by user other then zorp
Default value: 1 (TRUE).
The path to the Zorp configuration directory to check if CHECK_PERMS is enabled.
NOTE: it does not change the Zorp policy file argument, this parameter is only used by
the permission validating code. Default value: ${prefix}/etc/zorp
.
The owner/group/permissions values considered valid for the configuration directory. zorpctl fails if the actual owner/group/permissions values conflict the ones set here. Default values: root.zorp, 0750 .
The path to the Zorp pid file directory. The directory is created automatically
prior to starting Zorp if it does not already exist.It is created if it does not exist,
before NOTE: No --pidfile argument is passed to Zorp, only
texistance of the directory is verified. Default value:
/var/run/zorp
.
The owner/group/permission values the pidfile directory is created with if it does not exist. Default values: root.root, 0700.
(c) Balasys IT Security Ltd.
1.1 This License Contract is entered into by and between Balasys and Licensee and sets out the terms and conditions under which Licensee and/or Licensee's Authorized Subsidiaries may use the Zorp GPL under this License Contract.
In this License Contract, the following words shall have the following meanings:
2.1 Balasys
Company name: Balasys IT Ltd.
Registered office: H-1117 Budapest, Alíz Str. 4.
Company registration number: 01-09-687127
Tax number: HU11996468-2-43
2.2. Words and expressions
Annexed Software
Any third party software that is a not a Balasys Product contained in the install media of the Balasys Product.
Authorized Subsidiary
Any subsidiary organization: (i) in which Licensee possesses more than fifty percent (50%) of the voting power and (ii) which is located within the Territory.
Balasys Product
Any software, hardware or service licensed, sold, or provided by Balasys including any installation, education, support and warranty services, with the exception of the Annexed Software.
License Contract
The present Zorp GPL License Contract.
Product Documentation
Any documentation referring to the Zorp GPL or any module thereof, with special regard to the reference guide, the administration guide, the product description, the installation guide, user guides and manuals.
Protected Hosts
Host computers located in the zones protected by Zorp GPL, that means any computer bounded to network and capable to establish IP connections through the firewall.
Protected Objects
The entire Zorp GPL including all of its modules, all the related Product Documentation; the source code, the structure of the databases, all registered information reflecting the structure of the Zorp GPL and all the adaptation and copies of the Protected Objects that presently exist or that are to be developed in the future, or any product falling under the copyright of Balasys.
Zorp GPL
Application software Balasys Product designed for securing computer networks as defined by the Product Description.
Warranty Period
The period of twelve (12) months from the date of delivery of the Zorp GPL to Licensee.
Territory
The countries or areas specified above in respect of which Licensee shall be entitled to install and/or use Zorp GPL.
Take Over Protocol
The document signed by the parties which contains
a) identification data of Licensee;
b) ordered options of Zorp GPL, number of Protected Hosts and designation of licensed modules thereof;
c) designation of the Territory;
d) declaration of the parties on accepting the terms and conditions of this License Contract; and
e) declaration of Licensee that is in receipt of the install media.
3.1. For the Zorp GPL licensed under this License Contract, Balasys grants to Licensee a non-exclusive,
non-transferable, perpetual license to use such Balasys Product under the terms and conditions of this License Contract and the applicable Take Over Protocol.
3.2. Licensee shall use the Zorp GPL in the in the configuration and in the quantities specified in the Take Over Protocol within the Territory.
3.3. On the install media all modules of the Zorp GPL will be presented, however, Licensee shall not be entitled to use any module which was not licensed to it. Access rights to modules and IP connections are controlled by an "electronic key" accompanying the Zorp GPL.
3.4. Licensee shall be entitled to make one back-up copy of the install media containing the Zorp GPL.
3.5. Licensee shall make available the Protected Objects at its disposal solely to its own employees and those of the Authorized Subsidiaries.
3.6. Licensee shall take all reasonable steps to protect Balasys's rights with respect to the Protected Objects with special regard and care to protecting it from any unauthorized access.
3.7. Licensee shall, in 5 working days, properly answer the queries of Balasys referring to the actual usage conditions of the
Zorp GPL, that may differ or allegedly differs from the license conditions.
3.8. Licensee shall not modify the Zorp GPL in any way, with special regard to the functions inspecting the usage of the software. Licensee shall install the code permitting the usage of the Zorp GPL according to the provisions defined for it by Balasys. Licensee may not modify or cancel such codes. Configuration settings of the Zorp GPL in accordance with the possibilities offered by the system shall not be construed as modification of the software.
3.9. Licensee shall only be entitled to analize the structure of the Balasys Products (decompilation or reverse- engineering) if concurrent operation with a software developed by a third party is necessary, and upon request to supply the information required for concurrent operation Balasys does not provide such information within 60 days from the receipt of such a request. These user actions are limited to parts of the Balasys Product which are necessary for concurrent operation.
3.10. Any information obtained as a result of applying the previous Section
(i) cannot be used for purposes other than concurrent operation with the Balasys Product;
(ii) cannot be disclosed to third parties unless it is necessary for concurrent operation with the Balasys Product;
(iii) cannot be used for the development, production or distribution of a different software which is similar to the BalaSys Product
in its form of expression, or for any other act violating copyright.
3.11. For any Annexed Software contained by the same install media as the Balasys Product, the terms and conditions defined by its copyright owner shall be properly applied. Balasys does not grant any license rights to any Annexed Software.
3.12. Any usage of the Zorp GPL exceeding the limits and restrictions defined in this License Contract shall qualify as material breach of the License Contract.
3.13. The Number of Protected Hosts shall not exceed the amount defined in the Take Over Protocol.
3.14. Licensee shall have the right to obtain and use content updates only if Licensee concludes a maintenance contract that includes such content updates, or if Licensee has otherwise separately acquired the right to obtain and use such content updates. This License Contract does not otherwise permit Licensee to obtain and use content updates.
4.1 Authorized Subsidiaries may also utilize the services of the Zorp GPL under the terms and conditions of this License Contract. Any Authorized Subsidiary utilising any service of the Zorp GPL will be deemed to have accepted the terms and conditions of this License Contract.
5.1. Licensee agrees that Balasys owns all rights, titles, and interests related to the Zorp GPL and all of Balasys's patents, trademarks, trade names, inventions, copyrights, know-how, and trade secrets relating to the design, manufacture, operation or service of the Balasys Products.
5.2. The use by Licensee of any of these intellectual property rights is authorized only for the purposes set forth herein, and upon termination of this License Contract for any reason, such authorization shall cease.
5.3. The Balasys Products are licensed only for internal business purposes in every case, under the condition that such license does not convey any license, expressly or by implication, to manufacture, duplicate or otherwise copy or reproduce any of the Balasys Products.
No other rights than expressly stated herein are granted to Licensee.
5.4. Licensee will take appropriate steps with its Authorized Subsidiaries, as Balasys may request, to inform them of and assure compliance with the restrictions contained in the License Contract.
6.1. Balasys hereby grants to Licensee the non-exclusive right to use the trade marks of the Balasys Products in the Territory in accordance with the terms and for the duration of this License Contract.
6.2. Balasys makes no representation or warranty as to the validity or enforceability of the trade marks, nor as to whether these infringe any intellectual property rights of third parties in the Territory.
7.1. In case of negligent infringement of Balasys's rights with respect to the Zorp GPL, committed by violating the restrictions and limitations defined by this License Contract, Licensee shall pay liquidated damages to Balasys. The amount of the liquidated damages shall be twice as much as the price of the Balasys Product concerned, on Balasys's current Price List.
8.1. Balasys shall pay all damages, costs and reasonable attorney's fees awarded against Licensee in connection with any claim brought against Licensee to the extent that such claim is based on a claim that Licensee's authorized use of the Balasys Product infringes a patent, copyright, trademark or trade secret. Licensee shall notify Balasys in writing of any such claim as soon as Licensee learns of it and shall cooperate fully with Balasys in connection with the defense of that claim. Balasys shall have sole control of that defense (including without limitation the right to settle the claim).
8.2. If Licensee is prohibited from using any Balasys Product due to an infringement claim, or if Balasys believes that any Balasys Product is likely to become the subject of an infringement claim, Balasys shall at its sole option, either: (i) obtain the right for Licensee to continue to use such Balasys Product, (ii) replace or modify the Balasys Product so as to make such Balasys Product non-infringing and substantially comparable in functionality or (iii) refund to Licensee the amount paid for such infringing Balasys Product and provide a pro-rated refund of any unused, prepaid maintenance fees paid by Licensee, in exchange for Licensee's return of such Balasys Product to Balasys.
8.3. Notwithstanding the above, Balasys will have no liability for any infringement claim to the extent that it is based upon:
(i) modification of the Balasys Product other than by Balasys,
(ii) use of the Balasys Product in combination with any product not specifically authorized by Balasys to be combined with the Balasys Product or
(iii) use of the Balasys Product in an unauthorized manner for which it was not designed.
9.1. The number of the Protected Hosts (including the server as one host), the configuration and the modules licensed shall serve as the calculation base of the license fee.
9.2. Licensee acknowlegdes that payment of the license fees is a condition of lawful usage.
9.3. License fees do not contain any installation or post charges.
10.1. Balasys warrants that during the Warranty Period, the optical media upon which the Balasys Product is recorded will not be defective under normal use. Balasys will replace any defective media returned to it, accompanied by a dated proof of purchase, within the Warranty Period at no charge to Licensee. Upon receipt of the allegedly defective Balasys Product, Balasys will at its option, deliver a replacement Balasys Product or Balasys's current equivalent to Licensee at no additional cost. Balasys will bear the delivery charges to Licensee for the replacement Product.
10.2. In case of installation by Balasys, Balasys warrants that during the Warranty Period, the Zorp GPL, under normal use in the operating environment defined by Balasys, and without unauthorized modification, will perform in substantial compliance with the Product Documentation accompanying the Balasys Product, when used on that hardware for which it was installed, in compliance with the provisions of the user manuals and the recommendations of Balasys. The date of the notification sent to Balasys shall qualify as the date of the failure. Licensee shall do its best to mitigate the consequences of that failure. If, during the Warranty Period, the Balasys Product fails to comply with this warranty, and such failure is reported by Licensee to Balasys within the Warranty Period, Balasys's sole obligation and liability for breach of this warranty is, at Balasys's sole option, either:
(i) to correct such failure,
(ii) to replace the defective Balasys Product or
(iii) to refund the license fees paid by Licensee for the applicable Balasys Product.
11.1. EXCEPT AS SET OUT IN THIS LICENSE CONTRACT, BALASYS MAKES NO WARRANTIES OF ANY KIND WITH RESPECT TO THE Zorp GPL. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BALASYS EXCLUDES ANY OTHER WARRANTIES, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF SATISFACTORY QUALITY, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS.
12.1. SOME STATES AND COUNTRIES, INCLUDING MEMBER COUNTRIES OF THE EUROPEAN UNION, DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES AND, THEREFORE, THE FOLLOWING LIMITATION OR EXCLUSION MAY NOT APPLY TO THIS LICENSE CONTRACT IN THOSE STATES AND COUNTRIES. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW AND REGARDLESS OF WHETHER ANY REMEDY SET OUT IN THIS LICENSE CONTRACT FAILS OF ITS ESSENTIAL PURPOSE, IN NO EVENT SHALL BALASYS BE LIABLE TO LICENSEE FOR ANY SPECIAL, CONSEQUENTIAL, INDIRECT OR SIMILAR DAMAGES OR LOST PROFITS OR LOST DATA ARISING OUT OF THE USE OR INABILITY TO USE THE Zorp GPL EVEN IF BALASYS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12.2. IN NO CASE SHALL BALASYS'S TOTAL LIABILITY UNDER THIS LICENSE CONTRACT EXCEED THE FEES PAID BY LICENSEE FOR THE Zorp GPL LICENSED UNDER THIS LICENSE CONTRACT.
13.1. This License Contract shall come into effect on the date of signature of the Take Over Protocol by the duly authorized
representatives of the parties.
13.2. Licensee may terminate the License Contract at any time by written notice sent to Balasys and by simultaneously destroying all copies of the Zorp GPL licensed under this License Contract.
13.3. Balasys may terminate this License Contract with immediate effect by written notice to Licensee, if Licensee is in material or persistent breach of the License Contract and either that breach is incapable of remedy or Licensee shall have failed to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach.
14.1. Save as expressly provided in this License Contract, no amendment or variation of this License Contract shall be effective unless in writing and signed by a duly authorised representative of the parties to it.
15.1. The failure of a party to exercise or enforce any right under this License Contract shall not be deemed to be a waiver of that right nor operate to bar the exercise or enforcement of it at any time or times thereafter.
16.1. If any part of this License Contract becomes invalid, illegal or unenforceable, the parties shall in such an event negotiate in good faith in order to agree on the terms of a mutually satisfactory provision to be substituted for the invalid, illegal or unenforceable
provision which as nearly as possible validly gives effect to their intentions as expressed in this License Contract.
17.1. Any notice required to be given pursuant to this License Contract shall be in writing and shall be given by delivering the notice by hand, or by sending the same by prepaid first class post (airmail if to an address outside the country of posting) to the address of the relevant party set out in this License Contract or such other address as either party notifies to the other from time to time. Any notice given according to the above procedure shall be deemed to have been given at the time of delivery (if delivered by hand) and when received (if sent by post).
18.1. Headings are for convenience only and shall be ignored in interpreting this License Contract.
18.2. This License Contract and the rights granted in this License Contract may not be assigned, sublicensed or otherwise transferred in whole or in part by Licensee without Balasys's prior written consent. This consent shall not be unreasonably withheld or delayed.
18.3. An independent third party auditor, reasonably acceptable to Balasys and Licensee, may upon reasonable notice to Licensee and during normal business hours, but not more often than once each year, inspect Licensee's relevant records in order to confirm that usage of the Zorp GPL complies with the terms and conditions of this License Contract. Balasys shall bear the costs of such audit. All audits shall be subject to the reasonable safety and security policies and procedures of Licensee.
18.4. This License Contract constitutes the entire agreement between the parties with regard to the subject matter hereof. Any modification of this License Contract must be in writing and signed by both parties.
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
Definitions
"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
to Distribute and Publicly Perform the Work including as incorporated in Collections.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (for example a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
For the avoidance of doubt:
Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation.
Representations, Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
Miscellaneous
Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
© BalaSys IT Ltd.
Send your comments to: support@balasys.hu