secrets.yaml Pattern Considered Harmful
Why a single secrets.yaml file is dangerous.
Problem
The secrets.yaml pattern is the anti-pattern of putting all secrets in a single YAML file. The discipline is recognizing the problems and migrating to better patterns.
What problems the pattern produces:
- Single file: easy to accidentally commit.: One file with all secrets is easy to commit accidentally. The pre-commit hooks may not catch it; the discipline fails; secrets leak.
- Hard to rotate one secret without disturbing others.: Editing the file to rotate one secret risks affecting others. Engineering caution slows rotation; the discipline degrades over time.
- Lost when the file is deleted.: A misplaced rm or git operation can lose all the secrets at once. The blast radius is large; recovery is hard.
- Hard to audit access.: The single file's access controls apply to all secrets. Engineers who need one secret get all; the principle of least privilege fails.
- No rotation tracking.: The single file does not track when each secret rotated. The discipline degrades; old secrets accumulate without notice.
The problems are real. The discipline is moving past secrets.yaml.
Better
Per-secret storage in managed secret stores produces better outcomes. Granular access, granular rotation, audit trails all are real improvements.
- Per-secret in Vault or AWS Secrets Manager.: Each secret has its own entry. The store handles them individually; the discipline is granular.
- Granular access.: Per-secret access controls let the team grant minimum necessary. Engineer A gets database secret; engineer B gets API secret; the principle of least privilege works.
- Granular rotation.: Rotating one secret does not affect others. The discipline produces independent rotation; the operations are bounded.
- Audit trails.: Every access is logged. The discipline produces compliance evidence; investigation has data.
- External secret stores.: Vault, AWS Secrets Manager, GCP Secret Manager all are options. The discipline picks the right one for the team's stack.
Per-secret storage is the modern approach. The discipline is meaningfully better.
Migrate
Migration from secrets.yaml to managed stores is bounded effort. Audit, move, integrate; the discipline produces ongoing payoff.
- Audit existing secrets.yaml.: The team identifies secrets in the file. Each secret is reviewed; the secret's purpose, consumer, and sensitivity are documented.
- Move to managed store.: Each secret is moved to the chosen store. The application's reference is updated; the discipline produces incremental migration.
- Update consumers.: Each consumer is updated to fetch from the managed store. The change is per-application; the discipline scales.
- Remove from yaml.: Once consumers are migrated, the secret is removed from secrets.yaml. The discipline shrinks the legacy file; eventually it is empty.
- Ongoing payoff.: The migration is one-time effort; the benefits compound. Better security, better operational story, better compliance; the discipline produces ongoing value.
Secrets yaml pattern is one of those legacy patterns that benefits from migration. Nova AI Ops integrates with secret management tools, surfaces patterns, and supports the team's secret discipline.