Cloud HSM - Architecture and high availability
Understand how OVHcloud Cloud HSM works, from clusters, partitions and endpoints to access control, high availability, failover and service limits
Beta version — Cloud HSM is currently in beta. Features, interfaces and procedures may change until general availability (GA), and this guide will be updated along with them. To find out more about the beta or to request access, visit the Cloud HSM page on OVHcloud Labs.
Objective
Cloud HSM is OVHcloud's managed key custody service. Your cryptographic keys are created and stored in partitions dedicated to you on HSM (Hardware Security Module) hardware, and your applications use them to encrypt, decrypt, sign and verify through the PKCS#11 standard. You never operate the HSM hardware yourself.
This guide explains how Cloud HSM is built, how your applications reach it, how access is controlled, and how the service behaves when part of the infrastructure becomes unavailable.
Instructions
Key concepts
Cloud HSM is currently built on Thales Luna HSMs, and every partition runs in FIPS mode. The model and vendor of each partition are shown in the details of your cluster.
Cluster topology by region
The three partitions of a cluster are always on three different physical HSMs, but their location depends on the type of region you choose:
- 3-AZ regions: each partition is in a different availability zone (AZ) of the region, and each one has its own endpoint.
- 1-AZ regions: two partitions are in the region's single AZ, each with its own endpoint. The third partition is a backup partition, hosted in a predefined remote region. It has no endpoint: your applications cannot reach it directly.
You cannot choose or move the partitions of a cluster: OVHcloud defines their placement.
How your applications access Cloud HSM
Your applications load the OVHcloud PKCS#11 driver, which connects to one or more endpoints of your cluster over the public Internet, on port 5697. Traffic is encrypted with TLS; the endpoints present a certificate issued by a public certification authority, so no custom CA bundle is needed on your side.
Private network access (VPC endpoint) is not available during the beta.
Authentication and authorisation with OVHcloud IAM
Every request carries an OVHcloud IAM token, which identifies the caller, and the ID of the cluster it targets. You can use either:
- a Personal Access Token (PAT) of an OVHcloud IAM local user;
- an OAuth2 access token obtained with an OVHcloud service account.
Before running any operation, Cloud HSM checks with OVHcloud IAM that the caller is authorised to perform it on the cluster. Each type of PKCS#11 operation maps to an IAM action (cloudHSM:pkcs11:sign, cloudHSM:pkcs11:decrypt, etc.), so you can grant each application only the operations it needs. If IAM cannot be reached to authorise a request, the request is refused.
The administrator of the OVHcloud account holds every right on its clusters. To give access to other identities, create IAM policies: see the "Authorisation with OVHcloud IAM" section of the "Installing and configuring the Cloud HSM PKCS#11 driver" guide for the list of actions and example policies.
An identity authorised on a cluster can use any endpoint of that cluster: choosing an endpoint is a matter of locality and availability, not of access control.
IP allowlist
You can restrict the source IP addresses allowed to reach your cluster with an IP allowlist of up to 100 IPv4 or IPv6 ranges. When the list is empty, any address is allowed. A change applies within 30Â seconds, including to connections that are already open.
The allowlist checks the source address of the TCP connection as seen by Cloud HSM. If your applications reach the Internet through a NAT gateway, allow the public address of the gateway, not the private addresses of your machines.
To set it up, see the "Step 3: Restricting access by IP address" section of the "Getting started with Cloud HSM" guide.
Key custody
Keys created in Cloud HSM are generated and stored inside the HSMs, and private and secret key material is never revealed in plaintext: reading it through PKCS#11 returns CKR_ATTRIBUTE_SENSITIVE.
- Exporting a key: a key can leave the HSM only wrapped (encrypted under another key), and only if it is extractable (
CKA_EXTRACTABLEset toCK_TRUE). To make sure a key can never leave the HSM, create it withCKA_EXTRACTABLEset toCK_FALSE, or set it toCK_FALSElater: this change cannot be undone. The partitions do not export private keys. - Importing a key: import your existing secret and private keys wrapped, with
C_UnwrapKey. Public keys can also be imported in plaintext.
See the "Wrapping and unwrapping keys" section of the "Installing and configuring the Cloud HSM PKCS#11 driver" guide for the supported mechanisms and their constraints.
OVHcloud does not offer key backup, export or recovery outside the service: the keys of a cluster live in its partitions only. Deleting a cluster deletes its keys.
High availability and failover
OVHcloud replicates your keys between the partitions of your cluster. You do not configure or manage replication: a key created through one endpoint can be used through every endpoint of the cluster.
Failover happens on the client side, in the PKCS#11 driver: Cloud HSM has no single entry point that redirects your requests. If an endpoint becomes unavailable:
- The driver reconnects to the next endpoint configured, without closing your PKCS#11 sessions.
- It automatically re-sends the requests that change nothing: signature, verification, encryption, decryption, wrapping, search and attribute reads.
- A key creation, deletion or change that was in progress fails: your application must check whether it took effect before retrying it. Your keys remain valid.
Configure every endpoint of your cluster in the driver, so that it can switch to the next one when an endpoint does not answer. See the "Configuring several endpoints" section of the "Installing and configuring the Cloud HSM PKCS#11 driver" guide.
In a 1-AZ region, both reachable partitions are in the same AZ. If that AZ becomes unavailable, your cluster has no reachable endpoint until the AZ is restored. Your keys are not lost: the backup partition in the remote region keeps a copy of them.
Endpoints also close connections during normal operation: an idle connection is closed after 10Â minutes, and every connection is renewed after about one hour. The driver reconnects transparently in these cases. If a firewall or a NAT gateway silently drops an idle connection, the next request waits for the driver timeout (Timeout, 30Â seconds by default), then fails with CKR_DEVICE_ERROR, without being re-sent: set the idle timeout of these devices above 10Â minutes.
Consistency of changes
A key you create can be used immediately through every endpoint of the cluster. A key you delete or modify is updated immediately on the endpoint that served the request, but the other endpoints may keep serving its previous state for about 30Â seconds:
- a deleted key can still be used through another endpoint during that time;
- a key whose
CKA_EXTRACTABLEattribute you have just set toCK_FALSEcan still be exported, wrapped, through another endpoint during that time; - other attribute changes (label, usages,
CKA_ID) may also take that long to show on the other endpoints.
Take this delay into account in your procedures, for example when you delete a key you believe to be compromised.
Capacity
Cloud HSM sets no limit on the number of keys or the number of sessions. The throughput of a cluster depends on the HSM hardware: as an indication, it is in the order of 1,000 RSA-2048 operations per second.
Each request is limited in size: an operation can process at most 1 MiB − 16 KiB (1,032,192 bytes) of data. For larger data, use envelope encryption: encrypt the data with a data key in your application, and encrypt only the data key with Cloud HSM.
Limits of the beta
During the beta, the following are not available:
- Service Level Agreement (SLA);
- private network access (VPC endpoint);
- forwarding of Cloud HSM logs to Logs Data Platform.
The PKCS#11 limits (unsupported functions and mechanisms) are listed in the "Known limits" section of the "Installing and configuring the Cloud HSM PKCS#11 driver" guide.
Shared responsibilities
OVHcloud operates the HSM hardware, maintains the service and replicates your keys between the partitions of your cluster. You manage your keys, the access rights to your clusters and the integration of your applications, including switching to another endpoint when one becomes unavailable.
The detailed split of responsibilities is described in Cloud HSM - Shared responsibilities.
Go further
Getting started with Cloud HSM
Installing and configuring the Cloud HSM PKCS#11 driver
How to configure a Personal Access Token (PAT)
Join our community of users.