mvp-ai's picture
download
raw
9.09 kB
id,category,option,best_for,avoid_when,tradeoffs,tags,last_verified
DO043,Secret Storage,Platform Environment Variable Store (Vercel/Netlify/Cloudflare dashboard or CLI),"Any project deployed to a managed platform — store real secrets there, scoped per environment (production/preview/development), never in a committed file","A secret shared across many services/teams needing centralized rotation and audit logging beyond what a single hosting platform's env store offers — a dedicated secrets manager fits better there","Simple, git-integrated, and scoped per environment out of the box, but secrets live inside that one platform's account — factor that into your access-control/offboarding process","env-vars|secrets|vercel|netlify",2026-07-03
DO044,Secret Storage,Dedicated Secrets Manager (e.g. a cloud secrets-manager service),"Larger orgs needing centralized secret rotation, fine-grained access policies, and audit logs across multiple services/platforms, not just one hosting provider","Small projects on a single managed platform — the platform's built-in env store already covers the need without extra infrastructure","Centralized rotation, versioning, and audit trail across every service that needs a given secret, at the cost of extra integration work (fetching secrets at runtime/build time from the manager) compared to a platform's native env store","secrets-manager|enterprise|rotation",2026-07-03
DO045,Local Development,".env.example Committed, .env Gitignored","Every project, without exception — document every required variable's name and purpose in a committed template, keep real values local-only and out of git","Never applicable to skip — this is the baseline convention that makes onboarding a new developer possible without them guessing which env vars exist","New developers get a complete, accurate list of required configuration without ever seeing real secret values; keep `.env.example` in sync with reality whenever a new required variable is added","dotenv|onboarding|gitignore",2026-07-03
DO046,Local Development,"Never Commit a Real Secret, Even Temporarily","Every commit, every branch — a secret committed even once and later removed is still in git history and must be treated as compromised and rotated","Never applicable to skip — 'I'll remove it in the next commit' does not remove it from history; use git-secrets/pre-commit hooks to catch this before it happens, not after","A leaked secret in git history requires rotation regardless of whether the commit was later reverted — prevention (pre-commit scanning) is far cheaper than remediation (full credential rotation)","secrets|git-history|prevention",2026-07-03
DO047,Config Validation,Validate All Required Env Vars at Startup (fail fast),"Every service — check that every required variable exists and is well-formed before accepting traffic, crashing immediately if not (see BE081)","Never skip — a missing env var surfacing as a confusing runtime error hours later, deep in a code path, is far harder to diagnose than an immediate startup crash with a clear message","Turns 'mysterious runtime failure' into 'obvious deploy-time failure with a clear error message,' which is dramatically easier to debug and catch in CI before it ever reaches production","fail-fast|config-validation|startup",2026-07-03
DO048,Per-Environment Config,"Same Config Shape Across dev/staging/prod, Different Values","Every project — the same typed config schema validates all three environments; only the actual values differ, never the required-variable list","A genuinely environment-specific feature flag or behavior toggle — that's a deliberate conditional in code, not an excuse to let the env var schema itself diverge silently between environments","Prevents 'works in staging, breaks in prod because a var was never set there' by making the schema itself the single source of truth for what every environment needs","environment-parity|config-schema|staging",2026-07-03
DO049,Build-Time vs Runtime,Distinguish Build-Time-Baked vs Runtime-Read Env Vars,"Frontend frameworks (Next.js `NEXT_PUBLIC_*`, Vite `VITE_*`) where some env vars get baked into the client bundle at build time and others are read server-side at runtime — know which is which for every variable","Never confuse the two — a secret accidentally given a build-time-public prefix ships directly into the client-visible JavaScript bundle","Build-time-public variables are visible to anyone who opens browser devtools — never put a real secret behind a `NEXT_PUBLIC_`/`VITE_`-style prefix; only genuinely public config (a public API base URL, a publishable key) belongs there","nextjs|build-time|client-bundle|security",2026-07-03
DO050,Build-Time vs Runtime,Server-Only Secrets Never Exposed to Client Bundle,"Any secret (database credentials, private API keys, service role keys) — keep them server-side only, read via a server-only env var with no public prefix, never passed as a prop into client-rendered code","A value that's genuinely meant to be public (a publishable/anon key designed for client-side use, like Stripe's publishable key or Supabase's anon key) — those are safe by design to expose","The single most common real-world leak of this category is a secret key accidentally treated the same as a publishable key and shipped to the browser — always double check which key type a given credential actually is before exposing it client-side","secrets|client-exposure|api-keys",2026-07-03
DO051,Secret Rotation,Rotate Secrets on a Schedule and Immediately After Any Suspected Exposure,"Every credential with real access (database passwords, service role keys, third-party API keys) — rotate periodically as a baseline hygiene practice, and immediately, unconditionally, after any suspected leak","Never skip the immediate rotation after a suspected leak specifically — 'we're not sure it was actually exposed' is not a reason to delay; rotate first, investigate after","Limits the window of usefulness for a credential that leaks despite prevention efforts (DO046) — treat rotation capability as something to build/verify before you need it urgently, not scramble to figure out during an actual incident","secret-rotation|incident-response|hygiene",2026-07-03
DO052,Scoping,Least-Privilege Scoped Credentials per Service/Environment,"Every credential — a CI deploy token, a database user, a third-party API key should have only the specific permissions the thing using it actually needs, scoped separately per environment (a staging DB credential should not also work against production)","A genuinely single-environment, single-purpose internal tool where separate scoping would be pure ceremony with no real risk reduction","A leaked staging credential should never be able to touch production data — least-privilege scoping is what makes that guarantee true instead of aspirational","least-privilege|scoping|access-control",2026-07-03
DO053,Third-Party Keys,Separate API Keys per Environment for Every Third-Party Service,"Stripe, Shopify, email providers, analytics — every third-party integration should have distinct dev/staging/production keys/accounts wherever the provider supports it","A provider that genuinely offers no environment separation (rare) — document that limitation explicitly and add extra caution around testing against it","Prevents a staging/test run from accidentally sending real emails, charging real cards, or polluting production analytics — Stripe and most payment providers explicitly support and expect separate test-mode keys for exactly this reason","api-keys|environment-separation|stripe",2026-07-03
DO054,CI-Specific,CI Pipeline Secrets Scoped Separately From Runtime App Secrets,"Deploy tokens, CI-only service credentials — these are a distinct credential set from the application's own runtime environment variables, even when both eventually configure the same deployed service","Treating the CI deploy token and the app's runtime database password as interchangeable or stored in the same place with the same access scope — they serve different purposes and should be scoped/audited independently","Keeps a compromised CI pipeline from automatically having the same blast radius as a compromised running application, since the two credential sets are genuinely separate","ci-secrets|scoping|deploy-tokens",2026-07-03
DO055,Documentation,Document Where Each Secret Comes From and Who Can Rotate It,"Every project with more than a couple of secrets — a short internal doc (or well-commented `.env.example`) noting which third-party dashboard issued each credential and who on the team has access to regenerate it","A genuinely single-developer project where that context already lives entirely in one person's head — still worth writing down before the project has a second contributor","Prevents a rotation-under-pressure scenario (post-incident, or an offboarding developer) from turning into an investigation of 'wait, where did this key even come from'","documentation|secret-provenance|team-knowledge",2026-07-03

Xet Storage Details

Size:
9.09 kB
·
Xet hash:
0a8c85fa6dfb3cbfb2676f6ba9b48130a6b0857ea889df690f4194ddff600b62

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.