-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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-provided systemd hardening options are prone to cause problems for downstream users #270637
Comments
Since we're talking about systemd hardening - what if we had an alternative systemd module, where all hardening was already set to most strict possible values? Basically make the hardening optout instead of optin just like eg. IAM works. ofc all of this could be easily overridable like you explained above. also, instead of doing this change treewide, just provide an alternative and gradually we would have more and more hardened services, I'm not sure if anyone has pulled this out yet |
Or one could use groups/building blocks of hardening options. Anything fs related could be merged in with The struggle is that it would be difficult add new flags to |
maybe related: #259217 |
Using I think some version of what @pbsds purposes makes much more sense, and could be added to a services that wish to harden easily. My current issue is with services such as transmission, where a lot of options are set, and unsetting all these options, it's actually easier to fork nixpkgs/fork the module, remove it all, instead of finding all the default values for all the systemd settings. I don't agree with what was done in : #259217 , as it doesn't provide the user with any information on why it was done, or what setting those options to false (in this case), would change/allow it to work with (without finding the issue/PR anyways). |
This would make adding anything new to allTheFlags a major undertaking and potentially breaking a lot of services. We do not have tests for everything and it is not possible to test all the functions. eg regressions like #179444 could be triggered by new hardening options. Also we shouldn't merge attrs but instead leverage the module system. lib.mkForce should be basic knowledge how to use the module system. If you get an error message with conflicting values, then this already written in the error message. |
Is there any reason to close this? It's still a real issue people run into. |
The problem still exists, but support for the proposed solution has stalled and viable alternatives have yet to be found. I'll repurpose the thread as documentation of the issue |
lib.mkOptionDefault
?
EDIT: original title was
RFC: Should we turn all systemd hardening options to lib.mkOptionDefault?
Downstream issues where the configured nixos systemd service hardening options prevent certain niche use-cases are plentiful (example). These hardening options tend to skew towards making the services barely useable, thanks to
systemd-analyze
. Instead of requiring end users to learn and uselib.mkForce
, I believe we should ease adoption and wrap all systemd hardening options withlib.mkOptionDefault
.Thoughts?
The text was updated successfully, but these errors were encountered: