Lesson 7 of 8 AWS KMS and AWS CloudHSM

Using Dedicated HSMs with AWS CloudHSM

This lesson explains how AWS CloudHSM provides single-tenant hardware security modules in your VPC, for workloads that need HSMs under the customer's exclusive control with direct cryptographic APIs.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish CloudHSM from AWS KMS.
  • Identify typical uses of CloudHSM.
  • Describe how a CloudHSM key store lets KMS-integrated services use CloudHSM keys.

CloudHSM characteristics

AWS CloudHSM provides hardware security modules (HSMs) dedicated to a single customer. Unlike AWS KMS, where AWS operates multi-tenant HSMs and manages the keys' lifecycle on the customer's behalf, CloudHSM gives the customer exclusive control of the HSMs and the keys in them. AWS cannot access the keys, and if the customer loses the credentials of the HSM users, the keys cannot be recovered. CloudHSM suits requirements such as single-tenant hardware, standard cryptographic interfaces for existing applications, or custom key stores for KMS. The following list describes its characteristics.

  • Single-tenant HSMs validated at FIPS 140-3 Level 3, in a cluster in your VPC.
  • You manage HSM users and keys; AWS manages the hardware and cannot access your keys.
  • Applications use PKCS#11, JCE, OpenSSL and CNG/KSP interfaces.
  • Clusters should run at least two HSMs in different Availability Zones; backups are encrypted and managed by AWS.
Sort into groups

AWS KMS or AWS CloudHSM?

Exam skills 5.2.1

Decide whether each requirement points to KMS or CloudHSM.

Log in to try this activity Interactive activities are free with an account.

Typical uses

AWS CloudHSM provides dedicated, single-tenant hardware security modules (HSMs) that you control, with standard interfaces such as PKCS #11, JCE and OpenSSL. It suits applications that need direct HSM access rather than the KMS API. Web servers can use it for TLS offload, keeping their private keys in the HSM. Oracle and SQL Server use it to hold transparent data encryption (TDE) master keys. It supports code and document signing with keys that never leave the HSM, and it can hold the private keys of your own certificate authority. The following table summarises these uses.

UseExample
TLS offloadWeb servers keep private keys in the HSM
Database encryptionOracle TDE and SQL Server TDE master keys
Code and document signingSigning with keys that never leave the HSM
Certificate authoritiesPrivate CA keys held in your own HSM

CloudHSM key stores

A CloudHSM key store, a KMS custom key store, lets KMS-integrated services such as S3 and EBS use keys generated and held in your CloudHSM cluster. The keys do not rotate automatically, and the cluster must have enough HSMs available for KMS to use them.

The following diagram shows the two ways clients use one CloudHSM cluster: directly, and through a KMS custom key store.

One CloudHSM cluster serving two kinds of client. Oracle TDE uses the HSMs directly through PKCS#11, while S3 uses KMS keys created in a custom key store whose material is generated and kept in the cluster. The bank manages HSM users and capacity; AWS manages the hardware and cannot access the keys.
TDE stands for Transparent Data Encryption.
True or false

CloudHSM key stores

Exam skills 5.2.1 · 5.3.5

Check how a CloudHSM key store works with KMS.

Log in to try this activity Interactive activities are free with an account.
Worked example

An HSM-backed key store for S3

A bank must use keys in single-tenant FIPS 140-3 Level 3 HSMs for its Oracle databases and also for S3 encryption. It creates a CloudHSM cluster with HSMs in two Availability Zones and connects it to KMS as a custom key store:

aws cloudhsmv2 create-cluster --hsm-type hsm2m.medium --subnet-ids subnet-0a subnet-0b
aws cloudhsmv2 create-hsm --cluster-id cluster-0abc --availability-zone eu-west-1a
aws cloudhsmv2 create-hsm --cluster-id cluster-0abc --availability-zone eu-west-1b

aws kms create-custom-key-store --custom-key-store-name bank-hsm \
  --cloud-hsm-cluster-id cluster-0abc --key-store-password "$KMSUSER_PASSWORD" \
  --trust-anchor-certificate file://customerCA.crt
aws kms connect-custom-key-store --custom-key-store-id cks-5678

Oracle TDE uses the HSMs directly through PKCS#11, while S3 uses KMS keys created in the custom key store, whose material is generated and kept in the cluster. The bank manages HSM users and capacity; AWS manages the hardware and cannot access the keys.

Check yourself

Across how many Availability Zones should a CloudHSM cluster run?

Show answer

At least two, so the keys stay available if one zone fails.

Exam Tips

Remember for the exam

  • For a dedicated, single-tenant HSM with full control for custom applications, use CloudHSM.
  • For KMS-integrated services using keys in your own HSM cluster, use a CloudHSM key store.
  • Run CloudHSM clusters across at least two Availability Zones.
  • AWS cannot access keys in CloudHSM.
  • CloudHSM supports PKCS#11, JCE, OpenSSL and CNG/KSP.