Skip to content

fix: redact registry password from build failure logs and emails - #5068

Open
Souvik-Cyclic wants to merge 1 commit into
Dokploy:canaryfrom
Souvik-Cyclic:fix/redact-registry-password-logs-4693
Open

fix: redact registry password from build failure logs and emails#5068
Souvik-Cyclic wants to merge 1 commit into
Dokploy:canaryfrom
Souvik-Cyclic:fix/redact-registry-password-logs-4693

Conversation

@Souvik-Cyclic

@Souvik-Cyclic Souvik-Cyclic commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What is this PR about?

The docker login command built for deployments embeds the registry password (printf %s '<password>' | docker login … --password-stdin). When a deploy fails, that command lands in the error message, which is written to the deployment logs and sent in build-failure emails, leaking the password in plain text (#4693).

This adds redactSecrets / redactRegistryPasswords in the registry service and scrubs the application's registry, build and rollback passwords from the error before it is logged or emailed, across the deploy/rebuild/preview paths.

Checklist

Issues related (if applicable)

closes #4693

Screenshots (if applicable)

N/A - covered by a unit test for the redaction helper (apps/dokploy/__test__/registry/redact-secrets.test.ts).

Greptile Summary

The PR prevents application deployment failures from exposing registry passwords through deployment logs, build-failure notifications, or propagated execution errors.

  • Adds reusable redaction for raw and shell-escaped registry passwords.
  • Reconstructs ExecError instances with sanitized fields and removes the nested original error.
  • Applies sanitization across standard deploy, rebuild, and preview-rebuild failure paths.
  • Adds unit coverage for literal, repeated, multiple, shell-escaped, and structured execution-error redaction.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported raw rethrow, nested execution-error, and shell-escaped password disclosure paths are addressed, and no blocking failure remains.

Reviews (4): Last reviewed commit: "fix: redact registry password from build..." | Re-trigger Greptile

Context used:

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 12, 2026
Comment thread packages/server/src/services/application.ts Outdated
@Souvik-Cyclic
Souvik-Cyclic force-pushed the fix/redact-registry-password-logs-4693 branch from 603b1d1 to 3ef7f46 Compare August 12, 2026 19:31
Comment thread packages/server/src/services/registry.ts Outdated
@Souvik-Cyclic
Souvik-Cyclic force-pushed the fix/redact-registry-password-logs-4693 branch 2 times, most recently from 0a990d4 to 2efb669 Compare August 12, 2026 19:37
Comment thread packages/server/src/services/registry.ts
The docker login command embeds the registry password, so when a
deployment fails the command shows up in the error message that gets
written to the deployment logs, sent in build-failure emails, and
carried by the rethrown error into upstream log/queue handlers, leaking
the password in plain text.

Scrub the application's registry, build and rollback passwords from the
error before it is logged, emailed, or rethrown, across the deploy,
rebuild and preview paths.

Fixes Dokploy#4693
@Souvik-Cyclic
Souvik-Cyclic force-pushed the fix/redact-registry-password-logs-4693 branch from 2efb669 to 81afaf4 Compare August 12, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dokploy displaying registry password in server logs (also sent in emails for build failures)

1 participant