SSL channel security

This article describes the steps to enable channel protection via the SSL protocol when configuring ADS authentication.

Prerequisites for enabling SSL

TLS trust should be configured for all hosts in a cluster. Below are the main principles for configuring TLS for ADS.

  1. Save the root ca.crt certificate of the existing (or specially created using OpenSSL) certification authority (CA) (permissions for the certificate — 644):

    • To the system truststore, for example, as shown in the commands given below:

      Commands for different distributions

      RPM-based distributions (ALT Linux, RedOS):

      $ sudo cp ca.crt /etc/pki/ca-trust/source/anchors/ads-ca.crt (1)
      $ sudo update-ca-trust (2)
      1 Copies ca.crt to the system certificate store (/etc/pki/ca-trust/source/anchors).
      2 Runs an update and merges all certificate authority (CA) certificates and trust settings into single output files.

      DEB-based distributions (Ubuntu, Astra Linux):

      $ sudo cp ca.crt /usr/local/share/ca-certificates/ads-ca.crt (1)
      $ sudo update-ca-certificates (2)
      1 Copies ca.crt to the system certificate store /usr/local/share/ca-certificates.
      2 Runs an update and merges all certificate authorities (CA) certificates and trust settings into unified output files, placing the root CA certificate into CApath.
    • To standard OpenSSL CApath ($OPENSSLDIR/certs):

      $ sudo cp ca.crt "$(openssl version -d | cut -d'"' -f2)/certs/ads-ca.crt"

      Standard CApath OpenSSL on different distributions:

      • ALT Linux: /var/lib/ssl;

      • RedOS: /etc/pki/tls;

      • Ubuntu, Astra Linux: /etc/ssl.

        Both steps of copying the CA certificate are required for the HAProxy service: it scans OpenSSL CApath ($OPENSSLDIR/certs) and loads *.crt and *.pem files from it (without using the system’s trusted certificate store), and for different Linux distributions, the certificate update command works differently (for RPM-based distributions, only the certificate package is updated, without touching OpenSSL CApath).

        For more detailed information on setting up root CA certificates, refer to documentation for your operating system.

  2. For each cluster host, use OpenSSL to create PEM files for services that require TLS (Monitoring, HAProxy):

    • server.crt — the cluster server TLS certificate in PEM format, signed by the root ca.crt certificate.

      The certificate’s Subject Alternative Name (SAN) field should include the fully qualified domain name (FQDN), the short hostname, the host’s IP address, and the address 127.0.0.1.

      Permissions for the certificate — 644.

    • server.key — the cluster server’s TLS private key in PEM format, without password protection.

      Рermissions for the key should be 600, and it must be created as root.

    • merged.pem — a PEM file combining server.crt and server.key (needed by HAProxy for client-side use).

      Example command to create merged.pem:

      $ cat server.crt server.key | sudo tee /etc/ssl/merged.pem
  3. Using the keytool utility for Java services (Kafka, NiFi, etc.):

    • create a keystore.jks file — a store containing the server.crt host certificate and the server.key key, which are presented during a TLS handshake;

    • create a truststore.jks file — a store that contains only the CA certificate and is used for checking neighboring hosts;

    • import the CA certificate into the JVM’s system truststore.

      Starting with ADS 4.1.0, enabling SSL no longer requires distributing each host’s server certificate to all other hosts. Instead, you only need to distribute the CA root certificate for the entire cluster. Each host still needs its own server certificate and key. The truststore contains only the CA certificate — that’s enough to verify any certificate signed by that CA.

Additional configurations must be done for the NiFi service according to the NiFi service authentication article, using the following parameters:

  • A list of DNs of all cluster hosts (for example,CN=ads-host-1.example.com, OU=AD, O=AD, L=MSK, ST=MO, C=RU), created when generating SSL certificates.

  • A username that has an entry in the Active Directory, who will act as the NiFi administrator, along with their password.

Start SSL on an ADS cluster using ADCM

To enable SSL, do the following:

  1. Apply the Manage SSL cluster action by clicking actions default dark actions default light in the Actions column of the ADS cluster.

  2. In the window that opens, activate the Enable SSL switch, expand the configuration tree, and enter the required parameter values.

    Enable SSL on the ADS cluster
    Enable SSL on the ADS cluster
    Parameters for enabling SSL
    Parameter Description Default value

    Keystore path

    Path to the keystore.jks storage on hosts

    /etc/ssl/keystore.jks

    Keystore password

    Password for the keystore.jks store

    bigdata

    Truststore path

    Path to the truststore.jks storage on hosts

    /etc/ssl/truststore.jks

    Truststore password

    Password for the truststore.jks store

    bigdata

    TLS server certificate

    Path to the cluster server’s TLS certificate in PEM format, used by services that require TLS

    /etc/ssl/server.crt

    TLS private key

    Path to the cluster server’s TLS private key in PEM format, without password protection, used by services that require TLS

    /etc/ssl/server.key

    TLS PEM bundle

    Path to a single PEM file with the server certificate followed by its private key, for services that need both in one file (like HAProxy)

    /etc/ssl/merged.pem

    Force rewrite services SSL configuration

    If set to true, the configuration for all services will be overwritten. Use if you entered the wrong password or truststore path when you first enabled SSL

    false

    (DANGEROUS!) Clean nifi user and authorizers

    If set to true, previously created users and previous authorization settings will be deleted

    false

  3. Click Run.

  4. Verify the action in the opened window.

    Verify the action
    Verify the action
  5. Wait until SSL is enabled. Analyze and correct errors if they occur.

    SSl startup process
    SSl startup process

Work with services after enabling SSL

Refer to the following articles when authenticating with SSL enabled:

Also, after enabling SSL, on the service configuration pages, values are set automatically:

Disable SSL on an ADS cluster using ADCM

To disable SSL, do the following:

  1. Apply the Manage SSL cluster action by clicking actions default dark actions default light in the Actions column of the ADS cluster.

  2. In the window that opens, deactivate the Enable SSL switch.

    Disable SSL on an ADS cluster
    Disable SSL on an ADS cluster
  3. Click Run.

  4. Verify the action in the opened window.

    Verify the action
    Verify the action
  5. Wait for the disable SSL to complete. Analyze and correct errors if they occur.

Found a mistake? Seleсt text and press Ctrl+Enter to report it