Join our Newsletter — 33% off our NHI Course
Home› Guides› Cloud Customer-Managed Keys and BYOK/HYOK Decision Guide: Choosing…
Guide Cloud Security

Cloud Customer-Managed Keys and BYOK/HYOK Decision Guide: Choosing the Right Key Control Model

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 15 min read
On this page

Every major cloud encrypts data at rest by default, so the real decision is not whether to encrypt but who controls the keys, and each step towards more control adds cost, operational burden and a new way to lose your own data. Teams are pushed towards customer-managed keys, bring your own key (BYOK) and hold your own key (HYOK) by auditors, sovereignty concerns and contracts, often without a clear view of what each model actually protects against. This guide sets out the five key control models available on AWS, Microsoft Azure and Google Cloud, what threat each one addresses, what it costs in availability and performance, and how to choose and roll out the right model per workload. It is written for cloud security architects, cryptography and key management owners, and risk and compliance leads who must justify the choice. For the mechanics of each provider's key service, see the linked KMS guides.

Key takeaways

  • Customer-managed keys are the sensible default for regulated data: they give you key policy, rotation, audit logs and the ability to revoke access or crypto-shred, at modest cost and with no availability penalty.
  • BYOK proves where key material came from, not who can use it: imported material still runs inside the provider's HSMs, and AWS states that ciphertext from a symmetric KMS key cannot be decrypted outside KMS even with imported material.
  • HYOK through an external key manager is the only model where the provider cannot decrypt without you, and AWS states plainly that for most workloads the availability and performance risks exceed the perceived security benefit.
  • Choose per data class, not per organisation: provider keys for low-risk data, CMK for most regulated data, single-tenant HSM or external keys only where a regulation or contract explicitly demands it.
  • Losing the key is losing the data: revoking an external key, letting imported material expire or destroying a key version makes ciphertext unrecoverable, so key availability belongs in your resilience plan.

The key control models

The vocabulary differs by provider, but the models line up. The table compares them in increasing order of customer control.

ModelAWSMicrosoft AzureGoogle CloudWho holds key material
1. Provider-owned keysAWS owned keysMicrosoft-managed keysGoogle-owned and Google-managed encryption keys (default)Provider, invisible to you
2. Provider-managed keys in your accountAWS managed keys (aws/<service> aliases)Platform-managed keysNot offered as a separate tierProvider, visible but not configurable
3. Customer-managed keys (CMK)Customer managed keys, origin AWS_KMSCustomer-managed keys in Key Vault or Managed HSMCMEK in Cloud KMS (software or HSM protection)Provider HSMs, under your policy
4. BYOK and single-tenant HSMImported material (origin EXTERNAL) or CloudHSM key store (AWS_CLOUDHSM)BYOK import into Key Vault Premium or Managed HSMImported key versions; Cloud HSMGenerated by you, then held in provider HSMs
5. HYOK and external key managersExternal key store (EXTERNAL_KEY_STORE) via an XKS proxyExternal key management (Managed HSM); Double Key Encryption for Microsoft 365 contentCloud EKM (EXTERNAL or EXTERNAL_VPC protection levels)Your key manager, outside the provider

On AWS you can check which model a key uses with aws kms describe-key: KeyManager is CUSTOMER or AWS, and Origin is one of AWS_KMS, EXTERNAL, AWS_CLOUDHSM or EXTERNAL_KEY_STORE. For service-level detail see the AWS KMS Security Guide, the Azure Key Vault Security Guide and the Google Cloud KMS Guide.

What each model protects against

Encryption at rest in the cloud protects against a narrow set of threats. Being precise about them stops teams paying for HYOK to solve a problem that IAM solves.

Threat or requirementProvider keysCMKBYOK / single-tenant HSMHYOK / external
Stolen physical media at the providerYesYesYesYes
Compromised workload identity with decrypt rightsNoNo (the identity can still decrypt)NoNo
Over-broad storage permissions in your accountNoPartly: key policy is a second authorisation layerPartlyPartly
Separation of duties between data and key adminsNoYesYes (Managed HSM local RBAC cannot be overridden by subscription admins)Yes
Evidence of key use for auditNo (AWS owned keys are not visible in CloudTrail)YesYesYes, plus logs in your own key manager
Crypto-shredding on customer exit or incidentNoYesYes (delete imported material)Yes (revoke or delete the external key)
Proof of key material provenance (generated in your HSM)NoNoYesYes
Provider compelled or unable to decrypt without youNoNoNoYes, for data at rest; data being processed is still in plaintext in the provider's memory unless confidential computing is used

Two points are often missed. First, most real cloud data breaches come from compromised identities or misconfigured access, and no key model stops a principal that is allowed to call decrypt. Second, a CMK key policy is itself an access control: requiring both s3:GetObject and kms:Decrypt means a mistaken bucket policy alone does not expose the data. That second-layer effect is the strongest practical argument for CMK, and it does not need BYOK or HYOK. See the Encryption Buyer's Guide for evaluating key management products.

Cost, availability and performance trade-offs

