Page MenuHomePhabricator

[services] Tunnelbroker - Remove all logs connected to `userID`, `deviceID` or `sessionID`
ClosedPublic

Authored by max on Aug 7 2022, 12:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 11:38 AM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Fri, Nov 8, 8:37 PM
Unknown Object (File)
Tue, Nov 5, 2:06 AM
Unknown Object (File)
Oct 7 2024, 12:32 AM
Unknown Object (File)
Oct 4 2024, 8:38 PM
Unknown Object (File)
Oct 4 2024, 8:38 PM

Details

Summary

Logging on every new message can flood output and log files and only have a sense for tracing purposes.
We should remove this log message. Removing user-sensitive logging which includes userID, deviceID or sessionID as well.

Related Linear task: ENG-1491

Test Plan

No test plan, this is just a log message removing.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max published this revision for review.Aug 7 2022, 12:01 PM
max edited the summary of this revision. (Show Details)
max added reviewers: karol, tomek, jon.
services/tunnelbroker/src/Amqp/AmqpManager.cpp
71 ↗(On Diff #15415)

Feel like this should just be changed to DEBUG

max added inline comments.
services/tunnelbroker/src/Amqp/AmqpManager.cpp
71 ↗(On Diff #15415)

Feel like this should just be changed to DEBUG

I was thinking about this too, but to use debug we should rebuild the server from production mode.
Our CI tests will run debug version and this message will flood the output in CI tests.
I think, in case we need to verbose trace something like this it can be added locally when/if the problem occurs.

I was thinking about this too, but to use debug we should rebuild the server from production mode.

Our CI tests will run debug version and this message will flood the output in CI tests.

For CI gates, I don't see a problem, I would rather filter through too many logs than not enough. And 99% of the time we will just want the last ~20 lines before failure anyway.

But the line in question is finishing an "effect", and I think logging it in some manner is the right thing to do.

jon added inline comments.
services/tunnelbroker/src/Amqp/AmqpManager.cpp
71 ↗(On Diff #15415)

Oh, look slike glog doesn't even support a DEBUG log level... odd

https://rpg.ifi.uzh.ch/docs/glog.html

phab says something isn't submitted...

max added inline comments.
services/tunnelbroker/src/Amqp/AmqpManager.cpp
71 ↗(On Diff #15415)

Oh, look slike glog doesn't even support a DEBUG log level... odd

https://rpg.ifi.uzh.ch/docs/glog.html

Yes, we can use VERBOSE instead. But, not sure we need it here.

services/tunnelbroker/src/Amqp/AmqpManager.cpp
71 ↗(On Diff #15415)

in rust I would do something like debug!(...) but this isn't rust. If you don't think this log line provides much value, then removing is fine.

It can always be re-added if amqp behavior needs to be explored.

We also should not be printing anything like deviceID or userID to the log on production. @max, can you think of any other case where this is happening?

I was thinking about this too, but to use debug we should rebuild the server from production mode.

It would be great if we could change the log level while the server is running, but that has some disadvantages. But having to rebuild in order to change log level sounds like a mistake and we should be able to do that - can we start supporting it?

This revision is now accepted and ready to land.Aug 10 2022, 5:52 AM
ashoat requested changes to this revision.Aug 10 2022, 6:58 AM

Any time we are printing something like deviceID, we should be EXTREMELY careful not to enable that in production. I'd be more comfortable if we simply did not have log statements that print things like deviceID and userID in checked-in code.

Separately, pinging my question above, as it's been two days and I still haven't seen a response:

We also should not be printing anything like deviceID or userID to the log on production. @max, can you think of any other case where this is happening?

This revision now requires changes to proceed.Aug 10 2022, 6:58 AM
In D4769#138306, @tomek wrote:

I was thinking about this too, but to use debug we should rebuild the server from production mode.

It would be great if we could change the log level while the server is running, but that has some disadvantages. But having to rebuild in order to change log level sounds like a mistake and we should be able to do that - can we start supporting it?

We can use VERBOSE levels to change the logging levels without rebuilding.

Any time we are printing something like deviceID, we should be EXTREMELY careful not to enable that in production. I'd be more comfortable if we simply did not have log statements that print things like deviceID and userID in checked-in code.

I'm sure that we don't need this sort of tracing information in a production build, that's the main reason to remove such logs from services.

Separately, pinging my question above, as it's been two days and I still haven't seen a response:

We also should not be printing anything like deviceID or userID to the log on production. @max, can you think of any other case where this is happening?

Sorry for the late answer! I've checked all of the LOG(...) invocations and there is no such "tracings" left. This is one that should be definitely removed.
We have a logs containing the deviceID when client validations failed. Like this one.
I'm not sure is it some sort of security flaw in that case and it should be removed as well. Such sort of errors will be thrown only if something is wrong with the validations.

Yes, remove all of those please. All places with deviceID, userID... anything that could be connected to a user. Those logs should all be removed.

max retitled this revision from [services] Tunnelbroker - Remove log on every new message to [services] Tunnelbroker - Remove all logs connected to `userID` or `deviceID`.
max edited the summary of this revision. (Show Details)

Remove all logs with the userID, deviceID or sessionID.

max retitled this revision from [services] Tunnelbroker - Remove all logs connected to `userID` or `deviceID` to [services] Tunnelbroker - Remove all logs connected to `userID`, `deviceID` or `sessionID`.Aug 10 2022, 4:45 PM
max edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Aug 10 2022, 7:21 PM