TLS/SSL (om_ssl)
The om_ssl module uses the OpenSSL library to provide TLS/SSL transport. It is like the om_tcp module, except that a TLS/SSL handshake is performed at connection time and the data is sent over a secure channel. Data transferred over plain TCP can be eavesdropped or even altered in a man-in-the-middle attack, while the om_ssl module provides secure transport.
Configuration
The om_ssl module accepts the following directives in addition to the common module directives. The Host directive is required.
Required directives
The following directive is required for the module to start.
The module connects to this IP address or hostname. If using a hostname, the module resolves the hostname to an IP address on each new connection. You can define the port number by appending it to the IP address or hostname using a colon as a separator ( IPv6 addresses must be enclosed in square brackets ( You can define this directive multiple times to connect to multiple hosts or ports in failover mode. Specify IPv4 and IPv6 addresses separately as needed. If you use a DNS name, you should keep the addresses or CNAMEs below 16 to avoid issues caused by DNS response size limits.
|
TLS/SSL directives
The following directives configure secure data transfer via TLS/SSL.
Set this directive to |
||||||||||||||||
Set this directive to |
||||||||||||||||
Set this directive to |
||||||||||||||||
Set this directive to the path of a directory containing Certificate Authority (CA) certificates.
The module uses these certificates to verify the certificate presented by the remote host.
Name the certificate files using the OpenSSL hashed format: the hash of the certificate followed by
For example, if the certificate hash is To trust a remote host’s self-signed certificate, include a copy of it in this directory. |
||||||||||||||||
Set this directive to the path of the Certificate Authority (CA) certificate used to verify the certificate presented by the remote host. To trust a remote host’s self-signed certificate, specify the remote host’s certificate itself. For certificates signed by an intermediate CA, the specified certificate must contain the complete certificate chain (certificate bundle). |
||||||||||||||||
Set this directive to a PCRE2-compliant regular expression to locate a suitable Certificate Authority (CA) certificate. This directive is supported on Windows and macOS. On Windows, the certificate must be in the Windows Certificate Store. On macOS, the certificate must be in the system keychain. The pattern must be in the format
This produces the following output in the NXLog Agent log file:
If the pattern matches multiple certificates, NXLog Agent uses the first match. If the certificate changes, restart NXLog Agent to apply the new certificate. This directive is mutually exclusive with the CAThumbprint, CADir, and CAFile directives.
|
||||||||||||||||
Set this directive to the thumbprint of the Certificate Authority (CA) certificate used to verify the certificate presented by the remote host. This directive is supported on Windows and macOS. On Windows, copy the hexadecimal fingerprint string from Windows Certificate Manager (certmgr.msc). The certificate must be in a Windows certificate store accessible by NXLog Agent. On macOS, obtain the hexadecimal fingerprint string from the Keychain Access application. The certificate must be accessible in the system keychain. Whitespaces and colons are automatically removed.
|
||||||||||||||||
Set this directive to the path of the certificate file to present to the remote host during the TLS/SSL handshake. |
||||||||||||||||
Set this directive to the path of the private key file corresponding to the certificate specified by CertFile. |
||||||||||||||||
Set this directive to a PCRE2-compliant pattern to identify the certificate and its corresponding private key.
The pattern must use the format On Windows, import the certificate in PFX format into the On macOS, ensure the certificate and its private key are present in the System Keychain ( If the pattern matches multiple certificates, NXLog Agent uses the first match. If the certificate changes, restart NXLog Agent to apply the new certificate. This directive is mutually exclusive with the CertThumbprint, CertFile and CertKeyFile directives. For example:
or
This produces the following output in the NXLog Agent log file:
|
||||||||||||||||
Set this directive to the thumbprint of the certificate to present to the remote server during the TLS/SSL handshake. Whitespaces and colons are automatically removed. This directive is supported on Windows and macOS.
On Windows, copy the hexadecimal fingerprint string from Windows Certificate Manager (certmgr.msc).
Import the certificate to the
When the global directive UseCNGCertificates is set to
When UseCNGCertificates is set to On macOS, obtain the hexadecimal fingerprint string from the Keychain Access application.
The certificate and its associated private key must be present in the System Keychain ( For example:
This directive is mutually exclusive with the CertFile and CertKeyFile directives.
|
||||||||||||||||
Set this directive to the path of a directory containing certificate revocation list (CRL) files.
The module uses these files to reject connections from hosts presenting a revoked certificate.
Name the files using the OpenSSL hashed format: the hash of the issuer followed by
For example, if the hash is |
||||||||||||||||
Set this directive to the path of the certificate revocation list (CRL) file used to reject connections from hosts presenting a revoked certificate. To generate a CRL file using OpenSSL:
|
||||||||||||||||
Set this directive to the path of a file containing Diffie-Hellman parameters for key exchange. Generate the parameters using dhparam(1ssl). If this directive is not set, the module uses default parameters. See the OpenSSL Wiki for further details. |
||||||||||||||||
Set this directive to the passphrase of the private key specified by CertKeyFile. This directive applies only to encrypted private keys. To generate a private key with Triple DES encryption using OpenSSL:
|
||||||||||||||||
Set this directive to This directive is only supported on Windows. |
||||||||||||||||
Set this directive to |
||||||||||||||||
Set this directive to |
||||||||||||||||
Set this directive to the signature algorithm parameter to pass to the Windows SSL library. Accepted values depend on the available encryption providers. This directive is only supported on Windows. |
||||||||||||||||
Set this directive to the hostname to use for Server Name Indication (SNI). If not set, the module uses the hostname specified in Host. |
||||||||||||||||
Set this directive to override the permitted cipher list for TLSv1.2 and below.
Use the format described in the ciphers(1ssl) man page.
For example, specify
|
||||||||||||||||
Set this directive to override the permitted cipher list for TLSv1.3. Use the same format as SSLCipher. Refer to the OpenSSL documentation for a list of valid TLS v1.3 cipher suites. The default is:
|
||||||||||||||||
Set this directive to
|
||||||||||||||||
Set this directive to restrict the TLS/SSL protocols the module accepts.
Specify a comma-separated list of the following values: |
||||||||||||||||
Set this directive to |
||||||||||||||||
Set this directive to This directive depends on the values of the AllowUntrusted and RequireCert directives:
|
||||||||||||||||
Set this directive to |
Optional directives
This optional directive specifies the local port number of the connection. If this is not specified, a random high port number will be used, which is not always ideal in firewalled network environments.
|
|||
See the OutputType directive in the list of common module directives. The default is LineBased_LF. |
|||
This optional directive sets the reconnect interval in seconds. If it is set, the module attempts to reconnect in every defined second. If it is not set, the reconnect interval will start at 1 second and double with every attempt. In the latter case, when the system decides that the reconnection is successful, the reconnect interval is immediately reset to 1 sec.
|
|||
This optional directive defines the behavior when the connection with the remote host is lost.
When set to |
|||
This boolean directive is used to turn off the network optimization performed by Nagle’s algorithm. Nagle’s algorithm is a network optimization tweak that tries to reduce the number of small packets sent out to the network, by merging them into bigger frames, and by not sending them to the other side of the session before receiving the ACK. If this directive is unset, the TCP_NODELAY socket option will not be set. |
|||
Use this directive to log a warning when the module cannot send data to the destination, allowing you to monitor pipeline backpressure.
When set to |
Examples
This configuration reads log messages from a socket and sends them in the NXLog Binary format to another NXLog Agent instance.
<Input uds>
Module im_uds
UDS tmp/socket
</Input>
<Output ssl>
Module om_ssl
Host example.com:23456
CAFile %CERTDIR%/ca.pem
CertFile %CERTDIR%/client-cert.pem
CertKeyFile %CERTDIR%/client-key.pem
KeyPass secret
AllowUntrusted TRUE
OutputType Binary
</Output>
This configuration sends logs to another NXLog Agent instance in a failover configuration (multiple Hosts defined).
<Output ssl>
Module om_ssl
Host 192.168.1.2:23456
Host 192.168.1.3:23456
Host example.com:1514
CAFile %CERTDIR%/ca.pem
</Output>