fix: [PM-19904] Audit Fix#1067
Merged
gilescope merged 8 commits intoApr 10, 2026
Merged
Conversation
400cb68 to
23f290c
Compare
gilescope
approved these changes
Mar 26, 2026
Initial commit for work package. Implementation pending planning and design activities.
8681d9e to
ea3723e
Compare
…into fix/PM-19904-db-connection-details-leaked-in-logs
gilescope
approved these changes
Apr 1, 2026
Signed-off-by: Giles Cope <gilescope@gmail.com>
961804c to
60105ec
Compare
m2ux
added a commit
that referenced
this pull request
Apr 23, 2026
* fix: [PM-19904] redact database connection details from error logs Initial commit for work package. Implementation pending planning and design activities. * fix(PM-19904): redact db connection details from error logs * fix(PM-19904): redact connection details in primitives and update test * test(PM-19904): add redaction verification test in node binary * chore(PM-19904): add change file for db connection detail redaction * fix: Remove intermediate .to_string() call Signed-off-by: Giles Cope <gilescope@gmail.com> --------- Signed-off-by: Giles Cope <gilescope@gmail.com> Co-authored-by: Giles Cope <gilescope@gmail.com> Co-authored-by: Squirrel <giles.cope@shielded.io> Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux
added a commit
that referenced
this pull request
Apr 23, 2026
* fix: [PM-19904] redact database connection details from error logs Initial commit for work package. Implementation pending planning and design activities. * fix(PM-19904): redact db connection details from error logs * fix(PM-19904): redact connection details in primitives and update test * test(PM-19904): add redaction verification test in node binary * chore(PM-19904): add change file for db connection detail redaction * fix: Remove intermediate .to_string() call Signed-off-by: Giles Cope <gilescope@gmail.com> --------- Signed-off-by: Giles Cope <gilescope@gmail.com> Co-authored-by: Giles Cope <gilescope@gmail.com> Co-authored-by: Squirrel <giles.cope@shielded.io> Signed-off-by: Mike Clay <mike.clay@shielded.io>
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
Redact sensitive database connection details (host, port, database name) from error-level log messages in the main chain follower module. This addresses security audit finding PM-19904 (Least Authority Issue AF) — information leakage through verbose error logging.
🎫 Ticket 📐 Engineering
Motivation
When the node encounters a database connection failure, error-level logs previously included the database host, port, and name. These details are routinely collected by monitoring tools and could aid targeted attacks if logs are exposed. This change moves infrastructure details to debug-level logging while preserving the error indication and underlying cause at error level.
Changes
PostgresConnectionErrorfrom 4 fields (host, port, db, error) to 1 field (error only) in bothnode/src/main_chain_follower.rsandprimitives/mainchain-follower/src/data_source/mod.rslog::debug!calls that emit full connection details at debug level for authorized troubleshootingPostgresConnectionErrordirectly frommap_errclosures (no intermediate.to_string())connection_error_redacts_infrastructure_detailsunit test in node crate; rewroteconnection_error_redacts_host_port_and_databaseintegration test in primitives crate to verify redactionchanges/changed/audit-redact-db-connection-logging.mdSubmission Checklist
Fork Strategy