Skip to Content
Book a Meeting

Encryption at Rest in the Cloud: From Provider-Managed Keys to HYOK

On This Page

Most organizations running workloads in the cloud rely on encryption at rest as a core security control. Cloud providers market it prominently, compliance frameworks require it, and it is enabled by default almost everywhere. But what does it actually protect against, and where does it stop? This article unpacks the mechanics, the options, and the limits.

The basics

In a previous article, we established a crucial distinction: encryption in transit and encryption at rest, even combined, do not constitute end-to-end encryption. The server can still read your data. We left that point as a warning. This article is where we unpack it.

Encryption at rest is not theater. It aims to protect against real threats: a stolen hard drive, a physical breach of a data center, direct access to storage media outside the normal application stack. These are legitimate risks, and the mechanisms cloud providers have built to address them are robust.

The shared responsibility model: who owns what

To understand why encryption at rest exists, it helps to understand the framework it lives in. Cloud providers operate under what the industry calls the shared responsibility model: security is not solely the provider’s job, nor solely yours. The boundary shifts depending on the service layer, but the principle is consistent across providers.

At the infrastructure level, the provider owns the physical security of data centers, the hypervisor, the storage hardware, and the underlying network. You own your data, your access controls, your application logic, and your configurations.

Encryption at rest sits precisely at that boundary. Its primary purpose is to cover threats within the provider’s own perimeter: a decommissioned disk that was not properly wiped, a physical intrusion into a data center, a storage component accessed outside the normal software stack. In those scenarios, encrypted data on disk is unreadable without the key, and the key is managed separately from the raw storage media.

This framing matters. Once you move outside that perimeter, into the provider’s software stack, into API access, into legal compulsion, encryption at rest was not designed to answer those questions. Understanding exactly where that boundary sits is what the rest of this article is about.

How encryption at rest works mechanically

Beneath the marketing language of every major cloud provider lies a common architectural pattern. Understanding it is a prerequisite for evaluating what any key management option actually gives you.

Data Encryption Keys and Key Encryption Keys

When you store data in the cloud, it is not encrypted with a single key. Instead, providers use a layered key hierarchy: the data is encrypted with a Data Encryption Key (DEK), and that DEK is itself encrypted with a Key Encryption Key (KEK), sometimes called a wrapping key. The KEK is managed separately, inside a dedicated Key Management Service (KMS).

This layering exists for a practical reason: key rotation becomes a metadata operation. To rotate a KEK, you re-encrypt the DEK with the new key. You do not touch the underlying data, which could be petabytes in size.

Where keys live

In the default configuration across all three major providers, DEKs are generated and managed automatically. The KEKs are managed by the provider’s KMS, backed by hardware security modules (HSMs) that ensure key material never exists in plaintext outside a protected hardware boundary.

This is a real guarantee against certain threats. An attacker who compromises a storage backend gets encrypted data and encrypted DEKs, neither of which is usable without access to the KMS.

But the KMS itself is part of the provider’s infrastructure. Which means the provider, under the right circumstances, can access it. That is not a flaw in the implementation. It is a consequence of the architecture.

The KMS layer: what it does and what it doesn’t

A Key Management Service is, at its core, a hardened system for generating, storing, rotating, auditing, and controlling access to cryptographic keys. All three major providers offer one: AWS KMS, Google Cloud KMS, and Azure Key Vault. But the KMS does not have to come from the same provider as your storage: specialized vendors like Thales or Fortanix offer KMS solutions that integrate with any of the major cloud platforms, and become particularly relevant in BYOK and HYOK configurations. Their feature sets are broadly comparable, and they all rely on HSM-backed infrastructure to ensure key material is protected at the hardware level.

What KMS gives you is real. Key lifecycle management (creation, rotation, expiration, deletion) is handled through a controlled, auditable interface. Every key operation can be logged. Access to keys can be scoped through fine-grained policies. For most organizations, this represents a material improvement over managing keys manually.

But there is a structural limit that no KMS feature can address: the provider operates the KMS on your behalf. The HSMs, the access control policies, the audit logs, all of it runs on infrastructure the provider controls. This means the provider retains, at minimum, the operational capability to access key material, even if their contractual and internal policies prohibit it.

This is not merely a theoretical concern. It has concrete implications in at least two scenarios.

The first is legal compulsion. A court order or national security letter served to a US-based provider (and AWS, Google, and Microsoft are all US-based entities, regardless of where your data is stored) can require disclosure of key material or decrypted data. The provider cannot protect you from their own legal obligations.

