Markdown Editor

Key Management and Secrets Service Design Template (KMS)

KMS and secrets service: HSM root of trust, key hierarchy, envelope encryption with DEK reuse and caching, rotation, SP 800-57 key states, dynamic credentials

System DesignFullNIST SP 800-57 Part 1 Rev. 5 (May 2020); SP 800-38D; FIPS 140-3designsecretskmsmath

How to use: Use it when designing or reviewing an internal key management or secrets service, or preparing the KMS interview question. Fill the KMS call-rate estimate in section 3 first, because one KMS call per object needs far more HSMs than reuse and caching. The main pitfall is treating KMS availability as an operations detail when an outage makes encrypted data unreadable.

Preview

System Design: [Key management and secrets service name]

Reference design for an internal key management service (KMS) and secrets service: a root of trust in hardware security modules (HSMs), a key hierarchy, envelope encryption with data keys, key versions and rotation, key states, a secrets store with leases and dynamic credentials, policy and audit, caching, and multi-region availability. Key lifecycle and cryptoperiods follow NIST SP 800-57 Part 1 Revision 5, "Recommendation for Key Management: Part 1 - General" (May 2020); Revision 6 was released as an initial public draft on 5 December 2025 and is not final as of October 2026. It follows the structure of the System Design Document template, adds a 45-minute interview path, access-pattern and failure-mode tables and a cited "How real systems do it" box, and is pre-filled with a worked design to adapt. Replace every [bracketed] value and every row marked Example; values marked Example are assumptions, not benchmarks. This is a design format, not security certification advice; confirm cryptographic choices with your security team against the current NIST publications.

Document control

FieldValue
Document ID[SDD-KMS-001]
System / feature[Internal KMS and secrets service]
Version[0.1]
Status[Draft / In review / Approved / Implemented / Superseded]
Owner[@owner]
Author(s)[@author]
Reviewers[@reviewer-1], [@reviewer-2]
Last updatedYYYY-MM-DD
Classification[Confidential]
DifficultyAdvanced
Key management basis[NIST SP 800-57 Part 1 Rev. 5 (May 2020); Rev. 6 initial public draft tracked]
HSM validation required[FIPS 140-3 level, per security policy]
Related[Cryptography standard], [Secrets management standard], [ADR: HSM vendor]

Approvals

