nixos/dhcpcd: harden and run as unprivileged user#276919
Closed
rnhmjoj wants to merge 62 commits intoNixOS:stagingfrom
Closed
nixos/dhcpcd: harden and run as unprivileged user#276919rnhmjoj wants to merge 62 commits intoNixOS:stagingfrom
rnhmjoj wants to merge 62 commits intoNixOS:stagingfrom
Conversation
Contributor
Did you consider/try with DynamicUser? |
Contributor
Author
No, but I think it should work alright: there isn't too much state being handled (just a couple of files per interface + one for each wireless network) and no other user in the dhcpcd group. |
23390a4 to
4ce16de
Compare
Contributor
Author
|
@bjornfor I switched to DynamicUser. |
4ce16de to
614e830
Compare
bjornfor
reviewed
Jan 4, 2024
bjornfor
reviewed
Jan 4, 2024
bjornfor
reviewed
Jan 4, 2024
18000d1 to
32f3e4e
Compare
32f3e4e to
12729cb
Compare
…cator-marking nixos/ayatana-indicators: Split ayatana and lomiri indicators
Upstream went missing
This group is useful to allow specific users to run resolvconf and (and this modify /etc/resolv.conf) without root privileges.
The priviledge separation mode has several downsides:
- it's incompatible with alternative memory allocators, including
graphene-hardened;
- it needs an unreleased patch to fix a crash;
- it results in none less than 6 subprocesses running at any time,
increasing the memory usage;
- the privileged process (albeit not doing any networking related
tasks) is still running as root, so it has complete access to the
system.
Let's disable this by default and instead run dhcpcd as an unpriviledge
user with only the necessary capabilities.
This workaround for NTP daemons has been there for 12 years and is most likely not needed anymore.
f822cfd to
13f72bb
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
These changes replace the dhcpcd privsep mode with a combination of POSIX capabilities and systemd security features that allow to fully run dhcpcd as an unprivileged user. See the commit messages for why I think this is an improvement.
There are a couple of backward incompatibilities, but most users shouldn't notice any difference.
Things done
dhcpcd.tests