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 line logging a secret #88

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ var (
//TODO consolidate ane librarize
func logGRPC(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
glog.V(5).Infof("GRPC call: %s", method)
glog.V(5).Infof("GRPC request: %+v", req)
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering about the exact same issue today, independently of you.

Removing the entire line is too drastic. It also removes less sensitive information.

My conclusion was that logging req entirely is probably okay and may be desired when someone explicitly chooses a high log level. However, such a high log level should not be used in production, which implies adding warnings about it somewhere.

Alternatively, formatting of req could be changed so that it masks the actual secret values.

Note that a similar logGRPC implementation also exists elsewhere (other sidecar apps, the hostpath driver itself). Changing just this one line here would not be enough. I am working on refactoring the code so that logGRPC lives in csi-common.

Copy link
Author

Choose a reason for hiding this comment

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

That seems like the way to go to me too. The TODO suggests the same thing. Let me know if I can help in any way with the refactor 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's discuss the code refactoring in kubernetes-retired/drivers#81

err := invoker(ctx, method, req, reply, cc, opts...)
glog.V(5).Infof("GRPC response: %+v", reply)
glog.V(5).Infof("GRPC error: %v", err)
Expand Down