Chapter 3. Encryption and Key Management
The Red Hat Ceph Storage cluster typically resides in its own network security zone, especially when using a private storage cluster network.
Security zone separation might be insufficient for protection if an attacker gains access to Ceph clients on the public network.
There are situations where there is a security requirement to assure the confidentiality or integrity of network traffic, and where Red Hat Ceph Storage uses encryption and key management, including:
- SSH
- SSL Termination
- Encryption in Transit
- Encryption at Rest
3.1. SSH
All nodes in the Red Hat Ceph Storage cluster use SSH as part of deploying the cluster. This means that on each node:
-
A
cephadm
user exists with password-less root privileges. - The SSH service is enabled and by extension port 22 is open.
-
A copy of the
cephadm
user’s public SSH key is available.
Any person with access to the cephadm
user by extension has permission to run commands as root
on any node in the Red Hat Ceph Storage cluster.
Additional Resources
-
See the How
cephadm
works section in the Red Hat Ceph Storage Installation Guide for more information.
3.2. SSL Termination
The Ceph Object Gateway may be deployed in conjunction with HAProxy and keepalived
for load balancing and failover. The object gateway Red Hat Ceph Storage versions 2 and 3 use Civetweb. Earlier versions of Civetweb do not support SSL and later versions support SSL with some performance limitations.
The object gateway Red Hat Ceph Storage version 5 uses Beast. You can configure the Beast front-end web server to use the OpenSSL library to provide Transport Layer Security (TLS).
When using HAProxy and keepalived
to terminate SSL connections, the HAProxy and keepalived
components use encryption keys.
When using HAProxy and keepalived
to terminate SSL, the connection between the load balancer and the Ceph Object Gateway is NOT encrypted.
See Configuring SSL for Beast and HAProxy and keepalived for details.
3.3. Messenger v2 protocol
The second version of Ceph’s on-wire protocol, msgr2
, has the following features:
- A secure mode encrypting all data moving through the network.
- Encapsulation improvement of authentication payloads, enabling future integration of new authentication modes.
- Improvements to feature advertisement and negotiation.
The Ceph daemons bind to multiple ports allowing both the legacy v1-compatible, and the new, v2-compatible Ceph clients to connect to the same storage cluster. Ceph clients or other Ceph daemons connecting to the Ceph Monitor daemon uses the v2
protocol first, if possible, but if not, then the legacy v1
protocol is used. By default, both messenger protocols, v1
and v2
, are enabled. The new v2 port is 3300, and the legacy v1 port is 6789, by default.
The messenger v2 protocol has two configuration options that control whether the v1 or the v2 protocol is used:
-
ms_bind_msgr1
- This option controls whether a daemon binds to a port speaking the v1 protocol; it istrue
by default. -
ms_bind_msgr2
- This option controls whether a daemon binds to a port speaking the v2 protocol; it istrue
by default.
Similarly, two options control based on IPv4 and IPv6 addresses used:
-
ms_bind_ipv4
- This option controls whether a daemon binds to an IPv4 address; it istrue
by default. -
ms_bind_ipv6
- This option controls whether a daemon binds to an IPv6 address; it istrue
by default.
The ability to bind to multiple ports has paved the way for dual-stack IPv4 and IPv6 support.
The msgr2
protocol supports two connection modes:
crc
-
Provides strong initial authentication when a connection is established with
cephx
. -
Provides a
crc32c
integrity check to protect against bit flips. - Does not provide protection against a malicious man-in-the-middle attack.
- Does not prevent an eavesdropper from seeing all post-authentication traffic.
-
Provides strong initial authentication when a connection is established with
secure
-
Provides strong initial authentication when a connection is established with
cephx
. - Provides full encryption of all post-authentication traffic.
- Provides a cryptographic integrity check.
-
Provides strong initial authentication when a connection is established with
The default mode is crc
.
Ceph Object Gateway Encryption
Also, the Ceph Object Gateway supports encryption with customer-provided keys using its S3 API.
To comply with regulatory compliance standards requiring strict encryption in transit, administrators MUST deploy the Ceph Object Gateway with client-side encryption.
Ceph Block Device Encryption
System administrators integrating Ceph as a backend for Red Hat OpenStack Platform 13 MUST encrypt Ceph block device volumes using dm_crypt
for RBD Cinder to ensure on-wire encryption within the Ceph storage cluster.
To comply with regulatory compliance standards requiring strict encryption in transit, system administrators MUST use dmcrypt
for RBD Cinder to ensure on-wire encryption within the Ceph storage cluster.
Additional resources
- See the Connection mode configuration options in the Red Hat Ceph Storage Configuration Guide for more details.
3.4. Encryption in transit
Starting with Red Hat Ceph Storage 5 and later, encryption for all Ceph traffic over the network is enabled by default, with the introduction of the messenger version 2 protocol. The secure
mode setting for messenger v2 encrypts communication between Ceph daemons and Ceph clients, providing end-to-end encryption.
You can check for encryption of the messenger v2 protocol with the ceph config dump
command, netstat -Ip | grep ceph-osd
command, or verify the Ceph daemon on the v2 ports.
Additional resources
- See the SSL Termination for details on SSL termination.
- See the S3 server-side encryption for details on S3 API encryption.
3.5. Encryption at Rest
Red Hat Ceph Storage supports encryption at rest in a few scenarios:
-
Ceph Storage Cluster: The Ceph Storage Cluster supports Linux Unified Key Setup or LUKS encryption of Ceph OSDs and their corresponding journals, write-ahead logs, and metadata databases. In this scenario, Ceph will encrypt all data at rest irrespective of whether the client is a Ceph Block Device, Ceph Filesystem, or a custom application built on
librados
. - Ceph Object Gateway: The Ceph storage cluster supports encryption of client objects. When the Ceph Object Gateway encrypts objects, they are encrypted independently of the Red Hat Ceph Storage cluster. Additionally, the data transmitted is between the Ceph Object Gateway and the Ceph Storage Cluster is in encrypted form.
Ceph Storage Cluster Encryption
The Ceph storage cluster supports encrypting data stored in Ceph OSDs. Red Hat Ceph Storage can encrypt logical volumes with lvm
by specifying dmcrypt
; that is, lvm
, invoked by ceph-volume
, encrypts an OSD’s logical volume, not its physical volume. It can encrypt non-LVM devices like partitions using the same OSD key. Encrypting logical volumes allows for more configuration flexibility.
Ceph uses LUKS v1 rather than LUKS v2, because LUKS v1 has the broadest support among Linux distributions.
When creating an OSD, lvm
will generate a secret key and pass the key to the Ceph Monitors securely in a JSON payload via stdin
. The attribute name for the encryption key is dmcrypt_key
.
System administrators must explicitly enable encryption.
By default, Ceph does not encrypt data stored in Ceph OSDs. System administrators must enable dmcrypt
to encrypt data stored in Ceph OSDs. When using a Ceph Orchestrator service specification file for adding Ceph OSDs to the storage cluster, set the following option in the file to encrypt Ceph OSDs:
Example
... encrypted: true ...
LUKS and dmcrypt
only address encryption for data at rest, not encryption for data in transit.
Ceph Object Gateway Encryption
The Ceph Object Gateway supports encryption with customer-provided keys using its S3 API. When using customer-provided keys, the S3 client passes an encryption key along with each request to read or write encrypted data. It is the customer’s responsibility to manage those keys. Customers must remember which key the Ceph Object Gateway used to encrypt each object.
Additional Resources
- See S3 API server-side encryption in the Red Hat Ceph Storage Developer Guide for details.