nixos/go2rtc: harden systemd service#490641
Open
ronnychevalier wants to merge 1 commit intoNixOS:masterfrom
Open
nixos/go2rtc: harden systemd service#490641ronnychevalier wants to merge 1 commit intoNixOS:masterfrom
ronnychevalier wants to merge 1 commit intoNixOS:masterfrom
Conversation
JamieMagee
reviewed
Feb 21, 2026
Comment on lines
117
to
121
| RestrictAddressFamilies = [ | ||
| "AF_INET" | ||
| "AF_INET6" | ||
| "AF_NETLINK" | ||
| ]; |
Member
There was a problem hiding this comment.
AF_UNIX should be in this list. go2rtc has a unix_listen option for its API
Contributor
Author
There was a problem hiding this comment.
Good catch, I did not know unix_listen existed, I might use it now, thanks!
I will add something like ++ lib.optionals (cfg.settings.api.unix_listen != "") ["AF_UNIX"].
JamieMagee
reviewed
Feb 21, 2026
| ProtectProc = "invisible"; | ||
| ProcSubset = "pid"; | ||
| ProtectSystem = "strict"; | ||
| UMask = "0077"; |
Member
There was a problem hiding this comment.
Worth considering DevicePolicy = "closed" here? Something like:
DevicePolicy = "closed";
DeviceAllow = [
"/dev/video*"
"/dev/dri/*"
];
Contributor
Author
There was a problem hiding this comment.
I thought about this, but I preferred to submit a conservative set of sandboxing settings that minimized the probability of breaking someone setup. I would prefer to submit (or someone else) a follow-up PR for this.
JamieMagee
approved these changes
Feb 21, 2026
3003020 to
fb97448
Compare
To follow the principle of least privilege, let's remove privileges it does not require by configuring systemd service settings. See NixOS#377827
fb97448 to
438eb12
Compare
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.
To follow the principle of least privilege, let's
remove privileges it does not require by configuring systemd service settings.
See #377827
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.