Design a Secrets Management Vault

Hard45 min
1 / 30
System design answer

Design a Secrets Management Vault

Hard45 min30 sections
understanding•11 min read

Problem Statement: A Cryptographic Trust Anchor for Every Service

Frames the vault as the single source of cryptographic truth that every workload depends on, not merely a key-value store with encryption.

Problem statement

Design a secrets management vault that stores, encrypts, versions, rotates, and issues credentials to thousands of microservices, databases, CI/CD pipelines, and human operators. The vault must issue dynamic, short-lived credentials (database usernames, cloud IAM tokens, TLS certificates) that expire automatically, enforce fine-grained access control per secret path, produce a tamper-evident audit trail of every access, and remain available during partial failure without ever exposing plaintext material.

This is not a database with an encryption column. A secrets vault is the cryptographic trust anchor of the entire platform. Every service authenticates to something; every TLS handshake needs a private key; every database connection needs a password. If the vault is down, nothing can start. If the vault is compromised, everything is compromised. The design therefore separates availability (the vault must serve reads 99.99% of the time) from confidentiality (plaintext must never persist outside a bounded decryption context) from integrity (no undetected modification of stored secrets or audit records).

Why the problem is distinctive

A generic key-value store can lose a write and retry. A vault cannot lose a master key or silently serve a stale credential that was rotated five minutes ago. The design therefore separates secret storage (durable, versioned, encrypted) from credential issuance (ephemeral, dynamically generated, bounded by TTL) from policy enforcement (evaluated per-request against ACL, identity, and context). A service fetching a database password is not reading a static string; it is triggering a workflow that creates a new database user, grants scoped permissions, sets an expiry, and returns credentials that will not exist in 3600 seconds.

The problem requires encrypted storage with versioning, fine-grained ACL, automatic rotation for database passwords and TLS certificates, ephemeral secrets with short TTL, high availability, audit logging, scalability to thousands of concurrent consumers, and PKI integration.

Public operating baseline versus design assumptions

HashiCorp Vault, the dominant open-source vault, documents Raft-based replication, Shamir's Secret Sharing for unseal, envelope encryption with transit backends, and dynamic database credential engines. Netflix publicly discussed migrating from static credentials to a centralized secrets service handling tens of thousands of service instances. Uber's internal platform manages secrets across 2,200+ microservices. Shopify published details of their Vault deployment serving thousands of Rails processes.

For capacity planning, this answer explicitly assumes a mature platform with 12,000 registered services, 6,000 simultaneously active secret consumers, 85,000 secret-read requests per second at peak, and a 3x event multiplier during deployments or certificate renewals. Unless a number is tied to a citation, it is a stated design assumption.

The four architectural planes

  1. Cryptographic plane: master key hierarchy, HSM integration, envelope encryption, unseal/seal state, key derivation.
  2. Policy plane: ACL evaluation, identity binding, token scoping, lease management, rate limiting.
  3. Storage plane: encrypted secret versions, audit log, lease records, configuration, replication.
  4. Issuance plane: dynamic credential engines (database, cloud IAM, PKI, SSH), TTL management, revocation.

A strong interview answer keeps these planes separate. The cryptographic plane must never depend on the storage plane for availability of decryption during unseal. The policy plane must evaluate before the storage plane reads. The issuance plane must handle downstream system failures (database unreachable during credential creation) without leaving orphaned access.

Key Highlights

  • •The vault is the cryptographic trust anchor: if it is down, no service can authenticate; if compromised, everything is compromised.
  • •Separate secret storage (durable, versioned) from credential issuance (ephemeral, TTL-bound) from policy enforcement (per-request).
  • •Dynamic credentials are created on-demand in downstream systems and destroyed on expiry, never stored long-term.
  • •The architecture has four planes: cryptographic, policy, storage, and issuance.
  • •Availability without confidentiality is catastrophic; confidentiality without availability is a denial-of-service.
Lead With the Trust Anchor Framing
State in the first minute that the vault is the cryptographic root of trust for the entire platform. Every TLS handshake, every database connection, every API authentication ultimately depends on material this vault protects. This immediately distinguishes a security architecture from a generic storage question.
Do Not Design a Key-Value Store with AES
A design that merely encrypts values at rest and serves them on request misses the core challenges: dynamic issuance, TTL-bound leases, rotation without downtime, and the unseal ceremony. The interviewer is testing whether you understand that secrets are living objects with lifecycles, not static blobs.

Section Rescue Kit

Buzzwords to use:

Envelope EncryptionZero Standing Privileges

Safe statements:

  • "I will separate the problem into cryptographic storage, policy enforcement, and dynamic issuance because they have fundamentally different availability and consistency requirements."
  • "Before selecting technologies, let me define which operations must survive a total storage outage versus which can fail closed."
Design a Secrets Management Vault - System Design | WinJob | WinJob