Interview Questions/System Design/Design a Secrets Management & KMS Service
AdvancedSystem-Design
45 min

Design a Secrets Management & KMS Service

SecurityCryptographyComplianceAPIs
Advertisement
Interview Question

Design a system for storing secrets and managing encryption keys with rotation, auditing, and fine-grained access control.

Key Points to Cover
  • Threat model; HSM-backed root of trust and envelope encryption
  • Secret storage with ACLs, leasing, dynamic creds, and rotation
  • Key management: generation, rotation, revocation, versioning
  • Audit logs, tamper-evidence, and break-glass procedures
  • Multi-region replication with integrity guarantees
  • Client SDKs/agents, caching, and sidecar delivery patterns
Evaluation Rubric
Strong root of trust & crypto model30% weight
Secret/key lifecycle & rotation25% weight
Auditability & governance25% weight
Safe/low-latency secret delivery20% weight
Hints
  • 💡Envelope encryption reduces exposure of master keys.
Common Pitfalls to Avoid
  • ⚠️Storing secrets directly in code or configuration files without proper encryption.
  • ⚠️Lack of a robust root of trust, leading to master keys being vulnerable.
  • ⚠️Insufficient auditing, making it impossible to track access or detect misuse.
  • ⚠️Overly broad access control policies, granting unnecessary permissions.
  • ⚠️Ignoring key rotation and revocation, leading to stale or compromised credentials.
Potential Follow-up Questions
  • How do you handle tenant-isolated keys?
  • What’s your procedure for key compromise?
Advertisement