-
Notifications
You must be signed in to change notification settings - Fork 49
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
better example file for systemd service #22
base: master
Are you sure you want to change the base?
Conversation
User=nobody | ||
Group=nogroup | ||
Environment=USER=nobody HOME=/tmp | ||
ProtectSystem=true |
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 should be ProtectSystem=full
so that a config file with allowed subnets can be loaded from /etc
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.
It should be strict
, as the service does not need any write access.
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.
It should be
strict
, as the service does not need any write access.
Yes, you are right.
When using DynamicUser=yes
systemd also implicitly sets ProtectSystem=strict
according to the systemd documentation.
Restart=on-failure | ||
RestartSec=10s | ||
User=nobody | ||
Group=nogroup |
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.
User and Group should not be set to nobody/nogroup, instead DynamicUser=yes
should be used
@cs8425 I'm happy to merge this if you include @DanScharon's comments |
I'm proposing an alternative patch, including the suggestions along with more hardening options: #30. |
drop root permission on
go-mmproxy
itself,enable
CAP_NET_BIND_SERVICE
,CAP_NET_ADMIN
for binding < 1024 port and usingIP_TRANSPARENT
,and keep
ip rule
,ip route
working.