Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Secure Storage for Customer Financial Data

Store customers' card numbers, account numbers and Social Security numbers so each application gets only what it needs, every full-value read is recorded, and a stolen database or credential reveals as little as possible.

Problem statement

Design a system that stores sensitive customer financial data securely.

For this exercise, assume a bank keeps, for each customer, a name, mailing address, date of birth, Social Security number (SSN), bank account numbers and card numbers.

Several internal applications use this data: a customer-service app used by agents, a statements service, a card payment service and the fraud team's tools. Design one service that stores these fields and gives each application only what it needs.

For this exercise, assume most applications never need a full card number, account number or SSN. They work with a token, a stand-in value that is useless outside the bank, or with a masked value that shows only the last four digits.

Only a few approved services, such as the card payment service, may exchange a token for the full value. Every read of a full value must be recorded with who asked, for which customer and why, and those records cannot be changed or deleted.

Sensitive values must be encrypted wherever they are stored, including backups, and encryption keys must be kept apart from the data. Customer sign-in, the applications themselves and fraud detection are out of scope.

Design the service, from an application's request to where the data and the keys are kept.

What to build

  1. An approved application can save or update a customer's sensitive fields and gets back tokens for the card numbers, account numbers and SSN.
  2. An application reads a customer's record and gets each field in full, masked to the last four digits, or not at all, depending on its role; only approved services can exchange a token for the full value.
  3. Every full-value read is recorded with who asked, for which customer, when and why; security staff can search these records, and no one can change or delete them.

At scale

  • For this exercise, assume 50 million customers with about 150 million card and account numbers and 50 million SSNs, about 200 million sensitive values in all (names, addresses and birth dates are not counted in these), about 200 writes per second, and 5,000 reads per second at peak, of which about 500 per second return a full value.
  • For this exercise, assume a read returns within 100 milliseconds at p95, because customer-service screens and card payments wait on it.
  • For this exercise, assume encryption keys are rotated every year without downtime, and a key suspected of being exposed must stop protecting any live value within one week.
  • For this exercise, assume access records are kept for 7 years.