Lesson 6 of 8 AWS KMS and AWS CloudHSM

Keeping Key Material Outside AWS with External Key Stores

This lesson explains how an external key store (XKS) keeps key material in your own key manager outside AWS while AWS services still use KMS APIs, for regulations that require keys never to reside with the cloud provider.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how an external key store works through a proxy.
  • Identify the responsibilities and trade-offs of an external key store.
  • Decide when an external key store is justified.

How an external key store works

Some regulations require that encryption keys are kept outside the cloud provider's infrastructure. An external key store (XKS) meets this requirement: the key material stays in a hardware security module or key manager that the customer operates outside AWS, and KMS asks that key manager to perform every cryptographic operation. The trade-off is that the customer becomes responsible for availability and latency, because KMS operations fail whenever the external key manager is unreachable. The following list describes how it operates.

  • KMS keys in the store reference keys held in your external key manager.
  • Each encrypt and decrypt request is sent by KMS through an XKS proxy that you operate, to your key manager.
  • Because every request depends on your systems, you can refuse AWS's ability to decrypt at any time ("hold your own key").
  • AWS services integrated with KMS use these keys like any other customer managed key.

The following diagram follows a cryptographic operation to the agency's key manager.

An external key store for keys that must never reside with AWS. S3 and EBS use the KMS key like any customer managed key, but every cryptographic operation goes through the XKS proxy, over a VPC endpoint service, to the agency's key manager, which can refuse at any time. An outage there stops every dependent service.
XKS stands for external key store.
True or false

External key stores

Exam skills 5.3.2

Check how an external key store works.

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

Responsibilities and trade-offs

An external key store (XKS) keeps key material in your own key manager outside AWS, reached through a proxy, which satisfies rules requiring keys to stay under your physical control. The cost is that you take on responsibilities AWS normally carries. For availability, if the proxy or key manager is down, every AWS service using those keys fails. For latency, each cryptographic operation travels to your infrastructure and back. For durability, if the external key is lost, the data is lost, with no recovery by AWS. For connectivity, the proxy is reached over the internet or through a VPC endpoint service. XKS therefore suits only workloads with a firm regulatory need. The following table summarises the trade-offs.

AspectConsequence
AvailabilityIf the proxy or key manager is unavailable, every service using the keys fails
LatencyEach cryptographic operation crosses to your infrastructure
DurabilityLosing the external key loses the data
ConnectivityThe proxy is reached over the internet or through a VPC endpoint service
Scenario questions

Imported material, XKS or AWS-generated?

Exam skills 5.3.2 · 5.3.3

Choose the KMS key material option for each requirement.

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

When to choose XKS

External key stores are for the strictest sovereignty requirements, where keys must stay entirely outside AWS. For most organisations, KMS keys with AWS-generated or imported material give strong control with far less operational burden.

Worked example

Keys that must never be in AWS

A government agency requires that encryption keys never reside with the cloud provider and that the agency can refuse decryption at any time. The architect deploys an XKS proxy in front of the agency's key manager and creates an external key store:

aws kms create-custom-key-store --custom-key-store-name agency-xks \
  --custom-key-store-type EXTERNAL_KEY_STORE \
  --xks-proxy-connectivity VPC_ENDPOINT_SERVICE \
  --xks-proxy-vpc-endpoint-service-name com.amazonaws.vpce.eu-west-1.vpce-svc-0xks \
  --xks-proxy-uri-endpoint https://xks.agency.example \
  --xks-proxy-uri-path /kms/xks/v1 \
  --xks-proxy-authentication-credential AccessKeyId=XKSAUTHKEYID,RawSecretAccessKey=REDACTED
aws kms create-key --origin EXTERNAL_KEY_STORE --custom-key-store-id cks-1234 \
  --xks-key-id agency-key-01

S3 and EBS encrypt with this key like any other customer managed key, but every operation reaches the agency's key manager. The agency designs the proxy and key manager for high availability, because an outage there stops every service that uses the key.

Check yourself

What does an external key store let you do that other KMS keys do not?

Show answer

Keep keys outside AWS entirely and refuse AWS's decryption requests at any time, through an XKS proxy you operate.

Exam Tips

Remember for the exam

  • When keys must never reside in AWS, use an external key store (XKS).
  • XKS requests pass through an XKS proxy you operate.
  • With XKS, you can refuse AWS's decryption requests at any time.
  • XKS availability becomes the availability of every service using it.
  • KMS-integrated services use XKS keys like other customer managed keys.