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.
Which one to use
- KMS, AWS generatedorigin 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.
- 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.
- CloudHSM key storeorigin AWS_CLOUDHSM
KMS keys whose material lives in a CloudHSM cluster you own. Single-tenant, still works with AWS services.
- External key store (XKS)origin EXTERNAL_KEY_STORE
Material never enters AWS. Every encrypt and decrypt goes to your key manager outside AWS.
- CloudHSM directPKCS#11, JCE, CNG
Your application talks to the HSM itself. No KMS integration with AWS services.
| KMS standard | CloudHSM key store | External key store | CloudHSM direct | |
|---|---|---|---|---|
| Tenancy | Multi-tenant HSMs | Single-tenant | Your own system | Single-tenant |
| Works with S3, EBS, RDS... | Yes | Yes | Yes | No |
| Material inside AWS | Yes | Yes, in your cluster | No | Yes, in your cluster |
| Who keeps it available | AWS | You (cluster size, AZs) | You (proxy, network, HSM) | You |
| Rotation | Automatic or on demand | Manual only | In your key manager | You script it |
KMS vs CloudHSM
| KMS | CloudHSM | |
|---|---|---|
| Tenancy | Multi-tenant managed service | Single-tenant HSMs |
| Validation | FIPS 140-3 Security Level 3 | FIPS 140-2 or 140-3 Level 3 in FIPS mode clusters |
| Key control | Policy-based, IAM integrated | You own users, keys and algorithms. Outside IAM for the data plane |
| Access method | AWS API | PKCS#11, JCE, CNG, KSP, OpenSSL engines |
| High availability | Built in | You add HSMs across AZs in a cluster |
| AWS service integration | Native | Via KMS custom key store, or your own application |
| Use for | Default encryption | Dedicated 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 question | Why CloudHSM |
|---|---|
| Oracle TDE or SQL Server TDE on EC2 with an HSM-held master key | Databases integrate through PKCS#11 or EKM, not KMS |
| TLS offload on web servers with the private key in an HSM | NGINX, Apache or IIS integration |
| Root key of a Windows or self-run certificate authority | CNG or PKCS#11 |
| Contract requires single-tenant HSM and customer-only admin | Only you hold HSM admin credentials |
| Symmetric algorithms or key types KMS doesn't offer | Direct 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
An external key store keeps the key material in the insurer's HSMs, and disconnecting it cuts AWS off. Imported material is a copy that does reside in AWS. A CloudHSM key store keeps the material in AWS-hosted hardware. SSE-C doesn't exist for EBS, and client-side EBS encryption isn't a native feature.
Oracle TDE on EC2 uses PKCS#11 to reach an HSM, and CloudHSM gives single-tenant hardware administered only by the customer. A KMS key isn't single-tenant and Oracle TDE doesn't call KMS. An external key store puts the key outside AWS, which wasn't asked for, and Oracle still couldn't use it directly. Secrets Manager isn't an HSM.
Related
- KMS keys and envelope encryption
- KMS rotation and imported key material
- KMS vs CloudHSM cheat sheet
- KMS key types and rotation cheat sheet
Further reading
KMS rotation and imported key material
Automatic, on-demand and manual rotation, rotation periods, and bring-your-own-key material compared with KMS-generated material.
TLS on load balancers and CloudFront
SSL offload, re-encryption and passthrough on ELB, plus CloudFront viewer and origin protocol policies, custom certificates and field-level encryption.