Prompt
What should I use for customer-managed encryption keys in SaaS?
Latest observation
Oct 23, 2026
OpenAI APIWeb search: off
For SaaS, the most common and practical choice for customer-managed encryption keys (CMEK) is:
Recommended default
Use a cloud KMS with per-tenant or per-customer keys, rather than managing raw keys yourself.
Examples:
- AWS KMS
- Google Cloud KMS / Cloud EKM
- Azure Key Vault / Managed HSM
This gives you:
- centralized key governance
- audit logs
- rotation support
- access control policies
- HSM-backed protection
- simpler compliance story
Typical SaaS pattern
A strong default design is:
- Data encryption key (DEK) encrypts tenant data
- Key encryption key (KEK) in KMS encrypts/wraps the DEK
- Store only the wrapped DEKs in your DB
- Optionally use:
- one key per tenant
- one key per environment
- one key per customer region
For many SaaS products, per-tenant keys is the cleanest CMEK model.
When to choose what
Use cloud KMS if you want:
- easiest operational model
- compliance-friendly setup
- integration with cloud services
- customer-managed permissions
- key rotation and revocation
Use external/HSM-backed KMS if you need:
- stricter separation of duties
- customer-controlled keys outside your cloud
- compliance regimes requiring external key custody
- hybrid/multi-cloud portability
Avoid managing keys yourself unless you must
Don’t roll your own key storage, rotation, or encryption primitives. It increases risk a lot.
Important SaaS design choices
1. Decide who controls the keys
- SaaS-managed keys: you operate them
- Customer-managed keys: customer can revoke or control access
- Customer-owned external keys: customer keeps keys in their own HSM/KMS
2. Decide revocation behavior
If a customer disables or revokes their key:
- you should be able to render their data unreadable
- define whether service becomes read-only, unavailable, or deleted
3. Separate metadata from payload
Usually you encrypt:
- sensitive payloads
- backup blobs
- exports
- attached files
You may not need to encrypt all metadata with customer keys unless required.
4. Plan for rotation
Support:
- automatic rotation
- manual key rotation
- re-wrapping DEKs
- legacy data decryption with old key versions
If you want a simple recommendation
If you’re building a typical cloud SaaS:
- use AWS KMS / GCP KMS / Azure Key Vault
- implement envelope encryption
- use per-tenant CMEK
- store DEKs encrypted by the tenant’s KMS key
- support key rotation and revocation
If you want, I can also give you:
- a reference architecture,
- a per-tenant key design, or
- a comparison of AWS vs GCP vs Azure CMEK for SaaS.