-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anonymizing hostname doesn't work on Debian 11 minimal sys-net #217
Comments
Relevant discussions ans posts https://forum.qubes-os.org/t/change-mac-address-and-hostname-by-default/13182/10?u=insurgo |
Basically, what seems to be the conclusion here is that by default, Qubes is not shouting "I'm sys-net" anymore. On a fingerprinting perspective, dhcp fingerprint will differentiate Fedora from Windows already (see p0f and other fingerprinting projects, FingerBank being another). So the question here is "lowering presence disclosure" on the network. How many Linux distributions don't expose hostname anymore? I do not know anymore. Before it was a thing and the hostname pattern was a thing to fingerprint people. Now if fedora defaults changed, most probably CentOS and RedHat reuses the same defaults. So the real question here is who outside of Windows are still exposing hostname? And if randomizing hostname in a Windows fashion would be enough to lower automatic system classification from a NAC perspective. As said elsewhere, when looking on my own DHCP logs and reported hostnames on my WiFi AP, lots of OSes are not exposing hostnames through dhcp calls. Nowadays, I see Windows devices and Android devices reporting hostnames. The other variates and I have not inspected those devices OS nor dhcp specifics. But since all this BYOD movement, and back to the when p0f/dhcp fingerprinting was a thing, hostname alone was no more then a queue into information gathered for classification. So basically: my take on this is that not disclosing hostname should be enough, where sys-net being disclosed was the real issue. Combined with MAC randomization on WiFi by default on 4.1 resolves the most problematic privacy issues that were present on Qubes presence. After that, if we are worried that Fedora can be fingerprinted, or Linux on a larger level, a lot of other things should be done to accomplished that goal. Now, looking at the slowed pace of development on those fingerprinting technologies, I think it is safe to say that fingerprinting still occurs on many other levels, while hostname nondisclosure might be enough here, and where mimicking Windows, while looking as a good idea, might be totally useless in practice. Would have to pop PacketFence, pay for their fingerbank subscription and play there to see if your device gets correctly fingerprinted. My intuition here would be that you would be classified as RedHat/Fedora/Centos because of dhcp quirks, not hostname. |
That's why I opened the PR. When I applied the changes, Qubes still shared the hostname with the network. I verified this with Wireshark
Qubes, apparently. At least according to my Wireshark output
It would be, if that were actually the behavior I got
That's fair. But it's better to at least make the attacker work to identify your device The process I used to test is pretty simple. I followed the instructions, then connected to my network with Wireshark running on a physically-separate system on the same network. Searching through the logs for my NetVM's hostname confirmed that my NetVM was, in fact, sending its hostname to the network. It's also worth noting that I tested on a Debian 11 template, since Fedora templates don't seem to detect my wireless card |
Hm interesting. I run on a debian 11 template as well and it works for me. I admit I checked on router level DHCP logs only though. I'll check with wireshark and report back... |
No, I cannot confirm this. the DHCP communication I noticed (filter wireshark for
None of these had my I see a few reasons why your results might be different:
|
|
So Debian-11 behavior is not the same as Fedora, which is reported under #7701. More specifically: QubesOS/qubes-issues#7701 (comment)
So the issue here is to either have a dhcp-client.conf or not, and depending on the dhcp client deployed in template or not, a different behavior. My point in that issue is that the behavior should be the same across all templates if Qubes OS wants to claim that hostname is not leaked, and then unifying the config (or lack thereof in case of Fedora vs Debian) so that randomization works on top of said different used DHCP clients, or that config not being needed by default. Putting a config in place doesn't mean its parsed not used, which seems to be the case here, and would require to dig back into what is deployed under which templates to make the point addressed by devels. So dhclient vs isc client must lead to different behaviors, different fingerprinting possibilities, and more documentation being produced to differenciate those templates needs for hostname randomization. On Fedora's dvm sys-net:
So the behavior there comes plainly from NetworkManager, without any other client at play and without a dhcp-client.config my guess is that @3hhh tested and reported from default Fedora template's based sys-net, which I also tested and report no hostname being leaked. I would recommend renaming the issue to scope to debian templates, or if you are willing to test other templates, extend the scope to non-Fedora templates based sys-net defaults (leak/non-leak defaults) and anonymizing hostname on those/proposing to change deployed dhcp client tools to being the same for all. |
Well, I'm sorry, but I cannot reproduce your issue.
|
```
***@***.*** ~]$ sudo journalctl --boot 0 | grep -i dhcp
Oct 20 17:20:03 sys-net NetworkManager[495]: <info> [1666300803.8714] dhcp-init: Using DHCP client 'internal'
```
Interesting. Mine on debian is
```
Oct 21 07:18:04 d-sys-net NetworkManager[500]: <info> [1666329484.7053] dhcp-init: Using DHCP client 'dhclient'
```
|
I double checked the salt state I apply to my It creates two root-owned 644 files:
|
So all of the above needs to be applied to the base template, i.e. |
@tlaurion I just tested on I didn't create a tcpdump for fedora though. EDIT: I didn't create the /etc/dhcp/dhclient.conf file on fedora. |
@3hhh :
Might have removed it....?
Files under /etc/NetworkManager
What files are provided by which package:
File integrity deviation report from rpm on packages providing the files in question (and other files provided by such packages):
Extract from man rpm:
So /etc/NetworkManager/NetworkManager.conf was touched after deployment, but I do not recall having removed anything... Sorry if I did? files under /etc/dhcp:
None. Checking console history of fedora-36-dvm:
Yes. I added ethernet mac randomization which fits my work use case (and to me is a safer default). Other than that, the files there are as deployed per packages:
To be confirmed by others: Uncommented content of that file on my side:
What is the output of sudo I'm sorry if my results are different, I might have modified something under my setup, but I do not remember doing so? sys-net Dispvm based on fedora-36-dvm... |
@tlaurion Maybe I'm missing something obvious here... but what is the point you want to make? I'm asking because I can see from the below that you did not deploy the
I have never tested whether the hostname is not sent without the Side note: My |
One can configure their workstation so ultimately |
LOL. I just realized that neither It would be nice if someone could verify this, but I think @tlaurion already did it above for I'll go back to the defaults and run them for a while. If that's true, the guide can be removed entirely. |
@3hhh let's remember the name of the issue here: "Anonymizing hostname doesn't work". Randomizing hostname is not the same as Anonymizing, which if hostname doesn't leak would fulfil this ticket purposes. This is why I didn't reply yet: having faced weird behavior trying to install new templates from upstream documentation (qubes-dom0-update redirects to qvm-template and fails, currently). That is cheap justification on my side, I could restore templates from backup and go from there, but I'm reducing my involvements that cannot be replicated because upstream bugs are not fixed for the moment. Otherwise things cannot be properly replicated by anybody with additional efforts and knowledge, that should not be required. Consequently, I did not confirmed nor infirmed with prior replies, that Fedora 36 defaults are anonymizing hotstname (not leaking it) on default installation as of now. And I'm sorry for the confusion. My setup doesn't leak hostname. But that is not proof of anything. Randomizing hostname is a different issue and should be dealt with separately. My take here is that this issue should be closed when replicating and validating behavior from fresh downloaded templates is possible, confirming no hostname is leaked from sys-net through tcpdump at least on Qubes default deployed templates (Debian-11 Fedora-36), while some push should be done for other Qubes installable templates that could be used to create sys-net from. My interest here is that defaults should do the right thing in regard of this issue. |
That's the output I got, after following the instructions to not send hostnames on my sys-net. You can see I already had my hostname randomized prior to trying to hide thr hostname entirely
Yeah, even if/when I get my sys-net to not send its hostname, I think I'm gonna keep hostname randomization in-place as a fallback in case something goes wrong with NetworkManager. It's also much easier to verify that a hostname is randomized, as opposed to verifying in a PCAP that it's not being sent
I checked on my own sys-net in case maybe a recent update fixed this. Still no luck, it's sending the hostname just like it was when I created this issue. But after trying on a completely-unmodified Debian 11 standard template, it seems my hostname is indeed not being sent So this issue appears to be specific to cases where sys-net is based on a minimal template. |
Well, it would be nice to identify the root cause of the different behaviour across templates then. |
I discuss this issue in this thread https://forum.qubes-os.org/t/anonymizing-mac-address-documentation-clarification/14731/4 Based on my observations NetworkManager behaves differently to its documentation with regard to hostname sending. The current Qubes documentation for anonymizing hostname doesn't actually do anything on debian-11. |
@NobodySpecial256 Do you happen to have an @feffiboujike identified that having that file results in the hostname being sent by |
The reason the hostname is not being sent on debian-11 is because /etc/hostname (the static hostname) file is missing (it needs to be present when NetworkManager service is started). I can't confirm what is happening on Fedora or debian-11-minimal but I would say the reason hostname is or is not being sent is due to that file. You can run the command nmcli general hostname to see what hostname NetworkManager is using. If the hostname is blank then nothing will be sent. It is a good thing that this file is missing because I don't believe there is any other way to prevent the hostname being sent globally until https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/584 is resolved. The current method of switching to dhclient and commenting out the send host-name line is not a solution. If the /etc/hostname file is present then dhclient will still send a hostname, regardless of how dhclient is configured. There is another suggestion on the forums that removing dhclient.conf should prevent hostname sending, but this doesn't work either. It would be good to alert the Qubes developers about this so that they don't introduce an /etc/hostname (at least not until the NM bug is resolved). |
Mostly based on discussions with @feffiboujike on the [forum](https://forum.qubes-os.org/t/anonymizing-mac-address-documentation-clarification/14731). References Qubes-Community#217
If the behavior is dependent on the hostname file being missing, would a missing hostname not be a giveaway that the user is running Qubes? Since every desktop Linux distro has a hostname file by default For this reason, perhaps hostname randomization still makes sense to include |
If the behavior is dependent on the hostname file being missing, would a missing hostname not be a giveaway that the user is running Qubes? Since every desktop Linux distro has a hostname file by default
IIRC Qubes OS doesn't explicitly delete host OS files.
For this reason, perhaps hostname randomization still makes sense to include
If you still want it, generate a random `/etc/hostname` file before it is read by `NetworkManager`.
Anyway this issue can be closed unless the OP disagrees IMHO.
|
I'm this issue's OP and I disagree. I still have some unaddressed concerns within the scope of this issue:
Even if Qubes doesn't explicitly delete the hostname file, the file's presence differs on Qubes vs bare-metal installs of the same OS a template is based on. This behavior difference can determine a user to be running Qubes regardless of the means by which the difference originated. So if we really want Qubes users to blend in with other users on a network (or at least other Linux users), it might make more sense to set the hostname to something plausible
This is what I do currently with my Putting a "standard" method of randomizing hostnames into this guide, something that isn't identifiably unique to Qubes users or people who follow the specific method, could solve this issue. Assuming that's the path taken, I might suggest Windows-style hostnames because it's easy to generate a convincingly Windows-like hostname, whereas most Linux distros ask users to specify hostnames at install-time, and defaults almost always contain information about the hardware running the OS. This makes it much more difficult to programmatically and randomly generate convincing hostnames On a related note, I take issue with the randomization process this repo used to recommend. Almost nobody in the wild will have a hostname matching the pattern generated by the script, as no OS generates similar-looking hostnames by default. Users could easily be singled out by the fact that they run the hostname randomization script, without even basic effort to fingerprint systems. This is why I prefer Windows-style hostnames, and I consider it a basic requirement for the hostnames to at least look convincingly like some other OS If the goal is to simply make all Qubes users look alike, allowing networks to see I might add that while the current behavior of NetworkManager is to hide hostnames when the hostname file is missing, it's already been established that this is undocumented behavior and can change in a future update without warning. Do we really want to rely on undocumented behavior? Do we expect users to re-check that their hostname is still anonymized every time NetworkManager receives an update? |
I believe we've already had that discussion multiple times and apparently we cannot come to a single conslusion. So do what you like and feel free to document that as an alternative and maintain it. I won't do it for you though. Anyway the original issue seems to be resolved as I haven't heard you state that the current |
Content moved to https://forum.qubes-os.org/c/guides/14. |
After following the instructions to anonymize my hostname, a test with Wireshark revealed my hostname wasn't being anonymized. Perhaps reverting 4ea74ce could be useful, as randomizing my hostname works for me without issue.
Additionally, hiding your hostname entirely might be counterproductive, as it's easier to spot a device that doesn't send any hostname than it is to spot devices with randomized hostnames. Especially since most Windows devices have randomized hostnames set at install time, random hostnames will be less suspicious in a PCAP
The text was updated successfully, but these errors were encountered: