-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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/amuled: add systemd hardening options #354517
base: master
Are you sure you want to change the base?
nixos/amuled: add systemd hardening options #354517
Conversation
Thanks for your contribution, please make sure your commit messages match CONTRIBUTING.md. |
dcffdbd
to
02c8bea
Compare
Drops the script startup method in favor of directly executing the service under its own user, and adds general hardening to the systemd unit.
02c8bea
to
7f8e017
Compare
Thanks for the review @xanderio, I just squashed and edited the commit message, please take a look again. |
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.
Changes LGTM
Haven't tried out the module yet
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.
This looks good, feel free to dismiss my comments.
@@ -61,20 +63,46 @@ in | |||
gid = config.ids.gids.amule; | |||
} ]; | |||
|
|||
systemd.tmpfiles.rules = [ |
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.
Could you maybe use the new systemd.tmpfiles.settings
interface?
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.
Hey, thanks for the new review. I wasn't aware of this new interface, added in c331196.
environment.HOME = cfg.dataDir; | ||
|
||
serviceConfig = { | ||
Type = "forking"; |
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.
Is there a reason where using a forking
service here, instead of dropping the --full-deamon
arg below and letting systemd handle the rest?
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.
Just tested, and it works fine without it, changed in b055531, thanks.
Drop the full-deamon flag, and remove the needless forking
Drops the script startup method in favor of directly executing the service under its own user and adds general hardening to the systemd unit.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.