Configure SSL/TLS between OpsCenter and the DataStax Agents
OpsCenter uses Transport Layer Security (TLS), referred to as its predecessor Secure Socket Layer (SSL), to encrypt the communication protocol and authenticate traffic between DataStax Agents and the main OpsCenter daemon. By default, SSL is disabled.
|
Running OpsCenter without SSL should only be done when running OpsCenter and DataStax Enterprise (DSE) under the following conditions:
|
Otherwise, configuring SSL between OpsCenter and DataStax Agents is strongly recommended as a security best practice.
Enable SSL/TLS for OpsCenter and agent communication
-
Package installations
-
Tarball installations
Enable SSL between OpsCenter and DataStax Agents by editing the opscenterd.conf file.
-
If you need to regenerate SSL key files, do the following preparatory steps. Otherwise, the SSL key generation process is done automatically at package install time.
-
Locate
opscenterd.confandaddress.yamlat/etc/opscenter/opscenterd.confand/var/lib/datastax-agent/conf/address.yaml. -
Because OpsCenter requires the
.derfile format for SSL, if the existing agents ssl_certfile inopscenterd.confis in a.pemformat, run the following command to convert the format:openssl x509 -outform der -in /var/lib/opscenter/ssl/opscenter.pem -out /var/lib/opscenter/ssl/opscenter.derFor more information about SSL cert file formats, see convert SSL certificates.
-
Because the
setup.pyscript uses/usr/share/opscenter/conf/ssl.conf, which dictates the certificate common name, modify thessl.confvalues before usingsetup.py:Example ssl.conf[ req ] prompt=no distinguished_name = req_distinguished_name [ req_distinguished_name ] C = country_name ST = state_abbreviation L = city_name O = company_name OU = division_name CN = common_certificate_name emailAddress = opscenter.admin@email.com -
If the SSL files already exist in the
/usr/share/opscenter/ssldirectory, they are not automatically recreated. Before runningsetup.py, remove the old SSL files from that directory. -
Make sure that the
/tmpdirectory does not have thenoexecflag set.The
setup.pyscript requires the/tmpdirectory to haveexecpermissions. See Set and secure the/tmpdirectory for the DataStax Agent. -
Run the OpsCenter
setup.pyscript:sudo /usr/share/opscenter/bin/setup.pyThe script generates the SSL keys and certificates used by the OpsCenter daemon and the DataStax Agents to communicate with one another in the following directory:
/usr/share/opscenter/ssl. -
Copy the following files to
/var/lib/opscenter/ssl:-
opscenter.key: OpsCenter SSL private key -
opscenter.der: OpsCenter SSL certificate -
agentKeyStore: DataStax Agent keystore -
agentKeyStore.der: DataStax Agent SSL certificate -
agentKeyStore.key: DataStax Agent keyfileThe
agentKeyStore.keykeyfile is necessary only when configuring high availability (HA), so that the secondary OpsCenter instance can communicate with the primary OpsCenter instance. The failover opscenterd processes on the secondary OpsCenter instance use this key to establish a STOMP connection to the primary opscenterd instance.sudo cp /usr/share/opscenter/ssl/opscenter.key /var/lib/opscenter/sslsudo cp /usr/share/opscenter/ssl/opscenter.der /var/lib/opscenter/sslsudo cp /usr/share/opscenter/ssl/agentKeyStore /var/lib/opscenter/sslsudo cp /usr/share/opscenter/ssl/agentKeyStore.der /var/lib/opscenter/sslsudo cp /usr/share/opscenter/ssl/agentKeyStore.key /var/lib/opscenter/ssl
-
-
Change ownership of the files copied in the previous step to the
opscenteruser and theopscentergroup:sudo chown opscenter:opscenter /var/lib/opscenter/ssl/opscenter.keysudo chown opscenter:opscenter /var/lib/opscenter/ssl/opscenter.dersudo chown opscenter:opscenter /var/lib/opscenter/ssl/agentKeyStoresudo chown opscenter:opscenter /var/lib/opscenter/ssl/agentKeyStore.der -
If configuring HA, change the ownership for the
agentKeyStore.keykeyfile as well:sudo chown opscenter:opscenter /var/lib/opscenter/ssl/agentKeyStore.key
-
-
Edit
opscenterd.confto add an[agents]section with theuse_ssloption set totrue:sudo vi /etc/opscenter/opscenterd.confopscenterd.conf[agents] use_ssl = true ssl_keyfile = /var/lib/opscenter/ssl/opscenter.key ssl_certfile = /var/lib/opscenter/ssl/opscenter.der agent_keyfile = /var/lib/opscenter/ssl/agentKeyStore agent_keyfile_raw = /var/lib/opscenter/ssl/agentKeyStore.key agent_certfile = /var/lib/opscenter/ssl/agentKeyStore.derThe
agent_keyfile_rawfile is used only HA configurations. -
Restart the OpsCenter daemon.
-
If you need to connect to a cluster in which DataStax Agents have already been deployed, log in to each of the nodes and reconfigure the
address.yamlfile.If you do not want to manually edit all of the node configuration files, follow the procedure to install DataStax Agents automatically.
-
Copy
/var/lib/opscenter/ssl/agentKeyStorefrom the OpsCenter machine to/var/lib/datastax-agent/ssl/agentKeyStoreon each node in the cluster:scp /var/lib/opscenter/ssl/agentKeyStore USER@NODE:/var/lib/datastax-agent/ssl/Replace
USERwith the user ID on the node, and replaceNODEwith the node name or IP address of the node. -
Log in to each node in the cluster using SSH:
ssh USER@NODE -
Edit the
address.yamlfile, changinguse_sslto1:sudo vi /var/lib/datastax-agent/conf/address.yamladdress.yamluse_ssl: 1 -
If your keystore and truststore files reside in a different location from the default, define the following parameters to indicate the location of the keystore and truststore, plus the password for each:
address.yamlopscenter_ssl_truststore: /etc/datastax-agent/key/dse-truststore.jks opscenter_ssl_truststore_password: truststore_password opscenter_ssl_keystore: /etc/datastax-agent/key/keystore.jks opscenter_ssl_keystore_password: keystore_password -
Restart the DataStax Agent:
sudo service datastax-agent restart
-
-
After opscenterd and all DataStax Agents have been configured and restarted, verify proper connection through the Agent Status tab.
To enable SSL for tarball installations, edit the configuration file and run a script to generate the keys used by OpsCenter and the DataStax Agents.
-
Because OpsCenter requires the
.derfile format for SSL, if the existing agents ssl_certfile inopscenterd.confis in a.pemformat, run the following command to convert the format:openssl x509 -outform der -in /INSTALL_DIRECTORY/ssl/opscenter.pem -out /INSTALL_DIRECTORY/ssl/opscenter.derFor more information about SSL cert file formats, see convert SSL certificates.
-
If the SSL files already exist in the
INSTALL_DIRECTORY/ssldirectory, they are not automatically recreated. Before runningsetup.py, remove the old SSL files from that directory. -
Run the OpsCenter
setup.pyscript:sudo /INSTALL_DIRECTORY/bin/jython/setup.pyThe script generates the SSL keys and certificates used by the OpsCenter daemon and the DataStax Agents to communicate with one another in the
/ssldirectory. -
Locate the
opscenterd.conffile atINSTALL_DIRECTORY/conf/opscenterd.conf. -
Open
opscenterd.confin an editor, and then add an[agents]section with theuse_ssloption set totrue:sudo vi INSTALL_DIRECTORY/conf/opscenterd.confopscenterd.conf[agents] use_ssl = true ssl_keyfile = INSTALL_DIRECTORY/ssl/opscenter.key ssl_certfile = INSTALL_DIRECTORY/ssl/opscenter.der agent_keyfile = INSTALL_DIRECTORY/ssl/agentKeyStore agent_keyfile_raw = INSTALL_DIRECTORY/ssl/agentKeyStore.key agent_certfile = INSTALL_DIRECTORY/ssl/agentKeyStore.derThe
agent_keyfile_rawfile is used only HA configurations. -
Restart the OpsCenter daemon.
-
If you need to connect to a cluster in which DataStax Agents have already been deployed, log in to each of the nodes and reconfigure the
address.yamlfile.If you do not want to manually edit all of the node configuration files, follow the procedure to install DataStax Agents automatically.
-
On each node in the cluster, copy
INSTALL_DIRECTORY/ssl/agentKeyStorefrom the OpsCenter machine to thessl/agenKeyStoreon the node (AGENT_INSTALL_DIRECTORY/ssl/agentKeyStore).scp /opt/opscenter/ssl/agentKeyStore USER@NODE:AGENT_INSTALL_DIRECTORY/ssl/agentKeyStoreReplace
USERwith the user ID on the node, and replaceNODEwith the node’s host name or IP address. -
Log in to each node in the cluster using SSH:
ssh USER@NODE -
Locate the
address.yamlfile atINSTALL_DIRECTORY/conf/address.yaml. -
Edit the
address.yamlfile, changing the value ofuse_sslto1:sudo vi /var/lib/datastax-agent/conf/address.yamluse_ssl: 1 -
If your keystore and truststore files reside in a different location from the default, define the following parameters to indicate the location of the keystore and truststore, plus the password for each:
opscenter_ssl_truststore: /etc/datastax-agent/key/dse-truststore.jks opscenter_ssl_truststore_password: truststore_password opscenter_ssl_keystore: /etc/datastax-agent/key/keystore.jks opscenter_ssl_keystore_password: keystore_password -
Restart the DataStax Agent:
sudo INSTALL_DIRECTORY/bin/datastax-agent
-
-
After opscenterd and all DataStax Agents have been configured and restarted, verify proper connection through the Agent Status tab.
Disable SSL/TLS for OpsCenter and agent communication
-
Package installations
-
Tarball installations
To disable SSL for package installations, modify the OpsCenter configuration file and restart OpsCenter.
By default SSL is turned off in OpsCenter. Perform this task if you have configured the DataStax Agents on a cluster to use SSL previously and now need to turn SSL off.
-
Locate the
opscenterd.conffile at/etc/opscenter/opscenterd.conf. -
Open
opscenterd.confin an editor, and then set the value of theuse_ssloption tofalseto disable SSL:sudo vi /etc/opscenter/opscenterd.confopscenterd.conf[agents] use_ssl = false -
Restart the OpsCenter daemon.
-
Reconfigure the DataStax Agents.
If you do not want to manually edit all of the node configuration files, follow the procedure to automatically install DataStax Agents.
-
Log in to each node in the cluster using SSH:
ssh USER@NODEReplace
USERwith the user ID on the node, and replaceNODEwith the node name or IP address of the node. -
Edit the
address.yamlfile (/var/lib/datastax-agent/conf/address.yaml) to set the value ofuse_sslto0:sudo vi /var/lib/datastax-agent/conf/address.yamluse_ssl: 0 -
Restart the DataStax Agent:
sudo service datastax-agent restart
-
-
After
opscenterd.confand all DataStax Agents have been configured and restarted, verify proper connection through the Agent Status tab.
To disable SSL for tarball installations, modify the OpsCenter configuration file and restart OpsCenter.
By default, SSL is turned off in OpsCenter. You only need to perform this task if you have previously configured the DataStax Agents on a cluster to use SSL and now want to turn SSL off.
-
Locate the
opscenterd.conffile atINSTALL_DIRECTORY/conf/opscenterd.conf. -
Open
opscenterd.confin an editor, and then set the value of theuse_ssloption tofalseto disable SSL:vi INSTALL_DIRECTORY/conf/opscenterd.confopscenterd.conf[agents] use_ssl = false -
Restart the OpsCenter daemon.
-
Reconfigure the DataStax Agents.
If you do not want to manually edit all of the node configuration files, follow the procedure to automatically install DataStax Agents.
-
Log in to each node in the cluster using SSH:
ssh USER@NODEReplace
USERwith the user ID on the node, and replaceNODEwith the node name or IP address of the node. -
Locate the
address.yamlfile atINSTALL_DIRECTORY/conf/address.yaml. -
Edit the
address.yamlfile, changing the value ofuse_sslto0:sudo vi INSTALL_DIRECTORY/conf/address.yamluse_ssl: 0 -
Restart the DataStax Agent:
sudo INSTALL_DIRECTORY/bin/datastax-agent
-
-
After opscenterd and all DataStax Agents have been configured and restarted, verify proper connection through the Agent Status tab.