Skip to content
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

Secure value censorship refactor #2424

Merged
merged 25 commits into from
Feb 19, 2025
Merged

Conversation

awharn
Copy link
Member

@awharn awharn commented Feb 3, 2025

What It Does

Refactors LoggerUtils into a new Censor class to globally use the same list of censored options, and intelligently add options to censor on the fly. Also removes duplication (and deprecates functions) to the old utilities. Points old utilities to use the new utility when possible.

Fixes #2430

How to Test

Make configuration file modifications, adding various properties to the config's secure array.
Any property that is added to the secure array should be hidden when running any Zowe CLI command with --show-inputs-only.

Additionally, run commands with ZOWE_APP_LOG_LEVEL=info and ZOWE_IMPERATIVE_LOG_LEVEL=info environment variables, and view the logs. Any secure property should be hidden in the logs, even if passed in on the command line.

To test the #2430 fix, set ZOWE_SHOW_SECURE_ARGS to true, and run a command with --show-inputs-only. Observe secure values are not masked.

Review Checklist
I certify that I have:

Additional Comments

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.49%. Comparing base (1626aa7) to head (94364f5).
Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2424      +/-   ##
==========================================
+ Coverage   91.41%   91.49%   +0.07%     
==========================================
  Files         639      641       +2     
  Lines       18267    18358      +91     
  Branches     3843     3978     +135     
==========================================
+ Hits        16699    16796      +97     
+ Misses       1566     1560       -6     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
Signed-off-by: Andrew W. Harn <[email protected]>
@awharn awharn marked this pull request as ready for review February 6, 2025 21:47
Copy link

github-actions bot commented Feb 6, 2025

📅 Suggested merge-by date: 2/20/2025

Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments re: minor edits for changelog

Signed-off-by: Andrew W. Harn <[email protected]>
Copy link
Contributor

@anaxceron anaxceron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the changelog update, @awharn, everything looks good

@pjfarleyiii
Copy link

Question from a CLI user: Will this resolve the non-printing of secure user and password values in the output from zowe config list? And if yes, will a new release be posted to the npm registry so that ordinary users can get back the ability to see secure values when really needed?

@adam-wolfe
Copy link
Contributor

adam-wolfe commented Feb 13, 2025

Question from a CLI user: Will this resolve the non-printing of secure user and password values in the output from zowe config list? And if yes, will a new release be posted to the npm registry so that ordinary users can get back the ability to see secure values when really needed?

That was not the intention with this PR, which was mainly to clean up how we determine what should be considered to be a secure property.

However, it's something we should consider (for a future PR). We'll take another look at #2259.

Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all your work on this Andrew! I see there was quite a bit of refactoring done to keep our behavior consistent - its much appreciated 🙏 I had a couple comments from the code review, but wanted to post those ahead of time before continuing with manual testing.

Copy link

Reminder: This pull request has a merge-by date coming up within the next 24 hours. Please review this PR as soon as possible.

@t1m0thyj @gejohnston @zFernand0 @pujal0909 @jace-roell @ATorrise

@awharn awharn requested a review from traeok February 18, 2025 15:10
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Andrew!

Copy link
Member

@t1m0thyj t1m0thyj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @awharn!

@zFernand0 zFernand0 merged commit e80dcd2 into master Feb 19, 2025
19 of 20 checks passed
@zFernand0 zFernand0 deleted the secure-value-censor-refactor branch February 19, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

Inconsistent behavior with ZOWE_SHOW_SECURE_ARGS
8 participants