425c299359
v1: discover → migrate → expiry tracking → sealed export/import. - vault: memguard mlock/DONTDUMP arena, handle indirection, zeroize-on-drop - discover: registry + 8 read-only scanners (aws, env, netrc, ssh, docker, kube, git) and a file/dir harvester (--path) - sink: gopass streaming insert; length-prefixed bundle framing; Sealer interface with three impls — age (default, authenticated), hmac (authenticated, openssl-only encrypt-then-MAC), openssl (CBC fallback, unauthenticated; OpenSSL 3.x enc refuses AEAD) - policy: local expiry engine, 60d/8w threshold parser - audit: redacted append-only JSONL, injectable clock - export/import: passphrase from no-echo prompt or $INCREDIGO_PASSPHRASE into locked memory; secrets stream gopass<->Sealer as bytes, never Go strings - tests: scanner leak-checks, vault zeroize, bundle round-trip via fake gopass; go test ./... green, -race clean Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.5 KiB
2.5 KiB
credrot — dev handoff (resume on laptop)
Handed off from the phone (Termux/proot) session on 2026-06-15. Continue dev here.
What this project is
A local-first, encrypted, RAM-only credential custody tool. It discovers creds
from common local locations, migrates them into gopass (GPG) without plaintext
ever touching disk, and tracks their age. Full architecture + threat model in
DESIGN.md; overview in README.md.
Locked decisions (already made with the user — don't relitigate):
- Language: Go.
- v1 scope: discover + migrate + expiry tracking. Provider rotation = v2, behind
a
Rotatorinterface. - openssl's role: sealed export/backup format only (gopass/GPG is the live
store). No double-wrapping.
Sealeris an interface soagecan drop in later.
Current state
- ✅
DESIGN.mdcomplete. - ✅ Go scaffold written (~942 LOC). Working:
scan,migrate,status; scannersaws+env; vault (memguard), gopass sink, openssl sealer, policy, audit. - ⚠️ Never compiled — the phone had no Go toolchain. Treat as unverified.
- 🟡
export/importare stubbed (return "not implemented — see DESIGN.md §3.3").
Next steps (suggested order)
- Get to a green build:
go mod tidy && go build ./cmd/credrot. Fix whatever the compiler finds (memguard API surface is the most likely culprit — verifyNewBufferFromBytes,LockedBuffer.Bytes(),Destroy,CatchInterrupt,Purgeagainst the installed version). - Implement
export/importper DESIGN.md §3.3: streamgopass show→Sealer.Sealviaio.Pipe, passphrase from a locked buffer; define the record format (length-prefixedpath\0secretis fine). Reverse for import. - Add scanners:
netrc,ssh,docker,kube,git— seedocs/ADDING_A_SCANNER.md. One file each. - Tests: table-driven scanner tests with temp-dir fixtures; assert no secret
substrings leak into
Identity/Meta. A vault test asserting zeroize. - Repo hygiene:
git init. Per the user's rule, push to gitea only, never GitHub.
Gotchas carried over
- Don't copy secret bytes into Go
strings or heap slices that outlive immediate use — defeats the RAM-only guarantee. Pipevaultbuffers straight to stdin. - Scanners must stay strictly read-only (
O_RDONLY). - openssl
encGCM/PBKDF2 is finicky across versions; if it fights you, swap the defaultSealertoage— nothing else changes.