scala-ssh icon indicating copy to clipboard operation
scala-ssh copied to clipboard

Safe logging

Open jeffdyke opened this issue 6 years ago • 3 comments
trafficstars

This PR changes how commands are logged and its completely opt-in, defaulting to the normal behaviour promiscuous logging. It also adds the actual exception message to the log for easier debugging. I'm completely open to suggestions.

jeffdyke avatar Aug 08 '19 15:08 jeffdyke

Thank you, @jeffdyke, for this proposal. I have the feeling, however, that this is not yet the best approach to solve the problem of "having a way to prevent sensitive data from being logged".

How about giving commands the ability to control their own logging? The default could be a simple .toString (what we currently have) and sensitive commands could construct their own logging output in any way they seem fit, which would usually be a "redacted" .toString or sth like that?

sirthias avatar Aug 12 '19 11:08 sirthias

@sirthias thanks for your input. I'll give this some more time on your comments and clean it up. Looking at your comments i did make it a bit more verbose than i needed, so your view is appreciated.

jeffdyke avatar Aug 12 '19 15:08 jeffdyke

While the comments are meaningfull, they are worthless...you'd likely rather re-review the full diff, i made it much simpler, looking forward to your thoughts, no breaking changes still. Thanks @sirthias!

jeffdyke avatar Aug 13 '19 01:08 jeffdyke