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

remove secret and key from logging #220

Merged
merged 1 commit into from
Feb 25, 2019
Merged

Conversation

Madhu-1
Copy link
Collaborator

@Madhu-1 Madhu-1 commented Feb 21, 2019

Avoid return of the user keys in case of failure.

@gman0 @rootfs @humblec PTAL

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@@ -49,38 +49,39 @@ func closePipeOnError(pipe io.Closer, err error) {

func execCommand(program string, args ...string) (stdout, stderr []byte, err error) {
cmd := exec.Command(program, args...) // nolint: gosec
klog.V(4).Infof("cephfs: EXEC %s %s", program, util.StripSecretInArgs(args))
stripArgs := util.StripSecretInArgs(args)
Copy link
Collaborator

Choose a reason for hiding this comment

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

eventhough its looks ok, I dont find some value for extra variable here with stripArgs. We could directly use util function in the return call. @gman0 thoughts ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@humblec main idea to add a variable to avoid computing time, I didn't want to call util.StripSecretInArgs() multiple times inside same function.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Madhu-1 not sure I get it, can you explain how it helps in avoiding computing time ?.

I didn't want to call util.StripSecretInArgs() multiple times inside same function.

see, either we keep writing util.StripSecretInAgrs() multiple time or we write stripArgs multiple time. I dont see much value here. But I am open for other thoughts.

@rootfs rootfs merged commit e627a61 into ceph:csi-v1.0 Feb 25, 2019
wilmardo pushed a commit to wilmardo/ceph-csi that referenced this pull request Jul 29, 2019
remove  secret and key  from logging
nixpanic pushed a commit to nixpanic/ceph-csi that referenced this pull request Nov 22, 2023
Syncing latest changes from upstream devel for ceph-csi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants