Secrets-From-Day-One.md 5.7 KB

Secrets from day one: a password manager, Doppler for every asset, and the .env rules

Side page to the start-from-zero pages. Read it after Identity, secrets and zero trust basics and Doppler and secrets (core step 17), and before CI, tests and the cost gate. It does not repeat them. Those pages say what a secret is and how this project keeps its own out of the repository; this one is about your habits: what to set up before the first line of code, where each kind of secret lives, how to catch the one that slipped, and what to do in the first hour after one leaks. Next: CI, tests and the cost gate.

Unfamiliar word or acronym? The Glossary defines it.

Status: the free local lab was run once on Linux; the PowerShell commands, macOS and the Doppler own-account path were not run. On 2026-10-22 the author ran every Bash command in exercises 1 to 5 on a Debian-based Linux machine with git 2.47.3, Python 3.13.5, gitleaks 8.30.1 and the git-filter-repo script from that project's main branch, as an ordinary user, in a scratch folder, and pasted trimmed output from those runs. Four things were not run and are marked est. (estimate): every PowerShell command (no PowerShell was available), anything on macOS or Windows, the gitleaks download for platforms other than Linux x64, and the whole optional path with your own Doppler account. The Doppler commands in that path were checked only against the --help text of the Doppler CLI 3.77.0 and against Doppler's documentation; the output you will see there is not shown because it was never seen. Every vendor and standards claim was read on 2026-10-22 unless a row says otherwise, and sits in the claims register at the end of part 4, with its URL. Parts of this page describe things that are planned and not built (the edge assets); those are labeled where they appear. Trust what your terminal prints over this page.

Prerequisites. Identity, secrets and zero trust basics and Doppler and secrets for the vocabulary, and APIs and tokens from zero for what a token, a scope and a 401 are. The terminal and your first script and Git from zero for the shell and git commands. The free path needs git and Python 3.11 or newer (3.13 was used), on Linux, macOS (est.) or Windows with PowerShell 5.1 or later (est.). gitleaks and git filter-repo are optional; the page works without them. About four hours for the reading and the free exercises (est.); the optional Doppler path adds about an hour (est.).

Where this runs. Everything in the free path happens in one scratch folder on your own computer. Nothing is sent anywhere and nothing is pushed. The only secrets are dummy values built at the moment you run the exercise, issued by a pretend service that is a short script; no secret-shaped text is stored in this repository. Never push the scratch repository to GitHub or anywhere else, even though the values are fake. The optional path uses your own Doppler account on its free plan and your own time; it starts with the teardown.

The parts

This page is split into four parts so each stays readable. Read them in order; the text is unchanged from the single page.

  1. The rules, the tools and the threat model: The maintainer's rule, why never hardcode, the password manager, Doppler, the .env rules, scanning, rotation, leaks and the threat model.
  2. Free lab setup and exercises 1 and 2: The free local lab: setup, Exercise 1 (plant a dummy secret and catch it) and Exercise 2 (.env, .env.example and .gitignore).
  3. Exercises 3 to 5 and the optional Doppler path: Exercises 3 to 5 (who can read a secret, the leak drill, an SSH auth log), the clean-up and the optional Doppler account path.
  4. Build, break, defend, the checkpoint and the claims: The build, break, detect, evade, defend loop, the checkpoint, common mistakes, the claims register and where to next.

Exercise index

Every exercise follows predict, do, check, undo. All are free and local.