Security / 4 / 4
Secrets management
A shop backend keeps its database password in a committed .env file shared by five services. It leaks, and the emergency rotation takes checkout down. A secrets manager fixes both: services prove who they are with a workload identity, get their own short-lived database users, secrets are encrypted at rest, keys rotate with overlapping versions, and every read is audited.
- 13 min
- Intermediate
- 12 steps
- Static secret copies
- 9
- Services per leak
- 5
- Rotation downtime
- 0 s
- Reads audited
- 0 %
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Git repo → Orders serviceRequest
$ cat services/orders/.env
DB_HOST=db.internal.example.com
DB_USER=app1
DB_PASSWORD=***2
# same file in reports, billing, search, admin3
# committed 2024-03-02, never rotated4
DB_USER— One user for every service. The database cannot tell them apart.DB_PASSWORD— A long-lived secret in plain text. In git history it stays even after you delete the line.same file— Five services share it: one leak opens all five.never rotated— Changing it means editing five files and redeploying five services at once.
Build it yourselfCheat sheetCompare lessons
Course: 74 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes
11 Case studies