-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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/znc: harden systemd unit #122241
nixos/znc: harden systemd unit #122241
Conversation
RestrictSUIDSGID = true; | ||
SystemCallArchitectures = "native"; | ||
SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ]; | ||
UMask = "0027"; |
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.
I think znc creates files with umask 0077 by default, so maybe we should set the same? I don't understand why people do that: It's useful to have a way to give a process (e.g. a backup program) just read access by using the group.
Quite sure this breaks using chown on ie. https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/networking/znc/default.nix#L276 Currently getting
|
ProtectSystem = "strict"; | ||
ReadWritePaths = [ cfg.dataDir ]; | ||
RemoveIPC = true; | ||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; |
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.
I haven't gotten to the entire "why" of the issue yet (see below), but this needs to include AF_UNIX
in order for ZNC to make host lookups, because of nscd.
Is anyone running this in a default configuration who doesn't have DNS lookup issues? I'm not sure why I'd be running into issues and nobody else is, I don't have an abnormal nsswitch configuration or anything...
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)