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

Inconsistent behavior with ZOWE_SHOW_SECURE_ARGS #2430

Closed
adam-wolfe opened this issue Feb 6, 2025 · 2 comments · Fixed by #2424
Closed

Inconsistent behavior with ZOWE_SHOW_SECURE_ARGS #2430

adam-wolfe opened this issue Feb 6, 2025 · 2 comments · Fixed by #2424
Labels
bug Something isn't working new The issue wasn't triaged yet

Comments

@adam-wolfe
Copy link
Contributor

Describe the bug

If I set ZOWE_SHOW_SECURE_ARGS to true and run a command with the --show-inputs-only flag, I am able to see things like passwords and token values, however I am not able to see other fields that I have included in my secure array. I would expect all secure fields to be printed if I have ZOWE_SHOW_SECURE_ARGS = true.

Expected and actual results

Example where I have host, port, base-path, protocol, and token-value in a secure array (running Zowe CLI 8.12.0):

With ZOWE_SHOW_SECURE_ARGS = false:

PS C:\> zowe files list ds IBMUSER --show-inputs-only
Some inputs are not displayed:
Inputs below may be displayed as '(secure value)'. Properties identified as secure fields are not displayed by default.

Set the environment variable ZOWE_SHOW_SECURE_ARGS to 'true' to display secure values in plain text.

commandValues:
  host:                (secure value)
  port:                (secure value)
  reject-unauthorized: false
  base-path:           (secure value)
  protocol:            (secure value)
  show-inputs-only:    true
  token-type:          apimlAuthenticationToken
  token-value:         (secure value)
optionalProfiles:
  - zosmf
  - base
locations:
  - C:\Users\me\.zowe\zowe.config.json

With ZOWE_SHOW_SECURE_ARGS = true:

PS C:\> zowe files list ds IBMUSER --show-inputs-only
commandValues:
  host:                ****
  port:                ****
  reject-unauthorized: false
  base-path:           ****
  protocol:            ****
  show-inputs-only:    true
  token-type:          apimlAuthenticationToken
  token-value:         eyfaketokenvalue123
optionalProfiles:
  - zosmf
  - base
locations:
  - C:\Users\me\.zowe\zowe.config.json

Note that the token value is displayed, but my other secure properties are shown as ****, which is not what I would expect.

Describe your environment

Additional context

@adam-wolfe adam-wolfe added bug Something isn't working new The issue wasn't triaged yet labels Feb 6, 2025
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Feb 6, 2025
Copy link

github-actions bot commented Feb 6, 2025

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@awharn
Copy link
Member

awharn commented Feb 6, 2025

This is because CommandResponse's console APIs run the output of a command through LoggerUtils.censorRawData, which will try to censor any of the secure property values. Logic will need to be added to CommandResponse to conditionally skip that step if the environment variable is present. As we do not want to log the values, we do not want to make that change in LoggerUtils.censorRawData or in Logger. Note that this will apply to all commands.

@github-project-automation github-project-automation bot moved this from New Issues to Closed in Zowe CLI Squad Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new The issue wasn't triaged yet
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants