From 46874944a726f4353922be69a2c85b5258bfd5b3 Mon Sep 17 00:00:00 2001 From: Petrus Pennanen Date: Mon, 3 Aug 2026 15:57:04 +0200 Subject: [PATCH] gitignore: cover config/*.env, which the .json rule never did Found on the MacBook today: config/grok.env, untracked, unignored, holding a live key, in a checkout of a PUBLIC repo. One `git add -A` away from the same leak as 2026-07-09. Neither existing rule covered it. `config/*.json` is scoped to JSON, and the bare `.env` rule matches a file named exactly ".env" - not "grok.env". So the directory whose own comment says "Local machine configs hold live API keys - never commit" was protecting one file extension and silently not the other. That is the sibling trap: a rule was written for one variant, the variant it was written against stayed safe, and nobody checked whether its neighbour was covered. Verified by execution rather than by reading - `git check-ignore -v` resolves config/grok.env to this rule. Product fix rather than a local one: any user who drops a per-agent .env into config/ has the same exposure today, and a .git/info/exclude on my machine would fix it for exactly one of us. --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 163af78..c8582ea 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,14 @@ data/*.json config/*.json config/*.bak* *.bak.* +# ...and so do the .env variants, which config/*.json above does NOT cover +# and the bare `.env` rule above does not either (that matches a file named +# exactly ".env", not "grok.env"). Found on the MacBook 2026-08-03: an +# unignored config/grok.env holding a live key, one `git add -A` away from +# a PUBLIC repo - the same leak as 2026-07-09, through the sibling nobody +# added a rule for. +*.env +config/*.env # Per-agent poller configs hold live API keys - never commit (leaked 2026-07-09) gemini-config.json gemini-config.json.bak*