-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
nixos/networkmanager: remove networking.networkmanager.dynamicHosts #71337
nixos/networkmanager: remove networking.networkmanager.dynamicHosts #71337
Conversation
@flokli I commented on #71322 before seeing you opened this PR: #71322 (comment) I like to hear a little bit more about why you think this particular option is such a security risk that it needs to be removed from nixpkgs. I agree with you on the flaws in its implementation (possibly misusing But security-wise: The option is disabled by default, and a user has to explicitly enable it and make a decision on which |
Moved from @rickynils #71322 (comment):
|
The option is disabled by default, still it's advertised in the NixOS options documentation, so people might enable it because they think "it's a good idea". Assume there's two users for whom this was configured , and one of this users gets compromised. It's possible to do system-wide DNS redirection attacks of the whole traffic. There's a reason on why On top of that, it's a feature that was implemented solely inside nixpkgs. There's no upstream NM "best practices", explaining that this is the recommended way for users to change |
I'd assume it's also sufficient to do something like this:
… and this is simply setting a setting documented in NetworkManager and dnsmasq. I still consider imperatively adding entries in there as a regular user a hack, or what's the usecase? |
My use case is for development/testing. It is a very simple way to dynamically update DNS entries to point to temporary VMs and containers. I'm completely fine with removing it from nixpkgs, if it is not wanted there. It is simple enough for me to use a local NixOS module for this. Maybe you should just mention the |
16a3ce4
to
fbe210c
Compare
You're right - just configuring the existing dnsmasq (if you happen to use the dnsmasq backend) is easier - I updated the PR and now point towards This might be a quick & dirty way around it, but at least for local containers this should be handled by NSS - and for anything remote I'd personally want HTTPS and a DNS record anyways. |
This option was removed because allowing (multiple) regular users to override host entries affecting the whole system opens up a huge attack vector. There seem to be very rare cases where this might be useful. Consider setting system-wide host entries using networking.hosts, provide them via the DNS server in your network, or use networking.networkmanager.appendNameservers to point your system to another (local) nameserver to set those entries.
fbe210c
to
ca6c91e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me 👍
I believe you supported your claim particularly well, the initial change could have used a PR. Changes to networkmanager in NixOS should have lots of review.
This option was removed because allowing (multiple) regular users to
override host entries affecting the whole system opens up a huge attack
vector. There seem to be very rare cases where this might be useful.
Consider setting system-wide host entries using networking.hosts,
provide them via the DNS server in your network, or use
networking.networkmanager.appendNameservers to point your system to
another (local) nameserver to set those entries.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers