Placing Signed SSL Certificates on the Appliances
Overview
Note: This document applies to Stratusphere version
This document provides instructions on how to place signed SSL certificates on the Stratusphere Hub, Database, and Collector appliances. Apart from getting rid of the alarming warning each time the Stratusphere Hub Web UI is accessed, placing a signed SSL certificate provides verifiable identification and security compliance to administrator & users accessing the Web UI of Stratusphere.
Preparation
- Procure any change controls needed to make changes to the production Stratusphere Hub, Database, and Collector appliances.
- Get login credentials of the Linux users as per the platform i.e.,
<username>
asfriend
on VMware, Citrix, and Nutanix,ec2-user
on AWS, orazureuser
on Azure to SSH into the Stratusphere Hub, Database, and Collector appliances. - Procure SSH access to the Stratusphere Hub, Database, and Collector Appliances. An SSH client such as Windows 10 Command Prompt and PuTTY can be used to log into the Hub, Database, and Collector provided TCP/22 is allowed to the appliances.
- Download and install your preferred SCP client (e.g., WinSCP, FileZilla, or similar) to download certificate requests and upload the SSL Certificate files.
- Be aware that you will need to first start the steps to prepare the SSL certificate request, pause in the middle of the instructions as you send the request to the Certifying Authority (CA), and then receive your certificate. This may take minutes, hours, or even days depending on your CA. You will then use the new certificate to complete the process.
Scenarios
- Import and Install an SSL Certificate and Key.
- Traditional: Generate a Request, Import & Install an SSL certificate.
Scenario 1: Import and Install an SSL Certificate and Key
This scenario applies when the IT or Security department created a certificate without using a request generated by a Stratusphere appliance. It walks the user through the steps to import the certificate, set the right permissions, and then install it in the right locations.
Instructions for the Stratusphere Hub & Collector Appliances
- Obtain the new signed certificate and key files for your appliance hostname. The final certificate needs to be in base64 / PEM / CER format. You may upload a PFX file containing the certificate and key, then extract the PEM certificate and key if needed. If the PFX file is password protected, that password will be required to do the extraction and remove the password protection.
- Use your favorite SCP client, such as WinSCP, to upload the certificate and key files to
/home/<username>/
(replace<username>
withfriend/ec2-user/azureuser
) on the Hub or Collector using credentials for the<username>
on your platform i.e.,<username>
asfriend
on VMware, Citrix, and Nutanix,ec2-user
on AWS, andazureuser
on Azure. - Use your favorite SSH client, such as Windows 10 Command Prompt or PuTTY, to connect and log in using the credentials for
<username>
and run: -
Copy
sudo bash
- to obtain
root
access. When prompted, enter the password for your<username>
. - Copy the new certificate to
ssl.cert.new
(replaceYOURCERTNAME
with name of uploaded file): -
Copy
cp /home/$(logname)/YOURCERTNAME /home/$(logname)/ssl.crt.new
- If you have uploaded a PEM format certificate along with a separate key file, copy the key to
ssl.key.new
(replaceYOURKEYNAME
with name of uploaded key). -
Note: PFX files should contain the key, so for PFX skip this step and go to the next step for extracting the cert and key from the PFX.
-
Copy
cp /home/$(logname)/YOURKEYNAME /home/$(logname)/ssl.key.new
- For a PFX file, complete the following sub-steps. If the certificate is already in PEM format, skip to the next numbered step.
- Export the certificate from the PFX file by running the following command:
Note: You’ll be prompted for the password if the file is protected.
- Copy
openssl pkcs12 -in /home/$(logname)/ssl.crt.new -clcerts -nokeys -out /home/$(logname)/ssl.crt.extract
- Export the private key file from the PFX file:
- Copy
openssl pkcs12 -in /home/$(logname)/ssl.crt.new -nocerts -nodes -out /home/$(logname)/ssl.key.new
- Remove the passphrase from the private key (if needed):
- Copy
openssl rsa -in /home/$(logname)/ssl.key.new -out /home/$(logname)/ssl.key.new
- If there are no errors, move
ssl.crt.extract
back intossl.crt.new
. - Copy
mv /home/$(logname)/ssl.crt.extract /home/$(logname)/ssl.crt.new
/bin/cp /etc/lwl/ssl/ssl.crt /etc/lwl/ssl/ssl.crt.backup
/bin/cp /etc/lwl/ssl/ssl.key /etc/lwl/ssl/ssl.key.backup
/bin/cp /home/$(logname)/ssl.crt.new /etc/lwl/ssl/ssl.crt
/bin/cp /home/$(logname)/ssl.key.new /etc/lwl/ssl/ssl.key
chown root:root /etc/lwl/ssl/ssl.crt
chmod 644 /etc/lwl/ssl/ssl.crt
chmod 640 /etc/lwl/ssl/ssl.key
restorecon -RF /etc/lwl/ssl
systemctl restart httpd
systemctl is-active httpd
Instructions for the Stratusphere Database Appliances
- Obtain the new signed certificate and key files for your appliance hostname. The final certificate needs to be in base64 / PEM / CER format. You may upload a PFX file containing the certificate and key, then extract the PEM certificate and key if needed. If the PFX file is password protected, that password will be required to do the extraction and remove the password protection
- Use your favorite SCP client, such as WinSCP, to upload the PFX file to
/home/<username>/
(replace<username>
withfriend/ec2-user/azureuser
) on the Database using credentials for the<username>
on your platform i.e.,<username>
asfriend
on VMware, Citrix, and Nutanix,ec2-user
on AWS, andazureuser
on Azure. - Use your favorite SSH client, such as Windows 10 Command Prompt or PuTTY, to connect and log in using the credentials for
<username>
and run: -
Copy
sudo bash
- to obtain
root
access. When prompted, enter the password for your<username>
. - Copy the new certificate to
ssl.cert.new
(replaceYOURCERTNAME
with name of uploaded file): -
Copy
cp /home/$(logname)/YOURCERTNAME /home/$(logname)/ssl.crt.new
- If you have uploaded a PEM format certificate along with a separate key file, copy the key to
ssl.key.new
(replaceYOURKEYNAME
with name of uploaded key). -
Note: PFX files should contain the key, so for PFX skip this step and go to the next step for extracting the cert and key from the PFX.
-
Copy
cp /home/$(logname)/YOURKEYNAME /home/$(logname)/ssl.key.new
- For a PFX file, complete the following sub-steps. If the certificate is already in PEM format, skip to the next numbered step.
- Export the certificate from the PFX file by running the following command:
Note: You’ll be prompted for the password if the file is protected.
- Copy
openssl pkcs12 -in /home/$(logname)/ssl.crt.new -clcerts -nokeys -out /home/$(logname)/ssl.crt.extract
- Export the private key file from the PFX file:
Note: You’ll be prompted for the password if the file is protected.
- Copy
openssl pkcs12 -in /home/$(logname)/ssl.crt.new -nocerts -nodes -out /home/$(logname)/ssl.key.new
- Remove the passphrase from the private key (if needed):
- Copy
openssl rsa -in /home/$(logname)/ssl.key.new -out /home/$(logname)/ssl.key.new
- If there are no errors, move
ssl.crt.extract
back intossl.crt.new
. - Copy
mv /home/$(logname)/ssl.crt.extract /home/$(logname)/ssl.crt.new
/bin/cp /var/lib/pgsql/current/data/server.crt /var/lib/pgsql/current/data/server.crt.backup
/bin/cp /var/lib/pgsql/current/data/server.key /var/lib/pgsql/current/data/server.key.backup
/bin/cp /home/$(logname)/server.crt.new /var/lib/pgsql/current/data/server.crt
/bin/cp /home/$(logname)/server.key.new /var/lib/pgsql/current/data/server.key
chown postgres:postgres /var/lib/pgsql/current/data/server.crt
chmod 400 /var/lib/pgsql/current/data/server.crt
chown postgres:postgres /var/lib/pgsql/current/data/server.key
chmod 400 /var/lib/pgsql/current/data/server.key
systemctl restart postgresql-*
systemctl is-active postgresql-*
Scenario 2: Traditional: Generate a Request, Import, and Install an SSL Certificate
In this scenario, Stratusphere administrators will execute a script which prompts the end user for relevant inputs to create a certificate request. After entering information for the generation of the certificate request, the end user must download the certificate request file, send it to the Certifying Authority (CA) to receive the certificate back, and then place it back on the appliance to install it.
Instructions for the Stratusphere Hub & Collector Appliances
- Use your favorite SSH client, such as Windows 10 Command Prompt or PuTTY, to connect and log in to the Stratusphere Hub appliance or Collector using the credentials for
<username>
on your platform i.e.,<username>
asfriend
on VMware, Citrix, and Nutanix,ec2-user
on AWS, andazureuser
on Azure. The default password issspassword
. - Obtain root access by executing:
-
Copy
sudo bash
- When prompted, enter the password for your
<username>
. - Execute the following command to begin the process of collecting details for the certificate request:
-
Copy
/opt/lwl/bin/createcsr.sh
- The script will prompt for the following items (press Enter to accept defaults within […]):
- Country Name (2 letter code)
[US]:
- State of Province Name (full name)
[Georgia]:
- Locality Name (e.g., city)
[Alpharetta]:
- Organization Name (e.g., company)
[Liquidware, Inc.]:
- Common Name (e.g., server FQDN or YOUR name)
[lwl]: hub.domain.com
- Alternative DNS names (comma separated list)
[lwl]: hub1.domain.com, hub2.domain.com
- The script will then generate the request and display the location where it is stored:
- Copy
Generating request...
Request can be found here: /var/tmp/lwlreq.VhyY.csr. Contents are:
-----BEGIN CERTIFICATE REQUEST-----
MIIC1DCCAbwCAQAwXTELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB0dlb3JnaWExEzAR
BgNVBAcMCkFscGhhcmV0dGExGTAXBgNVBAoMEExpcXVpZHdhcmUsIEluYy4xDDAK
BgNVBAMMA2x3bDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANnK3M6H
PBcTfyvMJKVy+T0bNC28c6iKESTAeiWiYUK73MFld9UKX1XIELesxJapFZfpbVaG
qt0uXnK4cgyGdsLuWjsDTP66BHRsclBnWwNt93RJAttqblML7ug7xQPdoHTE7TH7
J3YrCkGcJsHT1laxgZlHaJzIt7QMmE81W3c0AFyLu82OOsIXrkGvoefi1G4HWxl9
F6qUQ61YhMppJvv+LWI76bc05+DB/cpR7KqvX+r6fmwoEp0vlAD63xBgoTP/kZ1z
e1v44hDZ8f2uIAAqURt6ZsYv64yq9Us6ev7JfJSGdU2NkfoNpeIPF09kq3wzgNHH
y00LK08Bpdjnm8ECAwEAAaAyMDAGCSqGSIb3DQEJDjEjMCEwHwYDVR0RBBgwFoIJ
aG9zdG5hbWUxgglob3N0bmFtZTIwDQYJKoZIhvcNAQELBQADggEBAIt+0MN0h6/w
rKfvy3PH3XtkJpgHjiK3HsjAFCjtn+RBGSFo/oSFXjPk77ECk5cZo7RRk1I+aGbO
gCV9A8TmPcVV9JwBSpAY6+pu9Ss/HYd+MkfdBZ3rZWicL1D0LZzGuDiuLek4iHEu
rqtmqfoz9oXD3wa//AY0DzYFa/h9Xo3m79St1owCOKowYL8W/KQMYKHJnV4YxlBO
whseGnqR4GcnpyGbl7nJt1wVmXKgCABYYN5KvJbZ58UjJtCIYyn1mZxHbMvCzguU
hkLU8FvF3ZB4+JSfWDJuHBySnLh5WLr9CBjXRgxG/MRj58oGv2G0PZz+pfPLCj2A
buySxtt9h1A=
-----END CERTIFICATE REQUEST-----
This file can be copied off or the contents pasted to obtain a certificate
- Country Name (2 letter code)
- The certificate request is generated in the following location with a
.csr
extension: -
Copy
/var/tmp/<certrequest>.csr
- Enter the following to change ownership of the file so that it is accessible using the
<username>
on the platform (e.g.,friend
orec2-user
orazureuser
user). -
Copy
chown $(logname):$(logname) /var/tmp/<certrequest>.csr
- Use your favorite SCP client, such as WinSCP or similar software, to connect to the appliance using its IP or DNS address, with SCP protocol and connecting to Port 22 using the credentials of the platform
<username>
(e.g.,friend
orec2-user
orazureuser
user) to download this certificate request from/var/tmp/<certrequest>.csr
file to your local desktop. - Provide this certificate request file to your security provider or Certifying Authority and request that they provide the SSL Certificate specifically in base64 / PEM / CER format. For these instructions, we will call the SSL Certificate file
YOURCERTNAME
. When you see references toYOURCERTNAME
in this document, you should substitute the actual name of the SSL Certificate file you received from your security provider or Certifying Authority. -
Important: Pause here until you receive your SSL certificate from your provider, then complete the process using the following instructions.
- Use your favorite SCP client, such as WinSCP or similar software, to connect to the appliance using its IP or DNS address, with SCP protocol and connecting to Port 22 using the credentials of the platform
<username>
(e.g.,friend
orec2-user
orazureuser
user) to upload thesslcert.crt
SSL Certificate file to your Stratusphere Hub or Collector in the/home/<username>/sslcert.crt
location. - Now back within your SSH client window on the Stratusphere Hub console, while still logged in as the
root
user, make a copy the original SSL certificate as a backup: -
Copy
cp /etc/lwl/ssl/ssl.crt /etc/lwl/ssl/ssl.crt.backup
- Copy the new certificate into
/etc/lwl/ssl/
(updateYOURCERTNAME
with the name of your certificate) -
Copy
cp /home/$(logname)/YOURCERTNAME /etc/lwl/ssl/ssl.crt
- Update ownership and permissions of the certificate and key:
-
Copy
chown root:root /etc/lwl/ssl/ssl.crt
chmod 644 /etc/lwl/ssl/ssl.crt
restorecon -RF /etc/lwl/ssl
- Restart the Web Server to load the newly added SSL Certificate.
-
Copy
systemctl restart httpd
- Check that httpd is running:
-
Copy
systemctl is-active httpd
- If the above command restarts with no errors, the new certificate has been accepted by the web server. Using your browser of choice, log in to the Stratusphere Hub Web UI. Ensure that the UI Login page shows no certificate related warning. Also verify the information within the certificate provided by the browser address bar.
Instructions for the Stratusphere Database Appliance
- Use your favorite SSH client, such as Windows 10 Command Prompt or PuTTY, to connect and log in to the Stratusphere Database appliance local console using the credentials for
<username>
on your platform i.e.,<username>
asfriend
on VMware, Citrix, and Nutanix,ec2-user
on AWS, andazureuser
on Azure. The default password issspassword
. - Obtain root access by executing:
-
Copy
sudo bash
- When prompted, enter the password for your
<username>
. - Execute the following command to begin the process of collecting details for the certificate request:
-
Copy
/opt/lwl/bin/createcsr.sh
- The script will prompt for the following items (press Enter to accept defaults within […]):
- Country Name (2 letter code)
[US]:
- State of Province Name (full name)
[Georgia]:
- Locality Name (e.g., city)
[Alpharetta]:
- Organization Name (e.g., company)
[Liquidware, Inc.]:
- Common Name (e.g., server FQDN or YOUR name)
[lwl]: db.domain.com
- Alternative DNS names (comma separated list)
[lwl]: db1.domain.com, db2.domain.com
- The script will then generate the request and display the location where it is stored:
- Copy
Generating request...
Request can be found here: /var/tmp/lwlreq.VhyY.csr. Contents are:
-----BEGIN CERTIFICATE REQUEST-----
MIIC1DCCAbwCAQAwXTELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB0dlb3JnaWExEzAR
BgNVBAcMCkFscGhhcmV0dGExGTAXBgNVBAoMEExpcXVpZHdhcmUsIEluYy4xDDAK
BgNVBAMMA2x3bDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANnK3M6H
PBcTfyvMJKVy+T0bNC28c6iKESTAeiWiYUK73MFld9UKX1XIELesxJapFZfpbVaG
qt0uXnK4cgyGdsLuWjsDTP66BHRsclBnWwNt93RJAttqblML7ug7xQPdoHTE7TH7
J3YrCkGcJsHT1laxgZlHaJzIt7QMmE81W3c0AFyLu82OOsIXrkGvoefi1G4HWxl9
F6qUQ61YhMppJvv+LWI76bc05+DB/cpR7KqvX+r6fmwoEp0vlAD63xBgoTP/kZ1z
e1v44hDZ8f2uIAAqURt6ZsYv64yq9Us6ev7JfJSGdU2NkfoNpeIPF09kq3wzgNHH
y00LK08Bpdjnm8ECAwEAAaAyMDAGCSqGSIb3DQEJDjEjMCEwHwYDVR0RBBgwFoIJ
aG9zdG5hbWUxgglob3N0bmFtZTIwDQYJKoZIhvcNAQELBQADggEBAIt+0MN0h6/w
rKfvy3PH3XtkJpgHjiK3HsjAFCjtn+RBGSFo/oSFXjPk77ECk5cZo7RRk1I+aGbO
gCV9A8TmPcVV9JwBSpAY6+pu9Ss/HYd+MkfdBZ3rZWicL1D0LZzGuDiuLek4iHEu
rqtmqfoz9oXD3wa//AY0DzYFa/h9Xo3m79St1owCOKowYL8W/KQMYKHJnV4YxlBO
whseGnqR4GcnpyGbl7nJt1wVmXKgCABYYN5KvJbZ58UjJtCIYyn1mZxHbMvCzguU
hkLU8FvF3ZB4+JSfWDJuHBySnLh5WLr9CBjXRgxG/MRj58oGv2G0PZz+pfPLCj2A
buySxtt9h1A=
-----END CERTIFICATE REQUEST-----
This file can be copied off or the contents pasted to obtain a certificate
- Country Name (2 letter code)
- The certificate request is generated in the following location with a .csr extension:
-
Copy
/var/tmp/<certrequest>.csr
- Enter the following to change ownership of the file so that it is accessible using the
<username>
on the platform (e.g.,friend
orec2-user
orazureuser
user). -
Copy
chown $(logname):$(logname) /var/tmp/<certrequest>.csr
- Use your favorite SCP client, such as WinSCP or similar software, to connect to the appliance using its IP or DNS address, with SCP protocol and connecting to Port 22 using the credentials of the platform
<username>
(e.g.,friend
orec2-user
orazureuser
user) to download this certificate request from the/var/tmp/<certrequest>.csr
file to your local desktop. - Provide this certificate request file to your security provider or Certifying Authority and request that they provide the SSL Certificate specifically in base64 / PEM / CER format. For these instructions, we will call the SSL Certificate file dbsslcert.crt. When you see references to
server.crt
in this document, you should substitute the actual name of the SSL Certificate file you received from your security provider or Certifying Authority. -
Important: Pause here until you receive your SSL certificate from your provider, then complete the process using the following instructions.
- Use your favorite SCP client, such as WinSCP or similar software, to connect to the appliance using its IP or DNS address, with SCP protocol and connecting to Port 22 using the credentials of the platform
<username>
(e.g.,friend
orec2-user
orazureuser
user) to upload theserver.crt
SSL Certificate file to your Stratusphere Hub in the/home/<username>/server.crt
location. - Now back within your SSH client window on the Stratusphere Database local console, while still logged in as the
root
user, make a copy the original SSL certificate as a backup: -
Copy
cp /var/lib/pgsql/current/data/server.crt /var/lib/pgsql/current/data/server.crt.backup
- Copy the new certificate into /var/lib/pgsql/current/data/ (update YOURCERTNAME with the name your certificate):
-
Copy
cp /home/friend/YOURCERTNAME /var/lib/pgsql/current/data/server.crt
- Update ownership and permissions of the certificate and key:
-
Copy
chown postgres:postgres /var/lib/pgsql/current/data/server.crt
chmod 644 /var/lib/pgsql/current/data/server.crt
- Restart the database server to load the newly added SQL Certificate:
-
Copy
systemctl restart postgresql-*
- Check that postgresql is running:
-
Copy
systemctl is-active postgresql-*
- If the postgresql service starts without displaying any errors, then the new certificate has been accepted.