Skip to content

Conversation

@rioliu-rh
Copy link
Contributor

Summary

Add a showInfo flag to the CLI struct to prevent sensitive data exposure in test logs when executing commands.

Problem

Currently, framework.Logf() always prints command execution details. While RedactBearerToken() helps with tokens, commands like:

oc set data secret mysecret --from-literal=password=supersecret

Still expose sensitive data (passwords, API keys) directly in test logs.

Solution

  • Add showInfo bool field to CLI struct (defaults to true for backward compatibility)
  • Conditionally call framework.Logf() only when showInfo is enabled
  • Implement NotShowInfo() and SetShowInfo() methods for control

Usage

// Suppress logging for sensitive operations
cli.NotShowInfo().Run("set", "data", "secret", "mysecret", "--from-literal=password=secret").Execute()

// Re-enable logging
cli.SetShowInfo().Run("get", "pods").Execute()

Fixes: https://issues.redhat.com/browse/OCPERT-201

This change adds a showInfo boolean field to the CLI struct to prevent
sensitive data exposure in test logs. While RedactBearerToken() helps
with bearer tokens, commands like 'oc set data secret --from-literal=password=secret'
would still expose sensitive data.

Changes:
- Add showInfo field to CLI struct (default: true for backward compatibility)
- Modify start() to conditionally call framework.Logf based on showInfo
- Implement NotShowInfo() and SetShowInfo() methods in util_otp.go
- Initialize showInfo=true in all CLI constructor functions

Usage:
  cli.NotShowInfo().Run("set", "data", "secret", ...).Execute()

Fixes: https://issues.redhat.com/browse/OCPERT-201
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 30, 2025
@openshift-ci-robot
Copy link

@rioliu-rh: This pull request explicitly references no jira issue.

In response to this:

Summary

Add a showInfo flag to the CLI struct to prevent sensitive data exposure in test logs when executing commands.

Problem

Currently, framework.Logf() always prints command execution details. While RedactBearerToken() helps with tokens, commands like:

oc set data secret mysecret --from-literal=password=supersecret

Still expose sensitive data (passwords, API keys) directly in test logs.

Solution

  • Add showInfo bool field to CLI struct (defaults to true for backward compatibility)
  • Conditionally call framework.Logf() only when showInfo is enabled
  • Implement NotShowInfo() and SetShowInfo() methods for control

Usage

// Suppress logging for sensitive operations
cli.NotShowInfo().Run("set", "data", "secret", "mysecret", "--from-literal=password=secret").Execute()

// Re-enable logging
cli.SetShowInfo().Run("get", "pods").Execute()

Fixes: https://issues.redhat.com/browse/OCPERT-201

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from deads2k and p0lyn0mial October 30, 2025 14:56
@rioliu-rh
Copy link
Contributor Author

/cc @stbenjam @sergiordlr

@openshift-ci openshift-ci bot requested review from sergiordlr and stbenjam October 30, 2025 14:58
@rioliu-rh
Copy link
Contributor Author

/test e2e-vsphere-ovn-upi

@rioliu-rh
Copy link
Contributor Author

/test e2e-gcp-csi

@rioliu-rh
Copy link
Contributor Author

/test e2e-gcp-ovn

1 similar comment
@rioliu-rh
Copy link
Contributor Author

/test e2e-gcp-ovn

@rioliu-rh
Copy link
Contributor Author

/test e2e-vsphere-ovn-upi

@rioliu-rh
Copy link
Contributor Author

/test e2e-gcp-ovn

1 similar comment
@rioliu-rh
Copy link
Contributor Author

/test e2e-gcp-ovn

@sergiordlr
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 3, 2025
@rioliu-rh
Copy link
Contributor Author

/verified by @rioliu-rh

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Nov 3, 2025
@openshift-ci-robot
Copy link

@rioliu-rh: This PR has been marked as verified by @rioliu-rh.

In response to this:

/verified by @rioliu-rh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@stbenjam
Copy link
Member

stbenjam commented Nov 3, 2025

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rioliu-rh, sergiordlr, stbenjam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 87710bd and 2 for PR HEAD 8c00829 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 560414a and 1 for PR HEAD 8c00829 in total

@rioliu-rh
Copy link
Contributor Author

/test e2e-metal-ipi-ovn-ipv6

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b115048 and 0 for PR HEAD 8c00829 in total

@rioliu-rh
Copy link
Contributor Author

must-gather related cases are always timeout

@rioliu-rh
Copy link
Contributor Author

/override ci/prow/e2e-metal-ipi-ovn-ipv6

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 4, 2025

@rioliu-rh: rioliu-rh unauthorized: /override is restricted to Repo administrators, approvers in top level OWNERS file, and the following github teams:openshift: openshift-release-oversight openshift-staff-engineers openshift-sustaining-engineers.

In response to this:

/override ci/prow/e2e-metal-ipi-ovn-ipv6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci-robot
Copy link

/hold

Revision 8c00829 was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2025
@rioliu-rh
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 5, 2025
@rioliu-rh
Copy link
Contributor Author

/test e2e-aws-ovn-serial-1of2

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b115048 and 2 for PR HEAD 8c00829 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 5, 2025

@rioliu-rh: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 2d22e87 into openshift:main Nov 5, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants