-
-
Notifications
You must be signed in to change notification settings - Fork 7.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
templates/systemd/mastodon: update sandbox mode #16235
Conversation
This is a breaking change. I am not sure it's worth it. |
Ok, removed this changes: diff --git a/dist/mastodon-sidekiq.service b/dist/mastodon-sidekiq.service
index fc652b4e8..3ba13d03d 100644
--- a/dist/mastodon-sidekiq.service
+++ b/dist/mastodon-sidekiq.service
@@ -15,8 +15,6 @@ Restart=always
# Proc filesystem
ProcSubset=pid
ProtectProc=invisible
-# Access write directories
-UMask=0027
# Capabilities
CapabilityBoundingSet=
# Security
diff --git a/dist/mastodon-streaming.service b/dist/mastodon-streaming.service
index 36f9f8e75..861a7fe45 100644
--- a/dist/mastodon-streaming.service
+++ b/dist/mastodon-streaming.service
@@ -15,8 +15,6 @@ Restart=always
# Proc filesystem
ProcSubset=pid
ProtectProc=invisible
-# Access write directories
-UMask=0027
# Capabilities
CapabilityBoundingSet=
# Security
diff --git a/dist/mastodon-web.service b/dist/mastodon-web.service
index 465ac70fb..d083b8092 100644
--- a/dist/mastodon-web.service
+++ b/dist/mastodon-web.service
@@ -15,8 +15,6 @@ Restart=always
# Proc filesystem
ProcSubset=pid
ProtectProc=invisible
-# Access write directories
-UMask=0027
# Capabilities
CapabilityBoundingSet=
# Security
|
I am not sure about the implications of Generally, though, I'm not sure how much it's worth tightening the sandboxing settings, as it may cause hard-to-debug issues if we end up making more system calls or our dependencies change and make different system calls. Furthermore it may lead to hard-to-debug issues like #16378 |
Maybe there is an possibility to write tests that check the main functions in work? |
Is there an issue that this references or addresses? Not being familiar with service flags, it would be nice to understand the problem(s) this solves. |
Added |
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.
I have been running with those settings for a few months now without noticing any issue.
There is also a bugfix in there, with mastodon-web
being allowed the @resources
syscall group again, which sometimes prevented POST /api/v1/media
from working correctly.
* templates/systemd/mastodon: add new sandboxing options * templates/systemd/mastodon: add '@PRIVILEGED' and remove duplicates SystemCallFilters * templates/systemd/mastodon: add '@ipc' SystemCallFilter * templates/systemd/mastodon: add '@memlock' SystemCallFilter * templates/systemd/mastodon: allow '@resources' filter to mastodon-web service
Added
ProcSubset
,ProtectProc
andRemoveIPC
options.Remoded duplicates filters. Filter
@privileged
includes the following filters -@chown
,@clock
,@module
,@raw-io
,@reboot
,@swap
.To
ruby
process allow only@chown
system calls instead@privileged
To service
mastodon-streaming
deny@memlock
system calls.