3.2.6. Protocol-level TLS settings

The following sections describe and show examples to common protocol-level TLS settings.

Cipher selection

The cipher algorithms used for key exchange and mass symmetric encryption are specified by the cipher attribute of the class referred in the client_tls_options or server_tls_options of the Encryption policy. These attributes contain a cipher specification as specified by the OpenSSL manuals. For more information on cipher suite names and their meanings, refer to the OpenSSL documentation openssl-ciphers(1) manual page.

The default set of ciphers can be set by using the following predefined variables.

NameValue
TLS_CIPHERS_DEFAULT Secure cipher suites with acceptable client compatibility.
TLS_CIPHERS_OLD Ciphers suites with support for very old clients through TLSv1 and TLSv1.1.
TLS_CIPHERS_CUSTOM Permit only the use of ciphers which defined in value.

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.

The Proxedo Network Security Suite uses two sets of configured cipher list. The TLS_CIPHERS_DEFAULT is recommended for general use. The TLS_CIPHERS_OLD contains additional cipher suites for compatibility with clients that do not support newer cipher suites.

The following table shows the ordered list of predefined cipher suites used in PNS.

Cipher suiteTLS_CIPHERS_DEFAULTTLS_CIPHERS_OLD
ECDHE-ECDSA-AES128-GCM-SHA256yesyes
ECDHE-RSA-AES128-GCM-SHA256yesyes
ECDHE-ECDSA-AES256-GCM-SHA384yesyes
ECDHE-RSA-AES256-GCM-SHA384yesyes
ECDHE-ECDSA-CHACHA20-POLY1305yesyes
ECDHE-RSA-CHACHA20-POLY1305yesyes
DHE-RSA-AES128-GCM-SHA256yesyes
DHE-RSA-AES256-GCM-SHA384yesyes
DHE-RSA-CHACHA20-POLY1305noyes
ECDHE-ECDSA-AES128-SHA256noyes
ECDHE-RSA-AES128-SHA256noyes
ECDHE-ECDSA-AES128-SHAnoyes
ECDHE-RSA-AES128-SHAnoyes
ECDHE-ECDSA-AES256-SHA384noyes
ECDHE-RSA-AES256-SHA384noyes
ECDHE-ECDSA-AES256-SHAnoyes
ECDHE-RSA-AES256-SHAnoyes
DHE-RSA-AES128-SHA256noyes
DHE-RSA-AES256-SHA256noyes
AES128-GCM-SHA256noyes
AES256-GCM-SHA384noyes
AES128-SHA256noyes
AES256-SHA256noyes
AES128-SHAnoyes
AES256-SHAnoyes
DES-CBC3-SHAnoyes

Table 3.4. Configured cipher lists in PNS

Warning

Using TLS_CIPHERS_OLD may expose connections to vulnerabilities associated with outdated cipher suites. It is recommended to use TLS_CIPHERS_DEFAULT whenever possible and only resort to TLS_CIPHERS_OLD if there is a specific need to support very old clients.

Cipher configuration

If a custom list of ciphers is required, the TLS_CIPHERS_CUSTOM variable can be used along with a custom cipher string. The custom cipher string should be a colon-separated list of cipher suites, specified in the syntax recognized by OpenSSL.

Creating custom cipher list

Figure 3.9. Creating custom cipher list

Note

The order of the ciphers in the list matters. It will be selected the first cipher from the list that is supported by both the client and the server, allowing control over which ciphers are preferred.

The custom cipher string should be formatted as follows:

<Cipher1>:<Cipher2>:<Cipher3>:...:<CipherN>[:!<Exclusion1>[:!<Exclusion2>:...]]

Each cipher suite is separated by a colon (:). Exclusion rules are specified by prefixing the cipher name with an exclamation mark (!) and can be included at the end of the list to disable specific ciphers.

Example 3.11. Configuring an Encryption Policy with Custom cipher suites

The following example configures an Encryption Policy that prioritizes security over compatibility by using custom cipher suites for client TLS options.

EncryptionPolicy(
    name="MyTLSEncryption",
    encryption=TwoSidedEncryption(
        client_verify=ClientNoneVerifier(),
        client_tls_options=ClientTLSOptions(
            ciphers=(
                TLS_CIPHERS_CUSTOM,
                (
                    "ECDHE-ECDSA-CHACHA20-POLY1305:"
                    "ECDHE-ECDSA-AES256-GCM-SHA384:"
                    "ECDHE-ECDSA-AES128-GCM-SHA256:"
                    "ECDHE-ECDSA-AES256-CCM:"
                    "ECDHE-ECDSA-AES128-CCM:"
                    "ECDHE-RSA-CHACHA20-POLY1305:"
                    "ECDHE-RSA-AES256-GCM-SHA384:"
                    "ECDHE-RSA-AES128-GCM-SHA256"
                )
            ),
            ciphers_tlsv1_3=TLSV1_3_CIPHERS_DEFAULT,
            shared_groups=(TLS_SHARED_GROUPS_CUSTOM, "X25519:X448:P-256"),
            cipher_server_preference=FALSE,
            timeout=300,
            session_cache_size=20480,
            disable_session_cache=TRUE,
            disable_ticket=TRUE,
            disable_compression=TRUE,
            dh_params=DHParam.fromFile(file_path="/etc/vela/dh.pem"),
            disable_renegotiation=TRUE,
            disable_send_root_ca=FALSE
        ),
        server_verify=ServerNoneVerifier(),
        server_tls_options=ServerTLSOptions(
            ciphers=TLS_CIPHERS_DEFAULT,
            ciphers_tlsv1_3=TLSV1_3_CIPHERS_DEFAULT,
            shared_groups=TLS_SHARED_GROUPS_DEFAULT,
            timeout=300,
            session_cache_size=20480,
            disable_session_cache=FALSE,
            disable_ticket=FALSE,
            disable_compression=FALSE
        ),
        client_certificate_generator=StaticCertificate(
            certificates=(
                Certificate.fromFile(
                    certificate_file_path="/etc/key.d/certs/cert.chain.pem",
                    private_key=PrivateKey.fromFile(
                        "/etc/key.d/certs/key.pem",
                        passphrase=""
                    )
                ),
                Certificate.fromFile(
                    certificate_file_path="/etc/key.d/ecdsa/cert.chain.pem",
                    private_key=PrivateKey.fromFile(
                        "/etc/key.d/ecdsa/key.pem",
                        passphrase=""
                    )
                )
            )
        )
    )
)