GeezerVison is showing github.com — fix(identity): keep private keys and password-derived hashes out of auth logs (#6181) by dezren39 · Pull Request #9981 · developing-today/code
Conversation
dezren39
commented
Nov 14, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes the remaining live half of #6181 on current main. The SSH (cmd/ssh) and web (web) surfaces were already cleaned and carry AST guard tests; the transitive helper package the SSH path calls — pkgs/identity/auth — still wrote credential material to the log:
InsertPrivateKey logged the base64-encoded ed25519 private key (privateKeyString) in three places.
InsertHashPublicKey / GetPublicKeyFromHash logged the password-derived SHA-256 hash (hash) — a replayable password equivalent in this scheme, since the hash is what the gateway looks keys up by.
InsertTextPublicKey / GetPublicKeyFromText / GetPublicKey logged the same derived value as text.
This is exactly the scope gap task 10653 was blocked on in 2026-11-06; its preserved WIP branch no longer exists, so the fix was redone against current main.
Changes
pkgs/identity/auth/auth.go: the seven log calls above now emit only non-secret metadata (key type, hash/text type, public key string, ids, rows affected). Private-key material and password-derived values no longer reach any log record. Storage behavior is unchanged — the values are still written to the DB, just never logged.
pkgs/identity/auth/auth_logging_test.go (new): AST guard mirroring the existing cmd/ssh and web suites — fails if a logger call in the six credential-handling functions references pk, privateKeyString, hash, text, or password, or a field of those names.
Tests
go test ./auth ./web ./cmd/ssh — all pass, including the new guard.
go build ./... for the identity module fails in a pre-existing, unrelated place (the charm fork's module-cache copy references undefined migration symbols); the three affected packages build and test clean.
Closes #6181 (with the already-landed ssh/web halves).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- Bug Fixes
- Authentication logs no longer include private-key material or supplied hash and text values. Public-key logging now reports only the public-key type and representation.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary: ❌ Failed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
❌ Failed 2026-11-14T12:29:52.675622Z We couldn’t complete this review. Comment @codex review to try again. |
409458a |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 14, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Authentication logging now omits private-key material and selected hash and text inputs. A new AST-based test checks six authentication functions for credential-bearing arguments in recognized logger calls.
Changes: Authentication Log Redaction
| Layer / File(s) |
Summary |
Redact authentication log inputs and test logger calls pkgs/identity/auth/auth.go, pkgs/identity/auth/auth_logging_test.go |
Authentication log messages omit private-key, hash, and text inputs. The test parses the six functions and checks recognized logger calls for listed credential-bearing identifiers and string fields. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Merge Risk: Minimal · up to 40945
-
This change removes private-key and password-derived values from authentication logs without changing storage or lookup behavior. No merge-blocking risk was found.
Pre-merge checks: 3 · 1
-
Failed checks: 1 inconclusive
| Check name |
Status |
Explanation |
Resolution |
| Linked Issues check |
 |
Issue #6181 requires that no credential material reach authentication logs. It also requires acceptance tests that capture logs during SSH password auth, keyboard-interactive auth, and /set-cookie wit… |
Provide evidence for the SSH password, keyboard-interactive, and /set-cookie log paths at head. Show that they emit no credential values. Show runtime or sentinel-based log-capture tests for those paths, or for the auth package. Show error-… |
Passed checks: 3 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title names the change: keeping private keys and password-derived hashes out of authentication logs. This matches the summary, which describes removing private-key and hash or text input from log … |
| Out of Scope Changes check |
 |
All changed code is in pkgs/identity/auth. The diff removes credential values from seven log calls. It adds one AST guard test in the same package, which checks those log calls. Storage statements and… |
Full details: Title check
-
Explanation
The title names the change: keeping private keys and password-derived hashes out of authentication logs. This matches the summary, which describes removing private-key and hash or text input from log calls in pkgs/identity/auth/auth.go and adding a test that guards those logger calls. The title's #6181 reference points to the linked issue. The title is about 85 characters, so it is a bit long but still clear.
Full details: Out of Scope Changes check
-
Explanation
All changed code is in pkgs/identity/auth. The diff removes credential values from seven log calls. It adds one AST guard test in the same package, which checks those log calls. Storage statements and lookup logic are unchanged. The changes implement the auth-package part of #6181 and do not introduce unrelated behavior.
Full details: Linked Issues check
-
Explanation
Issue #6181 requires that no credential material reach authentication logs. It also requires acceptance tests that capture logs during SSH password auth, keyboard-interactive auth, and /set-cookie with a valid JWT, and assert that each sentinel credential is absent. It also requires error-path coverage for invalid tokens.
Verified at head, in pkgs/identity/auth/auth.go (diff against merge base): the seven log calls in InsertPrivateKey, InsertHashPublicKey, GetPublicKeyFromHash, InsertTextPublicKey, GetPublicKeyFromText, and GetPublicKey no longer log privateKeyString, hash, text, or password values. They log only key type, hash_type, text_type, and public key strings. The base64 and privateKeyString usages remain only for storage.
Verified at head, in pkgs/identity/auth/auth_logging_test.go: a new AST guard checks logger calls in those six functions for credential-bearing identifiers and string fields. This is a static check, not the runtime log-capture test with sentinel values that the issue specifies.
Not verified: the SSH (pkgs/identity/cmd/ssh) and web (pkgs/identity/web) fixes that the PR description says already landed. This PR does not change those files. Their runtime log behavior and the invalid-token error-path behavior were not inspected at head within the inspection limit. Sentinel-based runtime log-capture tests were not found in this PR.
Resolution
Provide evidence for the SSH password, keyboard-interactive, and /set-cookie log paths at head. Show that they emit no credential values. Show runtime or sentinel-based log-capture tests for those paths, or for the auth package. Show error-path coverage where invalid-token errors do not echo the submitted credential.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
81914789-39aa-4ce5-bd8b-3e399bf2d9cd
Commits
-
Reviewing files that changed from the base of the PR and between e9cf612 and 409458a.
Files selected for processing: 2
-
pkgs/identity/auth/auth.go
pkgs/identity/auth/auth_logging_test.go
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Merging under the standing criteria: the affected packages' full test suites pass locally (go test ./auth ./web ./cmd/ssh, including the new AST guard in this PR and the pre-existing ssh/web guards), the PR is CLEAN/mergeable, and there are no review findings to disposition — Codex reviews are currently failing repo-wide on usage limits (observed on PRs #9944 and #9969 earlier today: status failed, zero findings), and no Codex review has been produced for this PR. The change is log-line-only in pkgs/identity/auth plus a test; no behavior or storage change.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 14, 2026
This was referenced Nov 25, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|