-
Notifications
You must be signed in to change notification settings - Fork 144
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
Harden ympd.service #185
base: master
Are you sure you want to change the base?
Harden ympd.service #185
Conversation
This offers a measure of protection against potential ympd vulnerabilities. See https://www.freedesktop.org/software/systemd/man/systemd.exec.html for documentation.
See also: https://gist.github.com/ageis/f5595e59b1cddb1513d1b425a323db04, https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#unit-configuration, and https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Sandboxing:
|
When I add these, ympd fails to start for me, since it cannot change the user (drop priviledges). |
Are you setting up ympd.service as a user service? |
No, but I figured it out in the meantime: the user name has (of course) to be the same as in /etc/defaults/ympd for $YMPD_USER which in my case was mpd |
Ah, it makes sense then :) |
I'd also remove the Great work otherwise. Should it be merged already? :) |
PrivateUsers=yes | ||
PrivateTmp=yes | ||
PrivateDevices=yes | ||
ProtectSystem=strict |
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 DynamicUser=yes
CapabilityBoundingSet= | ||
LockPersonality=yes | ||
PrivateUsers=yes | ||
PrivateTmp=yes |
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 DynamicUser=yes
User=ympd | ||
DynamicUser=yes | ||
MountAPIVFS=yes | ||
RemoveIPC=yes |
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 DynamicUser=yes
PrivateTmp=yes | ||
PrivateDevices=yes | ||
ProtectSystem=strict | ||
NoNewPrivileges=yes |
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 DynamicUser=yes
This offers a measure of protection against potential ympd vulnerabilities. See
https://www.freedesktop.org/software/systemd/man/systemd.exec.html for
documentation.