Skip to main content

Your secrets drifted last Tuesday. Would you know?

· 3 min read

Most teams find secrets drift the same way: a deploy breaks, someone digs, and the cause is a value that stopped matching days ago. The harder case is when the thing that should have told you quietly stopped running.

Two ways to find out​

Without a dashboard, you find drift when a deploy breaks. With one, you see it after the next scheduled collector run (every 6 hours by default). Silence is tracked separately: a target that has not reported within the staleness window (26 hours by default) turns stale. env-sync Viewer is built for the second case.

A scheduled collector runs env-sync diff --format json for each entry in an inventory and records the result in Postgres. A read-only web app shows the latest state of every service, env, and target.

Silence is a finding​

A dashboard that counts problems reads "0 issues" when the collector has been dead for a month. Here, a target is stale when it has no healthy snapshot inside the window. The check is per target:

  • One target failing for a long time does not make its healthy siblings stale.
  • A collector that keeps finishing runs does not make a broken target look fresh.
  • A dead collector makes every target stale, so the board turns stale instead of empty.

The first version of the viewer had a query that only looked back 14 days. A dead collector produced an empty, calm page. The final review caught it before anything shipped, and we wrote up how.

The boundaries that matter​

  • Postgres enforces who can do what. The collector role can only INSERT. The viewer role can only SELECT. Everything else is revoked, with FORCE ROW LEVEL SECURITY on all three tables. The suite runs against a real postgres:16.
  • Fingerprints stay on the server. They show which key drifted, so they are also the most sensitive data. The browser only sees match, drift, missing, present, or unverifiable.
  • The collector shells out, it never imports. It depends on the versioned JSON contract of the env-sync CLI. When env-sync moves from TypeScript to Go, you put a different binary on PATH and the collector keeps working.
  • Credential scoping fails closed. Unset means no, not anything goes, so a dropped variable cannot silently turn a control off.

Try it​

There is no hosted instance yet, so you work from a clone of the repository. From the getting started guide:

git clone https://github.com/catesworks/env-sync-viewer.git
cd env-sync-viewer
pnpm install
pnpm build

export DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/env_sync_viewer
pnpm db:deploy

Then start the dashboard:

pnpm --filter @env-sync-viewer/web dev # http://localhost:3054

The getting started guide covers creating the login roles, running the collector (including a no-credential smoke run with a fake env-sync), and the web app settings. The architecture page explains each decision above.

Where it stands​

It is an internal tool. It runs on a schedule against a real Supabase project and one platform's real credentials; a second platform is not enabled yet. The test suite runs against real Postgres 16.