Provider documentation is unusually frank about the costs of moving down the table. AWS describes the standard KMS key store as FIPS 140-3 Level 3 validated with a public SLA of 99.999%, the highest transaction rates and the lowest latency. CloudHSM key stores and external key stores have no SLA coverage, and AWS describes external key stores as having "the lowest TPS and highest latency of all key store options", suitable for low-throughput uses such as EBS or RDS encryption. AWS also states that custom key stores are not more secure than the standard key store.

  • CMK: a monthly fee per key plus per-request charges on AWS; no change in availability because the provider runs the HSMs. Automatic rotation is available for symmetric keys (default 365 days on AWS, set with RotationPeriodInDays).
  • BYOK with imported material: same performance and SLA as the standard store on AWS, but no automatic rotation (on-demand rotation by importing new material is possible for symmetric keys), and you must keep a durable copy of the material. You can set an expiry on imported material, after which the key stops working until you reimport it.
  • Single-tenant HSM: you own cluster sizing, availability and durability (AWS CloudHSM), or the security domain and its recovery (Azure Managed HSM). Lose the security domain backup and quorum, and the keys go with it.
  • External key managers: every decrypt that is not served from a service's data key cache depends on your key manager, your proxy and the network path. AWS recommends placing external key store components in the Region with a round-trip time of 35 ms or less to the key manager and strongly recommends CloudWatch alarms on the store. Google warns that unavailable external keys can make dependent services fail, for example GKE nodes that cannot decrypt secrets, and that Spanner automatically deletes a database whose CMEK key stays unavailable for more than 30 consecutive days.
  • Feature loss: AWS external key stores support only symmetric keys and do not support imported material, automatic rotation or multi-Region keys. Microsoft Double Key Encryption content cannot be used by eDiscovery, content search, Office for the web, mail flow rules or Copilot, and Microsoft positions it for roughly 5% of data, the most sensitive.

Choosing a model: decision guidance

Work through the questions in order and stop at the first model that meets the requirement. Microsoft describes external key management for Managed HSM as a last resort for legal or contractual custody requirements, and AWS states that external key stores are not recommended unless there is "an explicit and unchangeable requirement to keep key material outside AWS".

  1. Is the data regulated, contractually protected or business critical? If not, provider-owned keys are adequate. Do not create CMKs for test buckets and logs nobody will ever need to crypto-shred.
  2. Do you need separation of duties, key-use audit, revocation or crypto-shredding? Use CMK. This is the answer for most regulated workloads, including most PCI DSS, health and financial data.
  3. Does a regulator, contract or customer require proof that key material was generated in your own HSM, or that keys sit in a single-tenant HSM? Use BYOK into the standard store, or a single-tenant HSM where tenancy itself is required (AWS CloudHSM key store, Azure Managed HSM); on Google Cloud, check the current Cloud HSM tenancy options against the requirement. Prefer BYOK into the standard store on AWS where the requirement is provenance rather than tenancy.
  4. Is there an explicit requirement that the provider must be technically unable to decrypt data at rest without you, for example to address foreign legal access concerns? Use HYOK with an external key manager, scoped to the specific datasets, and pair it with confidential computing if data in use is also in scope. For the sovereignty context, see the Data Sovereignty and Residency Guide and the EU Sovereign Cloud Options Compared Guide.

Small versus large organisations: a small team should almost always stop at CMK with a handful of keys per environment; running an external key manager with redundant proxies and on-call cover is a full-time capability. Large and regulated organisations often run all three tiers: provider keys for low-risk data, CMK by default for regulated data enforced by policy, and a small, well-justified HYOK estate for the datasets that need it.

Enforcing the choice with policy

A key model that depends on every engineer picking the right option at resource creation will drift. Each provider offers preventive guardrails.

ProviderGuardrailEffect
Google Cloudconstraints/gcp.restrictNonCmekServices (Deny list of services)Resource creation in listed services fails without a Cloud KMS key, and CMEK cannot be removed
Google Cloudconstraints/gcp.restrictCmekCryptoKeyProjects (Allow list of projects or folders)CMEK keys may come only from approved key projects; Google notes you need both constraints to enforce CMEK
Google CloudCloud KMS AutokeyCreates keys on demand at resource creation and grants service agents the required roles, in a dedicated key project or the same project
AWSKey policy and condition keys such as kms:RotationPeriodInDays; service control policies requiring a KMS key on create callsConstrains who can use and administer keys and which rotation periods are allowed
AzureAzure Policy definitions that require customer-managed keys on supported services; Managed HSM local RBACAudits or denies resources without CMK; separates HSM administrators from subscription owners

Google notes that CMEK organisation policies apply only to newly created resources, so existing resources need a separate migration plan. For organisation-wide guardrails on AWS, see the AWS Organizations and SCPs Guide.

