Skip to Content
Asterrr's Handbook
5 · Data protection

AWS CloudHSM and KMS comparison

Single-tenant HSM clusters you control, when to pick CloudHSM over KMS, and the custom key stores (CloudHSM and external) that let AWS services use that key material.

Exam tasks: 5.2.1 (choose between CloudHSM and KMS), 5.3.2 (import and remove key material, external key stores)

The decision: where must the key material be created, where must it live, who can destroy it, and how much availability and operational work are you willing to take on to get that control?

CloudHSM gives you single-tenant HSMs in a cluster inside your VPC. You hold the keys and the user management. AWS manages provisioning, patching and backups but cannot see your keys.

Your VPCPKCS#11 / JCEGenerateDataKeykeys live hereApp with HSMclientCloudHSM clusterKMS custom keystoreS3 or EBS viaKMS key
A CloudHSM cluster spans AZs in your VPC. Applications talk to it through the client SDK. A KMS custom key store can front it so AWS services use those keys.
24 hours
Validity of the wrapping key and import token from GetParametersForImport.
2 HSMs, 2 AZs
Minimum CloudHSM cluster for a KMS CloudHSM key store.
10
Custom key stores per account per Region, CloudHSM and external combined.
35 ms
Recommended maximum round trip between the Region and an external key manager.

Which one to use

AWS runs itYou run it
  1. KMS, AWS generated
    origin AWS_KMS

    KMS creates, stores, rotates and backs up the material in its multi-tenant FIPS 140-3 Level 3 HSMs. You control the policy.

  2. KMS, imported (BYOK)
    origin EXTERNAL

    You generate the material and import a copy. You can expire or delete it instantly, and you keep the master copy.

  3. CloudHSM key store
    origin AWS_CLOUDHSM

    KMS keys whose material lives in a CloudHSM cluster you own. Single-tenant, still works with AWS services.

  4. External key store (XKS)
    origin EXTERNAL_KEY_STORE

    Material never enters AWS. Every encrypt and decrypt goes to your key manager outside AWS.

  5. CloudHSM direct
    PKCS#11, JCE, CNG

    Your application talks to the HSM itself. No KMS integration with AWS services.

yesnoyesyesno, app uses PKCS 11,JCE, TDE, SSL offloadnoyesnoRequirement about keymaterialMaterial must never existinside AWS?External key storeSingle-tenant HSM that youadminister?AWS services such as S3,EBS, RDS must use the key?CloudHSM keystore in KMSCloudHSM clusterdirectlyMust generate materialyourself, delete itinstantly, or hold themaster copy?Imported key materialKMS generatedkey
Decision tree for the ladder of control
KMS standardCloudHSM key storeExternal key storeCloudHSM direct
TenancyMulti-tenant HSMsSingle-tenantYour own systemSingle-tenant
Works with S3, EBS, RDS...YesYesYesNo
Material inside AWSYesYes, in your clusterNoYes, in your cluster
Who keeps it availableAWSYou (cluster size, AZs)You (proxy, network, HSM)You
RotationAutomatic or on demandManual onlyIn your key managerYou script it

KMS vs CloudHSM

KMSCloudHSM
TenancyMulti-tenant managed serviceSingle-tenant HSMs
ValidationFIPS 140-3 Security Level 3FIPS 140-2 or 140-3 Level 3 in FIPS mode clusters
Key controlPolicy-based, IAM integratedYou own users, keys and algorithms. Outside IAM for the data plane
Access methodAWS APIPKCS#11, JCE, CNG, KSP, OpenSSL engines
High availabilityBuilt inYou add HSMs across AZs in a cluster
AWS service integrationNativeVia KMS custom key store, or your own application
Use forDefault encryptionDedicated HSM rule, custom algorithms, TDE for self-managed databases, PKI signing
  • A CloudHSM cluster lives in your VPC. Clients connect from instances in the VPC, over VPN or Direct Connect for on-premises.
  • CloudHSM management API calls are recorded in CloudTrail.

Exam signal

"Dedicated, single-tenant HSM" or "customer must control and be the only one with access to key material" means CloudHSM. Encrypting RDS or S3 with those keys means a KMS custom key store on CloudHSM.

CloudHSM clusters

  • A cluster of single-tenant HSMs in your VPC, FIPS 140-3 Level 3 validated. AWS manages the hardware, patching and backups; you manage HSM users, keys and policies. AWS can't see or recover your keys.
  • Put at least two HSMs in different Availability Zones. Keys synchronise across the cluster, and a lone HSM is a single point of failure.
  • CloudHSM takes automatic encrypted backups at least once a day. You can copy backups to another Region for DR.
  • Users on the HSM: admins manage users; crypto users create and use keys. Lose all admin credentials and nobody, including AWS, can recover access.
  • Access is through the client SDK: PKCS#11, JCE, OpenSSL Dynamic Engine, and KSP/CNG on Windows.
Signal in the questionWhy CloudHSM
Oracle TDE or SQL Server TDE on EC2 with an HSM-held master keyDatabases integrate through PKCS#11 or EKM, not KMS
TLS offload on web servers with the private key in an HSMNGINX, Apache or IIS integration
Root key of a Windows or self-run certificate authorityCNG or PKCS#11
Contract requires single-tenant HSM and customer-only adminOnly you hold HSM admin credentials
Symmetric algorithms or key types KMS doesn't offerDirect HSM API

FIPS alone doesn't mean CloudHSM

KMS HSMs are already FIPS 140-3 validated, and KMS offers FIPS endpoints. "Must use FIPS-validated cryptography" is satisfied by KMS. Choose CloudHSM only when the question adds single tenancy, customer-exclusive control, or an interface such as PKCS#11.

Exam trap

AWS services such as S3 and EBS call KMS, not CloudHSM. To use HSM keys with them, put a KMS custom key store in front. Your data plane is end-to-end encrypted and invisible to AWS, so you carry the user management burden.

KMS custom key stores

CloudHSM key store

  • KMS keys whose material is generated and kept in your CloudHSM cluster. KMS calls the cluster as a special crypto user named kmsuser.
  • The cluster must have at least two active HSMs in different AZs before KMS can connect.
  • Supports symmetric encryption keys only. No automatic or on-demand rotation, no imported material, no multi-Region keys.
  • AWS services integrate exactly as with any customer managed key. Every use also appears in the HSM audit logs.
  • If the cluster loses its HSMs or you disconnect the key store, the keys become unavailable until you fix it.

External key store (XKS)

  • KMS keys backed by a key manager outside AWS: an on-premises HSM, another cloud, or a vendor service. KMS never sees your external key.
  • KMS talks to an XKS proxy that you run, over a public endpoint or a VPC endpoint service (preferred when you want traffic off the internet).
  • Double encryption: KMS encrypts with its own per-key material, then your key manager encrypts again, so neither side alone can decrypt.
  • Disconnect the key store (or cut the proxy) and every dependent AWS resource loses access to its keys. This is the "kill switch" some sovereignty regulations demand.
  • You own availability, latency (aim for a round trip under 35 ms to the Region) and durability. Symmetric keys only, and no rotation of the KMS key itself.

Scenarios

Scenario
A European insurer must prove to its regulator that it can make all of its data in Amazon S3 and Amazon EBS unreadable to AWS at any moment, and that the key material never resides in AWS. The insurer runs a certified HSM cluster in its own data centres. What should a security engineer implement?
Scenario
A retailer runs Oracle Database Enterprise Edition on EC2 and must keep the TDE master encryption key in a single-tenant HSM that only the retailer's staff administer. What should the retailer use?

Further reading

On this page