← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 041 · Security and data protection

Design a Secrets Manager

Medium 50 min

An engineering organisation runs 3,000 services on 40,000 instances, and today database passwords and API keys sit in config files and environment variables. Design a central secrets manager: services prove their identity, fetch the secrets they are allowed to use, and pick up new values automatically when a secret is rotated. Normal traffic is modest because clients cache secrets, but a large deploy or a mass restart can produce 5,000 fetches per second. If the secrets manager is unreachable, already-running services must keep working.

Functional requirements

  • Store secrets encrypted, with versions and metadata
  • Services authenticate with their workload identity and read only secrets their policy allows
  • Rotate database passwords and API keys on a schedule or on demand, without downtime
  • Record every read, write and policy change in an audit log

Non-functional requirements

  • Secret reads complete in under 150 ms at p95
  • Plaintext secrets are never stored on disk and never written to logs
  • Available 99.99% of the time; running services survive a full outage of the manager
  • A leaked secret can be revoked and replaced everywhere within 15 minutes

Constraints and scale

  • 3,000 services, 40,000 instances, about 200,000 secrets
  • 5,000 secret reads per second during deploy storms
  • Fewer than 50 writes per second, mostly rotations

You will practise

  • Apply envelope encryption with a key management service or hardware security module
  • Authenticate workloads by identity rather than with yet another shared secret
  • Design rotation that keeps two valid versions during a changeover
Show 2 hints
  1. A service needs a credential to fetch its credentials. What can prove who it is without one?
  2. If you rotate a database password, some instances still hold the old one. How do both keep working for a while?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • A payment provider key leaksA developer accidentally pastes a production payment provider API key into a public code repository. A scanner flags it 20 minutes later; 140 instances across 6 services use that key.

Run them from the workspace once your design is in place.