Implementation and rollout

  1. Classify data and map it to models: agree the data classes and the key model per class with risk and legal, using the decision questions above. Record the requirement that justifies anything beyond CMK. See the Data Classification Guide.
  2. Design the key hierarchy: decide key granularity (per application, per environment, per tenant if you need per-customer crypto-shredding), key projects or accounts, administrators versus users, and naming. Keep key administration in a separate account or project from the data.
  3. Pilot in audit mode: on one non-production workload, create CMKs, set policies, and run guardrails in audit mode (Azure Policy audit effect, a dry run of the Google constraints on a test folder) to see which resources would fail.
  4. Test failure before you depend on it: disable the key in the pilot and confirm the service fails the way you expect, then re-enable it and confirm recovery. For external keys, take the proxy or key manager offline and measure what breaks and how long caches last.
  5. Roll out by data class: enforce CMK for new regulated resources first, then migrate existing resources (many services need re-creation or a copy to change keys). Only then build any HYOK estate, with redundant key manager instances and connectivity.
  6. Rollback: keep scheduled deletion windows long (AWS allows 7 to 30 days; use 30) so a mistaken deletion can be cancelled, keep provider-key fallbacks for non-regulated data, and never destroy old key versions until all data encrypted under them has been re-encrypted or is no longer needed.

Detection and measurement

  • Key administration events: alert on key policy changes, disabling a key, ScheduleKeyDeletion, deleting imported key material, key version destruction in Cloud KMS, and Managed HSM role assignment changes.
  • Unusual key use: spikes in decrypt calls from one principal, decrypts from new networks or accounts, and cross-account key use not in your design.
  • External key health: proxy health (AWS GetHealthStatus returns Active, Degraded or Unavailable), latency, error rates such as FAILED_PRECONDITION in Google Cloud, and key manager justification logs where Key Access Justifications are used.
  • Customer-supplied encryption you did not plan: write calls that specify a customer-provided key, which on AWS means SSE-C; deny it where it is not needed.

Metrics: percentage of regulated resources encrypted with CMK (target 100%); number of keys without an owner tag; keys with rotation disabled where it is supported; key administrators who can also read the data; mean time to detect a key policy change; and for HYOK, measured availability of the external key path against the workload's own target.

Framework mapping

RequirementNIST SP 800-53 Rev. 5NIST CSF 2.0ISO/IEC 27001:2022CIS Controls v8.1
Key generation, storage, rotation, destructionSC-12, SC-13PR.DS-01A.8.243.11
Key availability and recoverySC-12(1), CP-9, CP-10PR.DS-11A.8.13, A.8.2411
Encryption of data at restSC-28, SC-28(1)PR.DS-01A.8.243.11
Provider reliance and contractsSA-9, SR-3GV.SC-07, GV.OC-03A.5.2315
Key use logging and reviewAU-2, AU-6DE.CM-09A.8.158

Common failure patterns

  • Choosing HYOK for a threat it does not address: the risk was a leaked access key or an open bucket, which any principal with decrypt rights defeats regardless of where the key lives.
  • Key administrators who are also data users: the same role can change the key policy and read the data, so CMK adds audit trail but no separation of duties.
  • Imported key material that silently expires or is not backed up: the expiry date passes, or the only copy was on a decommissioned HSM, and every resource under the key becomes unreadable. Set expiry alarms and store the material under dual control.
  • External key manager treated as a normal dependency: one proxy, one network path and no on-call cover. A routine certificate expiry on the proxy takes production databases offline.
  • Policy applied only to new resources: organisation policy enforces CMK from today, and years of existing data stay on provider keys without anyone noticing.
  • Customer-supplied keys left open to attackers: features designed for customers to supply their own keys can be used by an attacker with write access to encrypt your data under a key only they hold.

Lessons from incidents

The Codefinger S3 ransomware campaign in January 2025 is the clearest illustration that key control cuts both ways. Using stolen long-lived AWS keys with S3 read and write permissions, the attacker re-encrypted objects with SSE-C, server-side encryption with customer-provided keys, using an AES-256 key the attacker generated. AWS does not store SSE-C keys, so victims without a separate backup could not recover the data, which maps to ATT&CK T1486 Data Encrypted for Impact. No key model would have stopped a principal allowed to write objects; what would have helped was temporary credentials instead of long-lived keys, denying SSE-C where it is not used, and independent backups. The lesson for this decision: any model in which a key lives outside the provider's control, yours or an attacker's, makes recovery depend entirely on that key's availability. See the Cloud Ransomware Guide.

Practitioner checklist

  • Each data class has a documented key model, and anything beyond CMK cites the specific regulation, contract or customer requirement.
  • Regulated resources use customer-managed keys, enforced by organisation policy or Azure Policy, with existing resources tracked for migration.
  • Key administrators and data users are different roles, and key projects or accounts are separate from data accounts.
  • Automatic rotation is enabled where supported, and imported or external keys have a documented manual rotation process.
  • Scheduled deletion windows are set to the maximum, and alerts fire on disable, delete and policy change events.
  • Imported key material has a durable, dual-controlled backup and an expiry alarm.
  • Any external key manager has redundant instances, redundant connectivity, health alarms and an on-call owner, and its failure has been tested.
  • Customer-supplied encryption options such as SSE-C are denied where they are not used.
  • Recovery plans cover key loss explicitly, including Managed HSM security domain recovery and CloudHSM cluster backups.

Standards and references

Related NHI Mgmt Group resources: BYOK, HYOK and External Key Management Guide · Cryptographic Key Management Guide · Encryption Buyer's Guide · Confidential Computing Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.