-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
systemd: enable systemd hardening features #7286
systemd: enable systemd hardening features #7286
Conversation
I've added a reduced set of security settings, for users who need the fuse-mount-feature. |
c097d28
to
25a2e31
Compare
I've added a separate hardened service file. So the maintainer can choose between hardening and the fuse mount functionality. |
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.
Some nits/questions, otherwise LGTM.
ProtectKernelModules=true | ||
ProtectKernelLogs=true | ||
PrivateDevices=true | ||
DevicePolicy=closed |
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 is implied by PrivateDevices, right?
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.
PrivateDevices
will set DevicePolicy=closed
, the reasoning for setting it explicitly is some older systemd-versions might support just the simpler DevicePolicy=closed
but doesn't yet support PrivateDevices
.
In this case PrivateDevices
would be ignored and DevicePolicy=closed
not set.
# enable to specify a custom path see docs/environment-variables.md for further documentations | ||
#Environment=IPFS_PATH=/custom/ipfs/path | ||
# enable to specify a higher limit for open files/connections | ||
#LimitNOFILE=1000000 |
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.
Given all these restrictions, will IPFS be able to set it's own file descriptor limits? If not, we should probably set this.
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.
Yes, it can.
Thanks! |
Motivation
IPFS is a network-facing service, which just needs very limited access to the system itself outside of it's state-directory.
Systemd allows to do a lot of hardening to separate a network process from the system and reduce the attack surface.
This PR aims to enable all possible options for the latest systemd-version.