-
Notifications
You must be signed in to change notification settings - Fork 897
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
[V2V] Filter certain options in the ConversionHost#run_conversion method #18852
[V2V] Filter certain options in the ConversionHost#run_conversion method #18852
Conversation
@miq-bot add_label transformation, hammer/yes, changelog/yes |
def run_conversion(conversion_options) | ||
ignore = %w[password fingerprint key] | ||
filtered_options = conversion_options.clone.tap { |h| h.each { |k, _v| h[k] = "__FILTERED__" if ignore.any? { |i| k.to_s.end_with?(i) } } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of this?
filtered_options = conversion_options.each_with_object({}) { |(k, v), h| h[k] = (k.to_s =~ /(fingerprint|key|password)\z/) ? "__FILTERED__" : v }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks more difficult than mine. I'm sure there are multiple ways to skin a cat here, but I'd like to keep mine unless you have strong objections.
Replace sensitive values with FILTERED, and remove unnecessary variable assignment.
Checked commit https://github.com/djberg96/manageiq/commit/a2948baf526df31fbdc4c360e000fb43d06fe938 with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
…ering [V2V] Filter certain options in the ConversionHost#run_conversion method (cherry picked from commit 11c18ab) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1720756
Hammer backport details:
|
At the moment the
ConversionHost#run_conversion
method potentially exposes some sensitive data on failure. This PR filters anything that ends with "password", "key" or "fingerprint" from the logs and/or UI.BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1716415