Skip to content
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

Add hardening options to systemd unit #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

erdnaxe
Copy link

@erdnaxe erdnaxe commented Jan 24, 2022

These options increase the isolation of mautrix-* system services.

I have been using these options with mautrix-telegram without any issue (on NixOS 21.11).

I am not setting SystemCallFilter as it might cause issue with old systemd distributions such as Ubuntu 18.04.
I am not setting DeviceAllow, PrivateDevices, PrivateUsers, RestrictAddressFamilies and UMask as I have not enough knowledge about how other mautrix bridges could behave.

Thanks,

@kidhab
Copy link

kidhab commented Jun 11, 2022

ProtectSystem = strict mounts the whole file system as read only. This only works if you disable logging of your bridge - which is not the default. Hence a service with your proposed configuration refuses to start.

One solution is to add a BindPaths setting like BindPaths = /opt/mautrix-telegram/mautrix-telegram.log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants