Skip to content

fix: protect credentials in error diagnostics - #375

Merged
baiyuqing merged 1 commit into
mainfrom
baiyuqing/redact-error-diagnostics
Nov 3, 2026
Merged

baiyuqing merged 1 commit into
mainfrom
baiyuqing/redact-error-diagnostics

Conversation

@baiyuqing

Copy link
Copy Markdown
Collaborator

SQL connection failures include the credential-bearing DSN in CLI errors, and upload transport failures can include pre-signed URL credentials. When telemetry is enabled, the first line of an error is also transmitted off-host.

Remove the DSN from connection errors and mask credential-bearing URLs in terminal error output. Reuse JSON redaction for SDK API error bodies, omit non-JSON bodies, and retain HTTP status and trace information. Stop including free-form error messages in telemetry while preserving the failure result.

API response bodies are not inherently secret; disclosure depends on their contents. This change masks known sensitive JSON fields and URL parameters, rather than attempting to identify arbitrary secrets in free text.

Validation:

  • GOWORK=off go test ./internal/redact ./internal/util ./internal/telemetry ./internal/service/cloud ./internal/cli
  • goimports and git diff --check

Regression coverage includes SQL DSNs, wrapped upload URL errors, API body redaction, and omission of telemetry error text.

@ti-chi-bot ti-chi-bot Bot added the size/L label Nov 3, 2026
@baiyuqing
baiyuqing merged commit 0908d5b into main Nov 3, 2026
7 checks passed
@baiyuqing
baiyuqing deleted the baiyuqing/redact-error-diagnostics branch November 3, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant