A lot of relay operators run tor from git for various reasons. These relay operators don't get the advantage of distribution log rotation, and can unknowingly leave tor running at low log level for long periods while running test branches. In some cases, SafeLogging may also be disabled.
Presumably, since they are running git, they are upgrading often. Based on this assumption, an easy fix should be to just change the default log file open mode from O_APPEND to O_TRUNC if the loglevel is below notice, and/or if SafeLogging is off.
Of course, a better fix is to implement our own log rotation. I don't think the corner case is that important. It is a non-default config that makes it risky** in the first place.
Thanks to Marcia Hofmann @ EFF for pointing this out.
** (The reason it is risky is not because logs are terribly dangerous to anonymity in their current form, but moreso because logs can be such a false path due to the multiplexing of circuits over TLS.)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Trac: Description: A lot of relay operators run tor from git for various reasons. These relay operators don't get the advantage of distribution log rotation, and can unknowingly leave tor running at low log level for long periods while running test branches. In some cases, SafeLogging may also be disabled.
Presumably, since they are running git, they are upgrading often. Based on this assumption, an easy fix should be to just change the default log file open mode from O_APPEND to O_TRUNC if the loglevel is below notice, and/or if SafeLogging is off.
Of course, a better fix is to implement our own log rotation. I don't think the corner case is that important. It is a non-default config that makes it risky** in the first place.
Thanks for Marcia Hofmann @ EFF for pointing this out.
** (The reason it is risky is not because logs are terribly dangerous to anonymity in their current form, but moreso because logs can be such a false path due to the multiplexing of circuits over TLS.)
to
A lot of relay operators run tor from git for various reasons. These relay operators don't get the advantage of distribution log rotation, and can unknowingly leave tor running at low log level for long periods while running test branches. In some cases, SafeLogging may also be disabled.
Presumably, since they are running git, they are upgrading often. Based on this assumption, an easy fix should be to just change the default log file open mode from O_APPEND to O_TRUNC if the loglevel is below notice, and/or if SafeLogging is off.
Of course, a better fix is to implement our own log rotation. I don't think the corner case is that important. It is a non-default config that makes it risky** in the first place.
Thanks to Marcia Hofmann @ EFF for pointing this out.
** (The reason it is risky is not because logs are terribly dangerous to anonymity in their current form, but moreso because logs can be such a false path due to the multiplexing of circuits over TLS.)
Eh, please no. I use tor from git all the time, and I set up my own logrotate for things where I need it - it's not that hard. Additionally, overwriting a file that might have valuable info in it (for example, if my Tor stopped because it crashed) would be really annoying imo.
See also #5583 (moved). In #5583 (moved), we truncate optionally. Here, we truncate by default if the logging is unsafe. We could combine the two ideas.
I thought this would be a good first issue for me to try and fix, even if it is never implemented.
The above attached patch (submitted by me) truncates the log file when SafeLogging is disabled. It doesn't truncate the log file if the loglevel is less than notice (yet).
I submitted this patch in order to learn more about tor and how to contribute to it. I looked over arlolra's fix to #5583 (moved) and tried to do a similar solution.
You can test my patch by setting the SafeLogging and Log options in a torrc file and verifying that the correct values of SafeLogging will truncate the log file.
I'd just like to know if I'm on the right track and if there's anything I missed. I believe my fix overlooks command line arguments given to tor and only accounts for options set in the torrc file.
EDIT: just noticed my horrible tabbing in config.c, sorry, I won't make that mistake in future patches.
Mike, what does "logs can be such a false path" mean?
I think from a technical perspective, if a relay operator has chosen to log at a more verbose level, we have to assume they're doing it for a reason, and clobbering their log file probably won't help with their reason.
(Also, I think the log rotation thing for packages is a bit of a red herring, since no packages log louder than notice by default anyway.)
From a legal perspective, maybe it would be good in some way to have the default be the more conservative choice? But I would say it is already this way, since the default is only notice, and safelogging 1, etc.
I think by "false path" I meant that the logs provide just enough detail for someone to look at them and assume the wrong thing. ie: "Aha! at the time in question I see that a TLS connection opened to some other node. It must be the next node I'm looking for!"