Skip to content

fix(pii): auth-only secret flags need a credential value (#198) - #203

Merged
DavidGodefroid merged 2 commits into
mainfrom
fix/198-secret-flag-auth
Nov 14, 2026
Merged

DavidGodefroid merged 2 commits into
mainfrom
fix/198-secret-flag-auth

Conversation

@DavidGodefroid

@DavidGodefroid DavidGodefroid commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Fixes #198 (part 3 of DavidGodefroid/locklog#144).

findSecretFlags masked the word after any flag LooksSecret() accepts, so initdb's hint --auth-local and --auth-host came back as --auth-local ⟦secret⟧ --auth-host.

  • A flag secret only through its auth token (--auth, --auth-local, --auth-host; not --auth-token, --auth-key) keeps a known auth method name (peer, scram-sha-256, md5…) and masks any other value (--auth admin:pw from httpie, --basic-auth admin:pw).
  • A bare (unquoted) stop word (and, or, to, the, with…) is never masked as a secret flag's value. A quoted one (--password "and") still is.
  • --auth-token …, --auth s3cr3tT0ken, --password hunter2, --token tok9 stay masked.

Tests: pii.TestSecretFlagAuthAndStopWords (fails on main, passes here); go test ./... green. GUIDE.md and CHANGELOG (Unreleased) updated.

🤖 Generated with Claude Code

DavidGodefroid and others added 2 commits November 14, 2026 11:35
findSecretFlags masked the word after any flag LooksSecret accepts, so
initdb's "--auth-local and --auth-host" hint lost "and". A flag secret
only through "auth" now masks its value only when it looks like a
credential and is no auth method name; a bare stop word is never a
secret flag's value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: "--auth admin:pw" (httpie) and "--basic-auth admin:pw" would
leak through the looksCredential test. Keep only a known method name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DavidGodefroid
DavidGodefroid merged commit 56e7060 into main Nov 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pii: secret-flag heuristic masks the word after --auth-* flags (initdb hint)

1 participant