Attempt to sanitize some configurations before we output them#988
Merged
motus merged 14 commits intomicrosoft:mainfrom Jun 12, 2025
Merged
Attempt to sanitize some configurations before we output them#988motus merged 14 commits intomicrosoft:mainfrom
motus merged 14 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a simple redaction step to configuration logging to avoid exposing sensitive values.
- Introduces
sanitize_confto obfuscate the"password"key in any config dict. - Updates two debug‐level logging calls in
config_persistence.pyto use the sanitized config. - Addresses scanner complaints by preventing raw secrets from appearing in logs.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mlos_bench/mlos_bench/util.py | New sanitize_conf function to redact passwords. |
| mlos_bench/mlos_bench/services/config_persistence.py | Import and apply sanitize_conf in debug logs. |
Comments suppressed due to low confidence (2)
mlos_bench/mlos_bench/util.py:467
- [nitpick] Consider renaming
sanitize_conftosanitize_configfor clarity and consistency with theconfigparameter.
def sanitize_conf(config: dict[str, Any]) -> dict[str, Any]:
mlos_bench/mlos_bench/util.py:467
- Add unit tests for
sanitize_confto verify that sensitive keys are redacted correctly and that other fields remain unchanged.
def sanitize_conf(config: dict[str, Any]) -> dict[str, Any]:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Merged
motus
pushed a commit
that referenced
this pull request
Jun 12, 2025
# Pull Request ## Title Fixup some broken links ______________________________________________________________________ ## Description Fixes some broken links preventing the Markdown Link Check CI job from passing. ______________________________________________________________________ ## Type of Change - 🛠️ Bug fix ______________________________________________________________________ ## Testing Existing CI jobs > Note: the currently failing CI job about code scanning is addressed in #988 ______________________________________________________________________
motus
approved these changes
Jun 12, 2025
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.
Pull Request
Title
Attempt to sanitize some configurations before we output them
Description
Address some code scanning complaints and try to sanitize some configs before outputing them.
Type of Change
Testing
Additional Notes
Also includes link fixes from #989