i will look into it. i am not familiar enough with the building source code to know where this would go. correct me if my assumptions are wrong. iâm thinking about this in regards to vitrualbox and kvm. steps required:
create additional drive for virtualbox or kvm with consistent uuid.
modify /etc/fstab to contain
/dev/disk/by-uuid/[persistent uuid] /var/lib/tor auto defaults,errors=remount-ro 0 2
ensure /var/lib/tor is still owned by debian-tor:debian-tor
Grub wonât boot from second disk indeed but selective persistence fits into grub-live package since itâs related feature? Scripts / systemd unit files could be added there?
This could even be considered as default feature if good enough.
Drop-in snippets in a .d folder could define which files/folders are selective persistence.
(The config snippet to enable /var/lib/tor folder would belong into package anon-gw-anonymizer-config package.)
thank you. iâll explore and let you know my progress. as soon as i get comfortable with the various whonix files lay out, i do not believe this will be too hard. and i am probably going to regret saying that.
Unclear anywhere how this is implemented exactly, but itâs safer to use a blanket amnesic state instead of playing whack a mole with whatever Tor stateinfo (besides DNS) is being cached and where.
Not too hard to research. Put /var/lib/tor under git version control. Or copy folder. Use/reboot a while. Diff.
Maybe written state isnât âmuchâ. Disk avoidance is a goal of the Tor Browser Bundle (TBB). Thereâs been a technical paper on TBB disk avoidance violations.
This is a problem because? How does it affect the fingerprint, where does the attacker/fingerprinter sit, what does he do?
Naturally, if you include persistence you add persistence for malware too. This not only affects the tor process but also possible lower level bugs for filesystems and the likes.
Persistent overlays are a thing and possible with the debian integrated $livestuff but at least for Tails this did break once in a while (maybe not that of a problem if you just use it for Tor). Iâm not sure if out of the box this could be used for just one program.
As an alternative you could just add another live mode indicator which after 3 months or so will spit out a red warning so the user reboots in persistence mode.
ls -la /var/lib/tor/
drwx--S--- 5 debian-tor debian-tor 4096 Dec 17 10:33 .
drwxr-xr-x 42 root root 4096 Dec 12 12:27 ..
-rw------- 1 debian-tor debian-tor 20442 Dec 12 12:06 cached-certs
-rw------- 1 debian-tor debian-tor 2081457 Dec 17 10:27 cached-microdesc-consensus
-rw------- 1 debian-tor debian-tor 3734938 Dec 12 12:05 cached-microdescs
-rw------- 1 debian-tor debian-tor 1295936 Dec 17 10:28 cached-microdescs.new
-rw------- 1 debian-tor debian-tor 0 Dec 17 10:27 lock
-rw------- 1 debian-tor debian-tor 13394 Dec 17 10:33 state
From an anti forensics point of view this leaks times when Tor was used.
Even if we cleared the file access times, it would likely be possible to deduct times when Tor was run from files in that folder (cached-microdescsâŚ).
When Tor parses folder /var/lib/tor/ malware would need to specifically craft a file there to exploit a hypothetical vulnerability in Torâs /var/lib/tor/ parsing code.
Good point.
Reference would be good.
This seems hard to time. Weâd still miss the exact time when itâs time for Tor to change entry guards. Each time after Tor thinks it is time to change entry guards the system boots, Tor will pick random entry guard.
[1] We would need some method to ask Tor âis it time to cycle Tor entry guardsâ or other mechanism to detect that. And if the âanswerâ is âyesâ, in such cases, do not start Tor and show and systray, popup and/or whonixcheck and inform about this.
Selective persistence does not seem to be the answer to implement persistent Tor entry guards in live mode. [1] would be better.
[1] would result in using persistent Tor entry guards. This would play well with Torâs regular schedule To cycle Tor entry guards. It would not have any disadvantages related to malware vs live mode. It however would still be fingerprintable at the internet service provider (ISP) level because such clients would download microdescriptors more often than clients who always booted into persistent mode since these would not be cached on the disk.
perhaps a new custom script is in order? could do a fairly âdumbâ one based off of a âguardrotateâ style file.
first time gateway boot and and tor configuration/connection, create an empty âguardrotateâ file.
set script to run pre-tor connectivity going forward to check for presence of guardrotate file and creation date.
2a. if date is too old, donât start tor and inform user. prompt user if they want to start tor anyways, restart in persistent mode, erase state file, whatever. if new guard mode is selected at this point, create new âguardrotateâ file.
2b. if date is fresh, continue as usual silently.
a somewhat different version could probably check the state file for which guards have an idx number on creation, log those and then promp the user when what is contained in the state file differs from what is logged. main issue here will be that a new guard node will be initially selected in live-mode, with a different one being picked again in subsequent persistent boot.
It cannot be based on file creation time. That is too inaccurate. Otherwise, this still applies:
It needs to parse the same file that Tor is parsing. Probably /var/lib/tor/state. Ideally it would use the same code as Tor is using. Because when Tor Project changes the guard rotation, we might miss it and the script might not be updated in time. But reusing the same code as Tor is using this may not be feasible. We could submit a feature request against Tor Project to add command line command to /usr/bin/tor to add command to only output âtime for guard cycleâ vs ânot time for guard cycleâ.
But even if we had this. Still not perfect. Letâs say the script said ânot time yet to change entry guardâ and assume that judgement would be correct at the time (one or two days too early). Then assume Whonix-Gateway live mode keeps running. Then Tor would cycle to another random entry guard when time has come. Once the user reboots, this entry guard selection by Tor would be lost due to live mode. Then the script would notice that and recommend to reboot into persistent mode. Then yet another entry guard would be chosen. The might however still reduce from many superfluous entry guard cycles to a single superfluous entry guard cycle.
a one time superfluous entry guard cycle is probably preferable to an unknown potentially regular number of guard entry cycles. i like the idea of tor incorporating a feature on this where a notification for a guard cycle is given. could address both the real time use and âon bootâ use.
I canât find what my guard (just 1, right?) in /var/lib/tor/state is.
There a lot Guards listed in /var/lib/tor/state. These are probably just potential entry guards. I also found the fingerprint of 1 entry guard that I am using. It is easily visible in nyx. The entry of a âpotential guardâ vs âmy guardâ does not look different from other âpotential guardsâ.
But I cannot figure out what marks my guard in /var/lib/tor/state as âmy guardâ. Perhaps that is stored in a different location that I donât know. Before finding that out, there is no way to parse/automate anything.