-
Notifications
You must be signed in to change notification settings - Fork 31
Redact sensitive information in console logs (stdout & stderr) #889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot Please review the masking functionality in this PR, focusing on the following:
|
…n issues - Extend LogMaskHelper to support stdio masking with registerStdioPattern/registerStdioValue methods - Add stdioPatternReplacer to LogMaskHelper for global stdio masking - Refactor StdIoMaskHelper to delegate to LogMaskHelper instead of duplicating logic - Implement conditional masking based on LogMaskLevel (respects --log-mask option) - Fix MaskingPrintStream using inner MaskingOutputStream to avoid infinite recursion - Register default stdio patterns in FortifyCLIDynamicInitializer focused on user-provided data Co-authored-by: rsenden <8635138+rsenden@users.noreply.github.com>
Refactor stdio masking to reuse LogMaskHelper infrastructure and respect --log-mask level
|
@copilot Do we really need the stdio-specific patterns that are registered from FortifyCLIDynamicInitializer.java? These seem to be mostly related to potential HTTP responses, not user input. Also, I'm not sure whether any cli options (through MaskValue annotation or through mask setting in fcli action yaml files) are now being properly registered for redaction. For example, debricked-scan.yaml defines debrickedAccessToken with mask settings; these are being registered for log masking but possibly not for stdio masking? We'd want LogMaskingHelper to automatically also add these for stdio masking when being registered for log masking. If there's insufficient information as to whether a value/pattern registered for log masking should also be masked for stdio, assume it needs to be masked in both. If in general there's not sufficient info, just simplify the code to mask all registered values/patterns in both logs and stdio. |
- Remove stdio-specific HTTP patterns from FortifyCLIDynamicInitializer - Modify LogMaskHelper.registerValue() to automatically register for stdio masking - Remove explicit StdIoMaskHelper.registerValue() calls from action processors - Remove unused registerStdioPattern() method - Simplify StdIoMaskHelper to focus only on install/uninstall operations Co-authored-by: rsenden <8635138+rsenden@users.noreply.github.com>
Ensure URL-encoded sensitive values are masked in both logs and console output for consistency. Co-authored-by: rsenden <8635138+rsenden@users.noreply.github.com>
Consolidate stdio and log masking to eliminate duplication
fix: Improved console logging by redacting sensitive information from stdout and stderr (fixes #875 )
Please refer to the image below for a sample console output of the

debricked-scanSSC FCLI action.