sec: startup secret validation and centralized log redaction - #759
Open
Dami24-hub wants to merge 1 commit into
Open
sec: startup secret validation and centralized log redaction#759Dami24-hub wants to merge 1 commit into
Dami24-hub wants to merge 1 commit into
Conversation
|
@Dami24-hub Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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 of Changes
Startup Secret Validation Check (Add Secret Configuration Startup Check #692):
validateSecrets()inlistener/src/config/validate-secrets.tsto enforce required secret availability on startup.KNOWN_PLACEHOLDERSlist, rejecting development sentinel values (e.g.changeme,secret,123456,whsec_your_secret_here) in production mode (NODE_ENV === "production").validateSecrets()intovalidateConfig()inlistener/src/config.tsso it runs at bootstrap after structural checks.listener/src/index.tsto specifically catch and logSecretValidationErrorwith field-level diagnostics only.Centralized Log Redaction Policy (Add Sensitive Field Redaction to Logs #691):
listener/src/utils/redact.tswith a centralizedSENSITIVE_KEYSlist,isSensitiveKey(),redactString(),redactValue(), andredactObject()functions.user:pass@host) and Bearer/Token auth header patterns in string values.listener/src/utils/logger.ts'sformatMeta()function so all structured log messages, context objects, and error stack trace metadata pass through redaction before writing to stdout/stderr or log files.debug,info,warn,error) share the same pipeline.listener/src/utils/redact.test.tsverifying that representative secrets, token strings, and auth headers are completely masked to[REDACTED].Issue Resolution
Closes #691
Closes #692
Verification