The second is a sophisticated breach. An attacker who compromises the provider’s control plane, not just a storage backend, potentially gains access to the KMS itself. The key hierarchy protects against lower-level compromises, but the KMS is the top of that hierarchy.

These are the limits that the next two sections address, through BYOK and HYOK. Neither fully resolves these limits. But understanding what they actually change, and what they don’t, is the point.

BYOK: more control, more responsibility, and still not enough

All three major providers support Bring Your Own Key, and their implementations share the same foundational properties and the same limitations. The idea is appealing: you generate your own key material, you import it into the provider’s KMS, and you retain control over the master key. If you revoke or delete it, the provider can no longer decrypt your data.

That last point is real, and it matters. BYOK gives you a capability that default provider-managed encryption does not provide: the ability to unilaterally and immediately render your data inaccessible, without depending on the provider to act. For certain regulatory contexts, particularly where data sovereignty or the right to erasure is a hard requirement, this is not trivial.

But BYOK is frequently misunderstood, and the misunderstanding tends to run in one direction: overestimating what it protects against.

Once your key material is imported into the provider’s KMS, whether that KMS belongs to the cloud provider or a third-party vendor, it operates within that infrastructure. The HSM that stores it, the API that uses it, the control plane that governs access to it, all of it belongs to the provider. You generated the key, but you are no longer the only party with operational proximity to it.

What BYOK does not protect you from

A court order served to the provider can compel access to your data or your key material, regardless of who generated the key. The provider’s ability to comply does not disappear because you imported your own key.

A compromise of the provider’s control plane is still a threat. An attacker with sufficient access to the provider’s infrastructure can potentially interact with the KMS, with or without your key material having originated externally.

Revocation is a last resort, not a continuous protection. Between the moment a threat materializes and the moment you revoke the key, your data is accessible. BYOK does not change the attack surface during normal operations.

BYOK is best understood as an operational control and an exit mechanism, not as a confidentiality guarantee against the provider itself. When well implemented, it answers the question “can I ensure my data becomes inaccessible if I leave or if something goes wrong?” more than it answers “can I ensure the provider cannot read my data?”

For teams operating under compliance frameworks like PCI-DSS or certain GDPR interpretations, BYOK may satisfy specific audit requirements around key ownership. That is a legitimate reason to use it. But compliance and security are not the same thing, and BYOK illustrates that gap clearly.

The only configuration that begins to address the provider-as-threat-actor question is one where the key never enters the provider’s infrastructure at all.

HYOK and external KMS: keeping the key outside

Hold Your Own Key takes the BYOK premise to its logical conclusion. Rather than generating a key and importing it into the provider’s KMS, you keep the key material outside the provider’s perimeter entirely, whether in infrastructure you operate yourself or through a specialized third-party KMS provider. The provider’s systems call out to your key management infrastructure to perform cryptographic operations, but the key itself never crosses the boundary.

This is architecturally closer to genuine separation of duties. The provider processes your data but cannot independently access the keys required to decrypt it. A court order served to the provider yields encrypted data they cannot read. A compromise of their control plane does not automatically compromise your key material.

All three providers have built mechanisms to support this model. AWS calls it External Key Store (XKS). GCP offers Cloud External Key Manager (Cloud EKM). Azure supports it through Managed HSM with partner integrations and, in specific Microsoft 365 contexts, through Customer Key with Double Key Encryption.

What it actually changes

The threat model improves in two concrete areas. Legal compulsion directed at the provider no longer automatically results in readable data, because the provider genuinely cannot decrypt it without your cooperation. And a provider-side breach, even at the control plane level, does not yield plaintext data or usable keys.

What it does not change

Your own infrastructure is now in the critical path. If your external KMS is unavailable, your data is inaccessible. Latency increases, because every cryptographic operation requires a call across a boundary. Operational complexity increases significantly: you are now responsible for the availability, security, and compliance of your own key management infrastructure. For most organizations, that is a substantial trade-off.

There is also a subtler point. HYOK addresses the provider as a threat actor, but it does not address the application layer. If the provider’s systems process your data in plaintext before returning results to you, the key separation is real but the confidentiality window is not zero. Depending on the service and how it processes data, there may still be moments where plaintext exists within the provider’s compute environment.

That last point deserves attention. It is the structural limit that no key management configuration, however carefully designed, fully resolves.

Provider-specific nuances worth knowing

