Appendix C. Using Databases Over SSL
Unbound CASPUnbound’s Crypto Asset Security Platform (“CASP”) provides the advanced
technology and the architecture to secure crypto asset transactions. can use PostgreSQL or MySQL (installed via RDS) over SSL
Secure Sockets Layer - a cryptographic protocol that provides communications security over a computer network.. The following instructions explain how to set up the environment.
C.1 RDS PostgreSQL Over SSL
C.1.1 Step 1: Create an RDS parameter group
- In the RDS console, create new parameter groups.
- In the RDS console, click Parameter groups.
- Click Create parameter group.
- In the screen that opens, enter a group name and description. The Parameter group family should be set to postgres9.6.
- Click Create.
- Click the name of your parameter group.
- Click Edit parameters.
- Under Parameters, search for rds.force_ssl.
- Change this parameter value to 1.
- Click Save changes.
C.1.2 Step 2: Update your RDS instance
- Find your RDS instance, then click on the name.
- Click Modify.
- In the Database options section, change the DB parameter group to the one created above.
- Click Continue at the bottom of the screen.
- Reboot the instance by clicking Actions, then Reboot.
C.1.3 Step 3: Configure PostgreSQL
Update the PostgreSQL configuration. See the Amazon documentation for more information.
- Log into PostgreSQL on your RDS server.
- Update the configuration by running each of the following commands.
- Exit the RDS server.
For example:
psql -h server.us-east-1.rds.amazonaws.com -p 5432 -U sa -d casp
create extension sslinfo;
select ssl_is_used();
select ssl_cipher();
C.1.4 Step 4: Configure SSL
- Try and log into your RDS server.
- Download the certificate:
- Copy the certificate into the PostgreSQL folder.
psql -h server.us-east-1.rds.amazonaws.com -p 5432 -U sa -d casp
You get an error message like this one:
psql: FATAL: no pg_hba.conf entry for host "18.208.181.219", user "sa", database "casp", SSL off
wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
sudo cp rds-combined-ca-bundle.pem /root/.postgresql/root.crt
C.1.5 Step 5: Configure CASP
Update the CASP configuration file.
- In casp.conf, locate the PostgreSQL database URL line.
- Add “?ssl=true” to the URL.
- Restart CASP
Unbound’s Crypto Asset Security Platform (“CASP”) provides the advanced technology and the architecture to secure crypto asset transactions..
For example:
database.url=jdbc:postgresql://localhost:5432/casp
For example:
database.url=jdbc:postgresql://localhost:5432/casp?ssl=true
sudo service casp.tomcat restart
C.1.6 Step 6: Check the SSL connection
Log into the RDS server.
psql -h server.us-east-1.rds.amazonaws.com -p 5432 -U sa -d casp
The response looks like:
psql (11.2, server 9.6.3)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
casp=>
You are now successfully logged into PostgreSQL on your RDS server using an SSLSecure Sockets Layer - a cryptographic protocol that provides communications security over a computer network. connection.
C.2 RDS MySQL Over SSL
Unbound CASPUnbound’s Crypto Asset Security Platform (“CASP”) provides the advanced
technology and the architecture to secure crypto asset transactions. can use MySQL (installed via RDS) over SSL
Secure Sockets Layer - a cryptographic protocol that provides communications security over a computer network.. The following instructions explain how to set up the environment.
C.2.1 Step 1: Configure the certificate
- Download the certificate.
- Convert the certificate format from pem to der.
- Add the certificate to the security/cacerts folder for Java via keytool.
wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
openssl x509 -outform der -in rds-combined-ca-bundle.pem -out rds-combined-ca-bundle.der
sudo keytool -import -alias rds-combined-ca-bundle -keystore <JAVA HOME>/lib/security/cacerts -file rds-combined-ca-bundle.der
Enter keystore password: <Keystore Password>
Trust this certificate? [no]: yes
C.2.2 Step 2: Configure CASP
Update the CASP configuration file.
- In casp.conf, locate the MySQL database URL line.
- Add the SSL
Secure Sockets Layer - a cryptographic protocol that provides communications security over a computer network. flags to the URL.
- Restart CASP
Unbound’s Crypto Asset Security Platform (“CASP”) provides the advanced technology and the architecture to secure crypto asset transactions..
For example:
database.url=jdbc:mysql://localhost:3306/casp
For example:
database.url=jdbc:mysql://<SERVER NAME:3306/casp?useSSL=true
If you have an in-house CA and/or domain verification is required:
database.url=jdbc:mysql://<SERVER NAME:3306/casp?useSSL=true&verifyServerCertificate=true&trustCertificateKeyStorePassword=<Keystore Password>
sudo service casp.tomcat restart
C.2.3 Step 3: Check the SSL connection
Log into the RDS server.
mysql -h <SERVER NAME> -p5432 -u sa casp --ssl-ca=rds-combined-ca-bundle.pem --ssl-mode=VERIFY_IDENTITY
After logging in, execute \s
to view the connection parameters. Verify that the SSL
field shows that a cipher is in use.Secure Sockets Layer - a cryptographic protocol that provides communications security over a computer network.
The response looks like:
MySQL [casp]> \s
--------------
mysql Ver 15.1 Distrib 10.2.18-MariaDB, for Linux (x86_64) using readline 5.1
Connection id: 667
Current database: casp
Current user: sa@31.154.180.82
SSL: Cipher in use is AES256-SHA
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MySQL
Server version: 8.0.15 Source distribution
Protocol version: 10
Connection: servername.rds.amazonaws.co via TCP/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 2 hours 8 min 6 sec
Threads: 3 Questions: 6587 Slow queries: 0 Opens: 1078 Flush tables: 2 Open tables: 488 Queries per second avg: 0.857
You are now successfully logged into MySQL on your RDS server using an SSLSecure Sockets Layer - a cryptographic protocol that provides communications security over a computer network. connection.