ZOOKEEPER-5058: Remove special characters from ensemble name before logging in EnsembleAuthenticationProvider#2409
ZOOKEEPER-5058: Remove special characters from ensemble name before logging in EnsembleAuthenticationProvider#2409anmolnar wants to merge 4 commits into
Conversation
PDavid
left a comment
There was a problem hiding this comment.
Thanks for this fix. 👍
Just a question: Would it be a enough to not log the client input itself - e.g. the unexpected ensemble name here?
What is the advantage of logging the wrong ensemble name?
Thanks for the review. That's actually a very good point! |
There was a problem hiding this comment.
My 0.02 - it seems like ensemble name could be useful for troubleshooting purposes. Given we have this issue for logging of other externally controlled data perhaps we could map to eg "*" (via subroutine used across the codebase) and indicate in the log string itself that the name may be masked? Perhaps a general such note in the documentation somewhere that says along the lines of "We may mask certain logged externally controled fields with '*' to protect against log corruption" (not sure the technical term to be used here... ).
|
I see that this is a trade-off: it can be useful if we log it. If we don't log it, it is more secure. We could use the Or how about integrating https://github.com/augustd/owasp-security-logging/wiki/Log-Forging |
|
I like the logback approach too. |
|
Made the changes. I think the downside of that is we don't have control over it, needs additional administrative task if user doesn't use our sample config and it introduces a new dependency. Apart from those, it works fine. |
|
Looks like the change causes some problems in other unit tests too. |
cc @phunt @ztzg