It’s been a while since Ceph Rados Gateway (RGW) has built-in support for SSL. In this blog post we will quickly cover how to setup SSL for RGW and adding another layer of security to object storage endpoint without much efforts.
The first ingredient we require to configure SSL endpoint is “SSL Certificate” itself which must be obtained through an official certification authority, or CA. Its CA’s responsibilities to confirm the certificate’s identity as well as assert for its authenticity. For demonstration purpose we will use self-sign certificate, however it’s recommended to acquire SSL certificate through aurhotuzed CA for production usage.
Note: If you already have SSL certificate for your domain you can skip the following steps and edit /etc/ceph/ceph.conf file to configure SSL. If you don’t have one and want to use self-sign certs, keep on reading.
[[email protected] ~]# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ceph-rgw-cert.key -out /etc/ssl/certs/ceph-rgw.crt
Generating a 2048 bit RSA private key
.................+++
..............+++
writing new private key to '/etc/ssl/private/ceph-rgw-cert.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:FI
State or Province Name (full name) []:Espoo
Locality Name (eg, city) [Default City]:Espoo
Organization Name (eg, company) [Default Company Ltd]: HomeLaB
Organizational Unit Name (eg, section) []:storage-testing
Common Name (eg, your name or your server's hostname) []:rgw1
Email Address []:
[[email protected] ~]#
Merge SSL certificate private key with certificate key.