RoleNameDecisionDate
Tech lead[@name][Approved / Changes requested]YYYY-MM-DD
Security architect[@name][Decision]YYYY-MM-DD
Cryptography reviewer[@name][Decision]YYYY-MM-DD
SRE / operations[@name][Decision]YYYY-MM-DD
Compliance[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft for design review
0.2YYYY-MM-DD[@name]Example: Added data key reuse per writer after HSM sizing showed 120 HSMs for the naive design
0.3YYYY-MM-DD[@name]Example: Added dynamic database credentials to the secrets service
1.0YYYY-MM-DD[@name]Example: Approved

Contents

1. Overview

1.1 Problem statement

[Example: About 3 000 services keep database passwords and API tokens in environment files and deployment variables, rotated by hand once a year at best. Data at rest is encrypted by each storage system with its own static key, so no one can say which keys protect which data, rotate them, or prove who used them. An auditor asked for a key inventory and an access log; we could provide neither.]

1.2 Proposed solution

[Example: A regional KMS holds customer master keys (KEKs) whose key material never leaves HSMs in plaintext. Services encrypt data with data encryption keys (DEKs) generated by the KMS and store each DEK wrapped under a KEK next to the data (envelope encryption). Writers reuse one DEK for at most 5 minutes and readers cache unwrapped DEKs for 5 minutes, so the KMS sees thousands rather than millions of calls per second. KEKs have versions; rotation adds a version for new encryption while old versions still decrypt. A secrets service, encrypted by the same KMS, stores static secrets with versions and issues short-lived dynamic credentials. Workloads authenticate with their platform identity, every operation is authorised by policy and written to an append-only audit log.]

1.3 Decisions requested from reviewers

IDQuestionRecommended optionSection
Q-01Example: One KMS call per object, or data key reuse and caching?Reuse per writer for 5 min; cache unwrapped DEKs for 5 min3.2, 7.2
Q-02Example: What does rotation mean for stored data?New KEK version yearly; re-wrap DEKs, do not re-encrypt data7.3
Q-03Example: Behaviour when the KMS is unreachable?Fail closed for new keys; serve cached DEKs until their TTL7.6
Q-04Example: Static secrets or dynamic credentials for databases?Dynamic credentials with 1 h leases where the database supports it7.5
[Q-nn][Question][Option][Section]

1.4 45-minute interview path

Use this order when the document serves an interview or a short design review. The written sections below are the long form of each step.

MinutesCoverOutput on the whiteboard
0 to 5Scope: keys never leave HSMs, envelope encryption, secrets, audit; below-the-line items (2.3)Three to five requirements
5 to 10Estimates: naive KMS calls, calls with reuse and caching, HSM count (section 3)"Caching cuts 1.2 million calls/s to about 51 000"
10 to 15Interface: GenerateDataKey, Decrypt, GetSecret (section 4)Three calls with their inputs
15 to 25High-level design: API tier, HSM tier, key store, secrets store, audit (section 6)One diagram
25 to 40One deep dive: envelope encryption and caching (default, 7.2), or rotation and key states (7.3, 7.4), or availability versus security (7.6)Options, choice, reason
40 to 45Failures (HSM loss, region loss, key compromise), the 10x row in section 10Two failure rows

Start the default deep dive with the naive answer: send every object to the KMS to encrypt. Show that payload size limits and call volume make that impossible, then introduce envelope encryption, then show that even one KMS call per object is too many and introduce DEK reuse and caching with their limits.

2. Requirements

2.1 Core functional requirements

IDRequirementPriority
FR-01Example: Create, describe, enable, disable and schedule deletion of KEKsMust
FR-02Example: Generate data keys returned in plaintext and wrapped formMust
FR-03Example: Decrypt (unwrap) data keys, bound to an encryption contextMust
FR-04Example: Automatic and on-demand KEK rotation with versionsMust
FR-05Example: Store, version and retrieve static secretsMust
FR-06Example: Issue dynamic database credentials with leasesShould
FR-07Example: Sign and verify with asymmetric keysShould
FR-08Example: Import key material from an external HSM (bring your own key)Could
[FR-nn][Requirement][Must / Should / Could]

2.2 Non-functional requirements

IDQualityTargetMeasured as
NFR-01Key confidentialityExample: KEK and root key material never exists in plaintext outside HSMsDesign review, HSM configuration audit
NFR-02LatencyExample: p99 at or below 10 ms for Decrypt within a regionAPI timing
NFR-03AvailabilityExample: 99.99% per region for decrypt operationsSuccessful responses
NFR-04AuditExample: Every KMS and secret operation logged, tamper-evident, kept 1 yearLog completeness checks
NFR-05DurabilityExample: No loss of any key version that still protects dataBackup restore drill
NFR-06Separation of dutiesExample: No single person can export, delete or restore root key materialQuorum controls, drill
[NFR-nn][Quality][Target][Measurement]

2.3 Below the line (out of scope)

Name these explicitly so reviewers and interviewers do not pull the design toward them.

  • [Example: public certificate issuance and TLS certificate lifecycle (see the PKI architecture)]
  • [Example: end-user password storage (handled by the identity provider)]
  • [Example: payment HSM functions such as PIN translation]
  • [Example: migration of every algorithm to post-quantum schemes (tracked in the PQC migration plan)]
  • [Item deferred, with the release that will take it]

3. Capacity estimation

3.1 Assumptions

All figures are per region.

InputSymbolValueSource
Encrypted object writes at peakwwExample: 200 000/sStorage metrics
Encrypted object reads at peakrrExample: 1 000 000/sStorage metrics
Writer instancesnwn_wExample: 1 000Deployment inventory
DEK reuse window per writerTTExample: 300 sPolicy (7.2)
Reader DEK cache hit ratiohhExample: 0.95Load test with 5 min TTL
Workload instances fetching secretsiiExample: 60 000 (3 000 services x 20)Platform inventory
Secrets per instance, lease lengthExample: 20 secrets, 1 hSecrets inventory
HSM symmetric operations per secondccExample: 10 000Vendor data sheet, confirm by test
Audit event sizeExample: 500 BLog schema

3.2 KMS call rate

Naive design, one KMS call per object:

Onaive=w+r=2×105+106=1.2×106 ops/s⇒1.2×10610 000=120 HSMsO_{naive} = w + r = 2 \times 10^{5} + 10^{6} = 1.2 \times 10^{6} \ \text{ops/s} \Rightarrow \frac{1.2 \times 10^{6}}{10\,000} = 120 \ \text{HSMs}

With DEK reuse and reader caching:

Ogen=nwT=1 000300≈3.3 /s,Odec=r(1−h)=106×0.05=50 000 /sO_{gen} = \frac{n_w}{T} = \frac{1\,000}{300} \approx 3.3 \ \text{/s}, \qquad O_{dec} = r (1 - h) = 10^{6} \times 0.05 = 50\,000 \ \text{/s}

Secrets add 60 000×20/3 600≈33360\,000 \times 20 / 3\,600 \approx 333 reads/s for lease renewals and about 400/s during a deploy that restarts 10% of instances within 5 minutes. The total is about 50 737 operations/s:

NHSM=50 73710 000×1.5≈7.6⇒8 HSMs per regionN_{HSM} = \frac{50\,737}{10\,000} \times 1.5 \approx 7.6 \Rightarrow 8 \ \text{HSMs per region}

Each DEK then protects about 200 000/1 000×300=60 000200\,000 / 1\,000 \times 300 = 60\,000 objects, far below the limit of 2322^{32} AES-GCM invocations with random IVs per key in NIST SP 800-38D section 8.3.

3.3 Storage and audit

  • Secrets: 100 000 secrets x 10 versions x 4 KiB is about 4.1 GB, small.
  • Data keys: one new DEK per writer every 5 minutes is 288 000 wrapped DEKs per day and about 105 million per year; they live with the data, not in the KMS.
  • Re-wrap after a KEK rotation: 105 million DEKs at 2 000 re-wraps/s take about 14.6 hours, a background job, not an outage.
  • Audit: 50 737 events/s x 86 400 s x 500 B is about 2.19 TB per day before compression, about 0.8 PB per year. Cache hits are not KMS events, which is why the audit volume stays manageable; the log goes to append-only storage with compression and tiering.

3.4 Summary

QuantityEstimateDesign consequence
Naive KMS calls1.2 million/s, 120 HSMsNever call the KMS per object
Calls with reuse and cachingAbout 51 000/s8 HSMs per region with 50% headroom
Objects per DEKAbout 60 000Well inside the AES-GCM invocation limit
Re-wrap after rotationAbout 14.6 hRotation is a background job
AuditAbout 2.2 TB per day rawAppend-only, compressed, tiered storage

4. API design

4.1 Operations

InterfaceOperationPurpose
KMSCreateKey(spec, usage, policy)New KEK in state pre-activation or active
KMSGenerateDataKey(key_id, context) -> {plaintext, wrapped}Envelope encryption: DEK for local use plus wrapped copy to store
KMSDecrypt(wrapped, context) -> plaintextUnwrap a DEK; key ID and version are read from the wrapped blob
KMSEncrypt(key_id, plaintext <= 4 KiB, context)Small payloads only, such as a secret value
KMSReEncrypt(wrapped, new_key_id)Re-wrap under the current version without exposing the DEK to the caller
KMSRotateKey(key_id), DisableKey, ScheduleKeyDeletion(days)Lifecycle
SecretsPutSecret(path, value), GetSecret(path, version?)Static secrets
SecretsIssueCredential(role) -> {username, password, lease}Dynamic credentials
SecretsRenewLease(id), RevokeLease(id)Lease control

4.2 Wrapped key format

The wrapped DEK is self-describing so Decrypt needs no key ID from the caller, and the encryption context is bound as additional authenticated data (AAD): unwrapping with a different context fails.

{"format": 1, "keyId": "kek-orders-eu", "keyVersion": 4, "alg": "AES-256-GCM", "iv": "[base64, 12 bytes]", "ciphertext": "[base64 wrapped DEK]", "tag": "[base64, 16 bytes]", "contextHash": "[sha-256 of canonical context]"}
{"context": {"service": "orders", "table": "invoices", "tenant": "t_8812"}}

Errors use RFC 9457 problem details; AccessDenied, KeyDisabled, ContextMismatch and Throttled are distinct types so clients can tell a policy problem from a capacity problem.

5. Data model

5.1 Entities

KEK versions are stored only as blobs wrapped by an HSM-held domain key; DEKs are not stored in the KMS at all.

5.2 Storage choices

DataStoreKeyWhy
Key metadata and wrapped versionsExample: Replicated consensus-based store, per region with cross-region copieskey_id, versionSmall, strongly consistent, must never lose a version
SecretsSame store, values encrypted under a KEKpath, versionVersioned, read-heavy, small
LeasesSame store with TTL indexlease_idExpiry drives revocation
Audit logAppend-only object storage with hash chainingTime, regionTamper-evident, large
Domain (root) keysInside HSMs only, backed up as quorum-protected sharesNot addressableNever exported in plaintext

5.3 Access patterns

Access patternFrequencyKey or index that serves itPartition key rationale
Unwrap a DEKAbout 50 000/skey_id and version from the wrapped blob, metadata cached on API hostsKey metadata is tiny and cached; only the HSM call is remote
Generate a DEKAbout 3/s steady, more at deployskey_id current versionSame cache
Read a secretAbout 333/s, 400/s in deploy stormspath and versionPartitioned by path prefix (team) so one team's storm stays local
Expire leasesContinuousTTL index on expires_atTime-ordered index, scanned by revocation workers
Find all data under a key versionRotation, compromiseInventory of wrapped DEKs reported by storage systems, keyed by key_id and versionThe KMS cannot know where data lives; storage systems report it
Answer an auditorRareAudit log by key, principal and timeIndexed copy in the security analytics platform

6. High-level design

ComponentResponsibilityScales by
KMS and secrets APIAuthenticate, authorise, call HSMs, return results, write auditStateless hosts
Policy engineEvaluate key and secret policies (who, which operation, which context)Cached policies on each host
HSM clusterHold domain keys, wrap and unwrap KEK versions and DEKsOperations per second (3.2)
Key and secret storeMetadata, wrapped key versions, secrets, leasesSmall, consensus replicated
Encryption SDKEnvelope encryption, DEK reuse and cache, AAD handlingWith workloads
Dynamic credential engineCreate and revoke database users per leaseLeases per second
Rotation and re-wrap jobsScheduled rotation, re-wrap of stored DEKsBackground

7. Detailed design

The deep dives in this section, each with options, choice and reason:

Deep diveOptions consideredChoiceReasonSection
Key hierarchyOne key per service in software, HSM-held root with wrapped KEKs, everything in HSM slotsHSM-held domain key wraps KEK versions stored outsideUnlimited keys, keys never in plaintext outside HSMs7.1
Data encryptionKMS encrypts data, one DEK per object, DEK reuse with cachingDEK reuse per writer, cache on readers120 HSMs down to 87.2
RotationRe-encrypt all data, new version plus re-wrap, new version onlyNew version, re-wrap in backgroundOld data stays readable, no data rewrite7.3
Unreachable KMSFail open, fail closed, bounded cacheBounded cache, then fail closedAvailability without unlimited exposure7.6

7.1 Key hierarchy

LevelKeyWhere it livesLifetime (Example)
0Domain (root) keyOnly inside HSMs; backup split into shares held by custodiansRotated per policy, with ceremony
1KEK version (customer master key)Wrapped by the domain key in the key store; unwrapped only inside HSMsOriginator use 1 year, kept while data needs it
2DEKPlaintext in workload memory for at most 5 minutes; wrapped copy stored with the dataOne writer window
DataObjects, rows, filesApplication storage, encrypted with AES-256-GCMAs long as the data

7.2 Envelope encryption with reuse and caching

Rules for reuse and caching:

  • A writer uses one DEK for at most 5 minutes or a set number of objects, whichever comes first, and for one encryption context only.
  • Each object gets a fresh random 96-bit IV; the count per DEK stays far below the SP 800-38D section 8.3 limit (3.2).
  • Reader caches are keyed by the exact wrapped DEK bytes and context, hold plaintext DEKs in memory only, and expire after 5 minutes. A disabled KEK therefore stops all new decryption within 5 minutes.
  • The trade-off: a compromised workload host exposes the DEKs in its cache, which cover at most 5 minutes of data per context. Highly sensitive data sets a shorter window or turns caching off.

7.3 Rotation and re-wrapping

Rotation creates a new KEK version that becomes the only one used for new wrapping; old versions remain able to unwrap. Data is not re-encrypted: re-wrapping a DEK under the new version (ReEncrypt) changes only the small wrapped blob. A background job re-wraps every stored DEK when policy requires retiring an old version, about 14.6 hours for a year of DEKs (3.3). DEKs themselves are rotated implicitly every writer window.

NIST SP 800-57 Part 1 Rev. 5 section 5.3.6 discusses cryptoperiods by key type. For symmetric data-encryption keys it suggests an originator-usage period on the order of a day or a week when large volumes are encrypted quickly, up to about two years for smaller volumes, and a recipient-usage period of up to three years beyond that; for symmetric key-wrapping keys it links the period to how many keys are wrapped. Set your own periods in the cryptography standard and record them per key in the rotation period field.

7.4 Key states

The KMS tracks each key version through the states described in NIST SP 800-57 Part 1 Rev. 5 section 7. The diagram shows the transitions this service allows.

StateEncrypt or wrapDecrypt or unwrapNotes
Pre-activationNoNoCreated, not yet usable
ActiveYesYesCurrent version of a KEK
SuspendedNoNoTemporary hold, for example during an investigation
DeactivatedNoYesOld version kept for existing data
CompromisedNoOnly under break-glass, to re-protect dataTriggers the compromise runbook (9.1)
DestroyedNoNoKey material deleted after a waiting period (for example 30 days)

7.5 Secrets service

  • Static secrets: stored encrypted under a KEK, versioned, read by path. Rotation writes a new version; consumers read "current" and the old version stays valid for an overlap window agreed with the target system.
  • Dynamic credentials: for supported databases the engine creates a user with the role's grants for each lease (1 hour, renewable) and drops it on expiry or revocation. Leaked credentials expire on their own, and audit shows which workload held which user.
  • Delivery: a sidecar or SDK fetches secrets at start and renews leases; secrets never go into images, repositories or environment files.
  • Authentication: workloads prove identity with the platform's workload identity (signed service account token or certificate), never with a secret that itself needs storing.

7.6 Availability versus security

SituationBehaviourRationale
KMS unreachable, DEK in reader cacheServe until cache TTLShort outages invisible to users
KMS unreachable, cache missFail closed with a retryable errorNo way to decrypt without the key
KMS unreachable, writer needs a new DEKKeep current DEK up to a hard maximum (for example 15 min), then fail closedBounded exposure
Region lostClients fail over to the paired region, where KEK versions are replicated under that region's domain keyData stays readable
HSM cluster degradedThrottle bulk jobs (re-wrap) before interactive callsProtect latency for users

7.7 How real systems do it

How real systems do it (paraphrased, not copied). The AWS document "AWS KMS cryptographic details" describes a tiered service: API hosts that terminate TLS and authorise requests, and a fleet of FIPS 140-3 validated HSMs. A KMS key is a logical container for one or more HSM backing keys; each backing key version is exported only in encrypted form, wrapped by HSM-held domain keys, and stored in durable storage. Rotation adds a new backing key for new encryption while older ones still decrypt. The document lists domain keys as rotated daily (relaxed at times to at most weekly), derives a fresh encryption key from the backing key for each encryption, and describes data keys returned in plaintext and encrypted form for envelope encryption, with an optional encryption context bound as additional authenticated data. The document also says direct encryption under a KMS key suits only data under about 4 KB, which is why large data uses data keys. Read the original in 12.3; this box keeps only the general idea.

8. Scalability and performance

ConcernApproachLimit before redesign
HSM operationsDEK reuse and caching; HSMs added in pairsExample: 8 HSMs per region at 50% headroom
API hostsStateless, policy and metadata cached[Requests per host]
Hot keysOne KEK per service and context, not one global keyPer-key throttles
Deploy stormsJittered lease renewal, per-team throttlesExample: 400 secret reads/s
Audit volumeOnly cache misses produce KMS events; compressionStorage cost

Decrypt latency budget (target p99 10 ms):

StepBudget
mTLS session reuse and authentication1 ms
Policy evaluation (cached)0.5 ms
HSM unwrap including queueing4 ms
Audit write (asynchronous, durable queue)1 ms
Network round trip in region1 ms
Headroom2.5 ms

9. Reliability, security and operations

9.1 Failure modes

ComponentFailureDetectionBlast radiusMitigationRTO
HSMDevice failureHealth checks, error rateCapacity of one of 8 HSMsRemaining HSMs serve; replace and re-sync from clusterExample: 0 (capacity only)
HSM clusterLoss of all HSMs in a regionSynthetic decrypt probesAll cache misses in the regionFail over to paired region; restore from quorum backupExample: 5 min failover
Key storeReplica lossConsensus healthNone while a majority staysReplace nodeExample: 30 min
KEKAccidental deletionDeletion scheduled eventAll data under that keyMandatory waiting period with alerts; restore before expiryExample: Minutes, during the waiting period
KEK versionCompromiseDetection or reportData wrapped under that versionMark compromised, rotate, re-wrap or re-encrypt affected data, review audit for misuseExample: Per runbook, hours
Secrets engineDatabase unreachable for dynamic credentialsIssue failuresNew credentials for that databaseExisting leases continue; extend renewalsExample: 15 min
[Component][Failure][Signal][Scope][Mitigation][Time]

9.2 Security

ThreatControl
Insider exports root keysDomain keys non-exportable; backup shares require a quorum (for example 3 of 5 custodians) in a recorded ceremony
Stolen workload credentialShort-lived workload identity; key policies scoped to context; anomaly alerts on unusual key use
Confused deputy (service decrypts another tenant's data)Encryption context with tenant ID bound as AAD and required by policy
Audit tamperingHash-chained, append-only log copied to a separate security account
Ciphertext swapped between recordsAAD includes record identity, so a moved ciphertext fails to decrypt
Future quantum attacksAES-256 for symmetric keys; asymmetric keys inventoried for migration per the PQC plan
[Threat][Control]

9.3 Observability

SignalMetric or logAlert threshold
Decrypt latencyp99 per regionAbove 10 ms for 10 min
HSM utilisationOperations per HSMAbove 60% of tested capacity
Access denialsDenied operations by principal and keySpike vs. baseline
Unusual useKey used from a new service or contextAny, for high-sensitivity keys
Rotation complianceKeys past their rotation dateAny
Lease healthExpired but not revoked dynamic usersAny

9.4 Cost estimate

ItemUnit costQuantityMonthly cost
HSMs[$/HSM-month]Example: 8 per region x 2 regions[$]
API hosts[$/host-month][Count][$]
Audit storage[$/TB-month]Example: About 2.2 TB per day before compression[$]
Total[$]

10. Trade-offs and alternatives

DecisionOptionsChosenWhyWhat we give up
Build or buyCloud provider KMS; self-run open-source secrets manager; build on HSMs[Choice][Reason][Cost]
DEK scopePer object; per writer window; per tablePer writer window120 HSMs down to 8Larger exposure per stolen DEK
Reader cache TTLNone; 1 min; 5 min5 min95% hit ratioRevocation takes up to 5 min to bite
RotationRe-encrypt data; re-wrap DEKsRe-wrapNo data rewriteOld KEK versions kept while data needs them
SecretsStatic only; dynamic where possibleDynamic where possibleLeaked credentials expireTarget systems must support user creation
What changes at 10x / 0.1x10x (about 507 000 operations/s): about 76 HSMs by the 3.2 formula, so add an intermediate per-service key held in HSM-backed memory on hardened KMS hosts, or longer reuse windows, and accept a larger trusted computing base. 0.1x (about 5 000 operations/s): one HSM pair per region, or a cloud provider KMSReview at each doubling of decrypt rateHSM operations grow first[Note]
[Decision][Options][Chosen][Why][Cost]

11. Delivery plan and risks

11.1 Milestones

MilestoneScopeExit criterionTarget date
M1HSM cluster, key ceremony, KMS API, auditCeremony recorded; restore from backup shares testedYYYY-MM-DD
M2Encryption SDK with reuse and cache; first storage systemDecrypt p99 under 10 ms at test loadYYYY-MM-DD
M3Secrets service, static secrets, migration of top 100 servicesNo secrets in repositories for those servicesYYYY-MM-DD
M4Dynamic credentials, automatic rotation, second regionRegion failover drill passesYYYY-MM-DD

11.2 Rollout and rollback

[Example: Storage systems adopt the SDK one at a time. New data is written with KMS envelopes while old data stays under the old static key; a background job re-encrypts old data. Rollback keeps both readers in place, so data written either way remains readable.]

11.3 Risks

IDRiskLikelihoodImpactMitigationOwner
R-01Example: KMS outage makes data unreadableMediumHighTwo regions, caches, drills[@name]
R-02Example: Loss of custodian sharesLowHighShares in separate locations; annual verification[@name]
R-03Example: Teams bypass the SDK and call the KMS per objectMediumMediumPer-principal throttles; SDK as the supported path[@name]
R-04Example: NIST SP 800-57 Rev. 6 final changes cryptoperiod or algorithm guidanceMediumLowTrack the draft; review the cryptography standard on publication[@name]
[R-nn][Risk][L / M / H][L / M / H][Mitigation][@name]

12. Appendices

12.1 Open questions

IDQuestionOwnerDue
OQ-01Example: Which FIPS 140-3 security level do contracts require for the HSMs?[@name]YYYY-MM-DD
OQ-02Example: Do any tenants require keys held in their own HSM (external key store)?[@name]YYYY-MM-DD
[OQ-nn][Question][@name]YYYY-MM-DD

12.2 Glossary

TermMeaning
KMSKey management service that performs operations with keys it never releases
HSMHardware security module: tamper-resistant device that stores keys and performs cryptography
KEKKey-encryption (key-wrapping) key that protects other keys
DEKData encryption key used directly on data
Envelope encryptionEncrypting data with a DEK and storing the DEK wrapped by a KEK
Encryption contextNon-secret key-value data bound to a ciphertext as AAD
CryptoperiodTime span during which a key is authorised for use
LeaseTime-limited grant of a dynamic credential
[Term][Meaning]

12.3 References

ReferenceUse
NIST SP 800-57 Part 1 Rev. 5, "Recommendation for Key Management: Part 1 - General", May 2020, doi:10.6028/NIST.SP.800-57pt1r5Cryptoperiods (5.3.6), key states (7)
NIST SP 800-57 Part 1 Rev. 6 initial public draft, 5 December 2025 (comments closed 5 February 2026; not final as of October 2026)Upcoming changes, including post-quantum algorithms
NIST SP 800-38D, GCM and GMAC, November 2007 (revision in progress)IV and invocation limits (8.3)
NIST SP 800-38F, Methods for Key Wrapping, December 2012Key wrapping modes
NIST FIPS 140-3, Security Requirements for Cryptographic Modules, 22 March 2019HSM validation
AWS, "AWS KMS cryptographic details", AWS documentation (accessed October 2026)7.7
RFC 9457 Problem Details for HTTP APIsError format
Secrets Management Standard (security/secrets-management-standard)Policy for secret types, rotation and storage
Cryptography Standard (security/cryptography-standard)Approved algorithms and cryptoperiods
PKI and Certificate Architecture (security/pki-certificate-architecture)Certificates, out of scope here
Post-Quantum Cryptography Migration Plan (security/pqc-migration-plan)Asymmetric key migration
Authorization Service Design (system-design/design-authorization-service)Policy evaluation patterns
Distributed Lock and Coordination Service Design (system-design/design-distributed-lock-coordination)Consensus store for key metadata

Standard and licence note

Based on NIST SP 800-57 Part 1 Rev. 5 (May 2020), NIST SP 800-38D, SP 800-38F and FIPS 140-3, which are public US government publications, paraphrased here in original words with section numbers only. Revision 6 of SP 800-57 Part 1 was an initial public draft as of October 2026; check the NIST page for the current status before relying on cryptoperiod or algorithm guidance. The AWS documentation is paraphrased in 7.7 only; no text, figures or tables were copied, and all numbers marked Example are illustrative. This is a design format, not security certification advice. Original text written for this collection. Template licence: MIT.

Related templates