AWS, GCP, and Azure all support the full spectrum described in this article, from provider-managed keys to HYOK, including integrations with third-party KMS providers for organizations that prefer to separate their key management from their cloud infrastructure. This separation is meaningful, but as the next sections explain, it does not eliminate every exposure window. Their implementations differ in ways that matter operationally: how HSM-backed options are structured, how external key management integrates with the rest of the platform, how governance policies can be enforced at scale. Azure adds a layer of complexity with its Microsoft 365 / Azure boundary, while GCP stands out for its ability to enforce customer-managed key policies at the organization level.

These differences are real, but they are second-order relative to the structural limits this article has outlined.

A practical note on granularity and cost

In practice, the threat model that encryption at rest addresses does not justify multiplying KEKs. Protecting against physical storage access does not require a separate KEK per file, per record, or even per application. Most deployments settle at a coarser level: one key per bucket, one key per service, sometimes one key per organization. That is not a security shortcut, it is the appropriate response to the actual threat.

The cost implications follow directly. Customer-managed keys are billed per key per month, on top of per-call API charges. Proliferating KEKs without a clear security rationale inflates cost without meaningfully strengthening the protection encryption at rest is designed to deliver.

The fundamental gap

At this point, we have covered a significant amount of ground: the key hierarchy, the KMS layer, BYOK, HYOK, and the provider-specific implementations. It is worth stepping back and asking what all of this actually adds up to.

Each layer adds real value. The DEK/KEK hierarchy limits the blast radius of a storage-level compromise. A well-configured KMS with fine-grained access policies and audit logging reduces the risk of unauthorized key use. BYOK gives you an exit mechanism and satisfies certain compliance requirements around key ownership. HYOK, in its most rigorous implementations, genuinely removes the provider from the decryption path for data at rest.

And yet, there is a property that none of these configurations provide: a guarantee that the provider’s infrastructure never has access to your data in plaintext.

This is not a gap in the implementation, nor does it disappear when using a third-party KMS provider. It is a consequence of the service model. When you store data in the cloud and expect the cloud to process it, serve it, index it, or make it available through an API, that data must at some point exist in a readable form within the provider’s compute environment. The key management layer protects the data on disk. It does not protect the data while it is being used.

This is precisely the gap that end-to-end encryption addresses. With E2EE, the provider never receives plaintext. Data is encrypted before it leaves the client, and decrypted only at the intended recipient. The provider’s infrastructure sees only ciphertext, regardless of what it does with it. A court order, a control plane breach, an insider threat, none of these vectors yield readable data, because the provider was never in possession of it.

The threat models that encryption at rest, even in its most carefully configured forms, cannot answer are exactly the ones E2EE is designed for: the provider as a threat actor, whether through compulsion, compromise, or opacity.

That is not an argument against encryption at rest. It is an argument for being precise about what problem you are solving.

What about client-side encryption?

One concept sits between HYOK and true E2EE and deserves mention: client-side encryption, where data is encrypted before it leaves the client, using keys the client controls. The provider receives and stores only ciphertext. It is a meaningful step beyond HYOK, but it is not end-to-end encryption: key management still often involves the provider’s infrastructure, and the moment data needs to be processed server-side, it must be decrypted within the provider’s environment. A future article in this series will go deeper.

Conclusion

Encryption at rest is a necessary baseline. It addresses real threats within a well-defined perimeter, and the major cloud providers have built genuinely capable tooling to support it. Understanding the DEK/KEK hierarchy, the role of KMS, and the trade-offs between provider-managed keys, BYOK, and HYOK is essential for anyone responsible for data security in a cloud environment.

But this article has traced a consistent thread: each layer of key management sophistication narrows the attack surface without eliminating a fundamental property of the architecture. The provider’s infrastructure remains, at some point in the data lifecycle, in a position to access plaintext. That is not a bug. It is the inevitable consequence of asking a third party to store and process your data on your behalf.

The question worth asking is not “how do we configure encryption at rest to be as strong as possible?” but “what is our actual threat model, and does encryption at rest answer it?”

For many organizations, it does, at least partially. Physical threats, certain compliance requirements, and operational key control are all legitimate concerns that encryption at rest addresses well.

For organizations whose threat model includes the provider itself, whether through legal compulsion, sophisticated breach, or data sovereignty concerns, the honest answer is that no KMS configuration fully closes the gap. The architecture that does is one where the provider never holds plaintext to begin with. The first article in this series introduced the concept. A future article in this series will go further.

Continue the Series

All Resources

Want to discuss these topics?

Get in touch with our team to explore how advanced cryptography can address your security challenges.