50% off your first month.Start now →
Muster.
← Checklists

checklist

Fix a secret key committed to source

A live API key in your repo is compromised the moment it's pushed. Rotate first, then remove it, then stop it happening again.

Rules: `secret/*` (Stripe, Anthropic, OpenAI, AWS, GitHub, Slack, Google, SendGrid, private keys)

What muster-check saw

``` CRIT AWS access key ID committed to source src/api.ts:3 AKIAABCDEFGH… ``` The match is a live-key shape (e.g. `AKIA` + 16 chars). The tool only prints the first 12 characters.

Why it matters

A key in git history is readable by anyone with repo access, forever, including after you delete the line. If the repo is or was public, assume it was scraped. If the file ships to the browser, severity is raised to critical because every visitor can read it.

Fix, in this order

  1. Rotate the key at the provider first. Deleting the line does not un-leak it.
  2. Move the new key to a server-only environment variable (`process.env.STRIPE_SECRET_KEY`, no public prefix). Add `.env*` to `.gitignore`.
  3. Remove the old value from code. Optional: rewrite history with `git filter-repo` only after rotation, since forks and clones keep the old value.
  4. Add the check to pre-commit: `npx muster-check --fail-on critical`.

```ts // before const stripe = new Stripe("sk_live_…"); // after (server code only) const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!); ```

Prove it's fixed

Limits (be straight about them)

muster-check matches key shapes; it won't find a key that has an unusual format or sits in a binary/ignored file.

Run this checklist automatically, on every deploy.

Muster proves each finding with the exact request that worked and the fix that closes it. First findings in about 10 minutes, free.

Start free →