Configure SSL for client-to-node connections
Client-to-node encryption protects in-flight data from client machines to a database cluster using SSL (Secure Sockets Layer) and establishes a secure channel between the client and the coordinator node.
Complete the following procedure on every node in the cluster to configure SSL for client-to-node connections.
|
If you are not using the JCE Unlimited Strength Jurisdiction Policy, then make sure that your ticket granting principal does not use WARN [StreamConnectionEstablisher:18] 2015-06-22 14:12:18,589 SSLFactory.java (line 162) Filtering out TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA as it isnt supported by the socket |
Prerequisites
Create SSL certificates, keystores, and truststores. You can either create local keystore files or use a remote keystore provider.
Procedure
-
Locate the
cassandra.yamlconfiguration file. The location of this file depends on your installation type.-
Package installations
-
Tarball installations
/etc/hcd/cassandra/cassandra.yamlINSTALLATION_LOCATION/resources/cassandra/conf/cassandra.yamlReplace INSTALLATION_LOCATION with the path where you extracted the HCD tarball.
-
-
Edit
cassandra.yamland make the following changes in the client_encryption_options to enable SSL:-
Set enabled to
trueto enable SSL. -
Set optional to
false(default) to only allow SSL connections. -
Set require_client_auth to
trueto require two-way host certificate validation.
-
-
Configure the keystore and truststore, depending on whether you are using local keystore files or a remote keystore provider. All settings are configured in the
client_encryption_optionssection of cassandra.yaml:-
Local files: use the following settings.
The
store_typeoption is deprecated. Instead, usekeystore_typeandtruststore_type.client_encryption_options: enabled: true optional: false keystore_type: JKS keystore: <path_to_keystore> keystore_password: <keystore_password> require_client_auth: true truststore_type: JKS truststore: <path_to_truststore> truststore_password: <truststore_password> protocol: ssl algorithm: SunX509 cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA] -
Remote keystore provider: use the following settings.
The
store_typeoption is deprecated. Instead, usekeystore_typeandtruststore_type.Unused options can be blank or commented out.
Requires installation of a provider.
client_encryption_options: enabled: true optional: false keystore_type: PKCS12 require_client_auth: true truststore_type: PKCS12 protocol: ssl algorithm: SunX509 cipher_suites: [TLS_RSA_WITH_AES_128_CBC_SHA]- enabled
-
Enables client-to-node encryption. Default: false
- optional
-
When
optionalis selected (true), both encrypted and unencrypted connections over native transport are allowed. That is a necessary transition state to facilitate enabling client to node encryption on live clusters without inducing an outage for existing unencrypted clients. Typically, once existing clients are migrated to encrypted connections,optionalis unselected in order to enforce native transport encryption.Default:
false - keystore_type
-
Valid types are
JKS(default),JCEKS,PKCS11, orPKCS12. For file-based keystores, usePKCS12.PKCS11is not supported as atruststore_type.DataStax supports
PKCS11as akeystore_typeon nodes withcassandraworkloads. IfPKCS11is needed, inserver_encryption_optionsorclient_encryption_options, specify thekeystore_typeasPKCS11and thekeystoreasNONE. - client_keystore_path
-
Relative path from the HCD installation directory or the absolute path to the Java keystore (JKS) suitable for use with Java Secure Socket Extension (JSSE), which is the Java version of the Secure Sockets Layer (SSL), and Transport Layer Security (TLS). The keystore contains the private key used to encrypt outgoing messages.
HCD does not include default keystore files. You must create your own keystore file for SSL/TLS encryption to work.
The default path where HCD expects to find the keystore is
resources/cassandra/conf/.keystore - keystore_password
-
Password for the keystore.
Default:
cassandra - require_client_auth
-
Enables certificate authentication for client-to-node encryption.
-
true: Require certificate authentication for client-to-node encryption. Client certificates must be present on all nodes in the cluster. -
false(default): Do not require certificate authentication for client-to-node encryption.
-
- truststore_type
-
Valid types are
JKS,JCEKS, orPKCS12. For file-based truststores, usePKCS12.Due to an OpenSSL issue, you cannot use a
PKCS12truststore that was generated via OpenSSL. For example, a truststore generated via the following command does not work with HCD:openssl pkcs12 -export -nokeys -out truststore.pfx -in intermediate.chain.pemHowever, truststores generated via Java’s
keytooland then converted to PKCS12 work with HCD.Example:
keytool -importcert -alias rootca -file rootca.pem -keystore truststore.jkskeytool -importcert -alias intermediate -file intermediate.pem -keystore truststore.jkskeytool -importkeystore -srckeystore truststore.jks -destkeystore truststore.pfx -deststoretype pkcs12Default:
JKS - client_truststore_path
-
Relative path from HCD installation directory or the absolute path to the truststore containing the trusted certificate for authenticating remote servers.
The truststore path must be accessible to the HCD process.
There is no default truststore path. You must create your own truststore file for SSL/TLS encryption to work.
- truststore_password
-
Password for the truststore. This must match the password used when generating the keystore and truststore.
Default:
cassandraTruststore password and path is only required when require_client_auth is set totrue.
-
-
Save and close the
cassandra.yamlfile. -
Complete a rolling HCD restart.
See also
-
Configure JMX on the server side: Use this option to enable SSL connections.
-
Configure SSL for nodetool and Advanced Replication: Use
nodetooland HCD Advanced Replication with SSL encryption. -
Set up SSL for JConsole (JMX): Use J`Console` with SSL encryption.
-
Connect SSTableloader to a secured cluster: Use these steps in a development environment to configure the
sstableloader(bulk loader) with Kerberos or SSL. -
Connect to SSL-enabled nodes using cqlsh: Connect
cqlshto an SSL-enabled node by setting up SSL with environment variables orcqlshrcparameters.