Repository navigation
fix(server): apply credential redactor to tenant-registry wire-projected reasons (#1330) - #1336
Merged
Merged
Conversation
…ted reasons (closes #1330) Stage 4 of #1269 introduced redactCredentialPatterns and applied it to the dispatcher's `err.message → details.reason` projections. Code-reviewer flagged additional sites in tenant-registry.ts that bypass the redactor — TenantStatus.reason flows to the wire via the admin router (GET /tenants/:id, POST /tenants/:id/recheck), and three sites projected upstream err.message into the reason without scrubbing. Fixes four sites: - src/lib/server/decisioning/tenant-registry.ts:399 — JWKS fetch failure - src/lib/server/decisioning/tenant-registry.ts:416 — JSON parse failure - src/lib/server/decisioning/tenant-registry.ts:834 — validator throw - src/lib/server/decisioning/admin-router.ts:94 — recheck route 500 The redactor is idempotent, so propagation paths that concatenate upstream reasons (tenant-registry.ts:850, 856) are automatically safe once the upstream sites redact. 4 new tests at test/server-decisioning-tenant-registry-redaction.test.js: Bearer redaction, labeled-credential redaction, URL-embedded credential redaction (password stripped, scheme + user preserved), benign-error pass-through. Full suite: 7449 pass, 0 fail. Closes #1330. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 32420086 | Triggered | Generic High Entropy Secret | 1e783d5 | test/server-decisioning-tenant-registry-redaction.test.js | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #1330. Phase 1 Stage 4 of #1269 introduced
redactCredentialPatternsand applied it to the dispatcher'serr.message → details.reasonprojections. Code-reviewer flagged additional sites intenant-registry.tsthat bypass the redactor —TenantStatus.reasonflows to the wire via the admin router (GET /tenants/:id,POST /tenants/:id/recheck), and three sites projected upstreamerr.messageinto the reason without scrubbing.What's fixed
Four sites:
src/lib/server/decisioning/tenant-registry.ts:399— JWKS fetch failure. Network errors can echo basic-auth-bearing URLs (https://user:pass@vendor/...) or upstream-library diagnostics that include credential bytes.src/lib/server/decisioning/tenant-registry.ts:416— JSON parse failure on JWKS body. Body fragments could include credential strings.src/lib/server/decisioning/tenant-registry.ts:834— adopter validator throw. Custom validators may include credential bytes in their error messages (e.g., a wrapped HTTP-fetch library that echoes the request URL).src/lib/server/decisioning/admin-router.ts:94—recheckroute's catch-all 500 handler. Same posture as the validator throws.Idempotent propagation
The redactor returns already-redacted strings unchanged, so propagation paths that concatenate upstream reasons (
tenant-registry.ts:850, 856) are automatically safe once the upstream sites redact. No additional changes needed at those sites.Test plan
npm run typecheckclean.test/server-decisioning-tenant-registry-redaction.test.js— 4/4 pass:Bearer <token>→ token redacted.token=value→ labeled credential redacted.test/server-decisioning-tenant-registry.test.js(existing) — 75/75 pass with redaction in place.npm run format:checkclean.Cross-links
redactCredentialPatternswas introduced)🤖 Generated with Claude Code