This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move service hardening into the Debian packaging
Signed-off-by: Jörg Behrmann <[email protected]>
- Loading branch information
Showing
4 changed files
with
126 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,33 +57,3 @@ systemctl restart matrix-synapse-worker@generic_worker.service | |
systemctl enable matrix-synapse-worker@federation_writer.service | ||
systemctl restart matrix-synapse.target | ||
``` | ||
|
||
## Hardening | ||
|
||
**Optional:** If further hardening is desired, the file | ||
`override-hardened.conf` may be copied from | ||
[contrib/systemd/override-hardened.conf](https://github.com/matrix-org/synapse/tree/develop/contrib/systemd/) | ||
in this repository to the location | ||
`/etc/systemd/system/matrix-synapse.service.d/override-hardened.conf` (the | ||
directory may have to be created). It enables certain sandboxing features in | ||
systemd to further secure the synapse service. You may read the comments to | ||
understand what the override file is doing. The same file will need to be copied to | ||
`/etc/systemd/system/[email protected]/override-hardened-worker.conf` | ||
(this directory may also have to be created) in order to apply the same | ||
hardening options to any worker processes. | ||
|
||
Once these files have been copied to their appropriate locations, simply reload | ||
systemd's manager config files and restart all Synapse services to apply the hardening options. They will automatically | ||
be applied at every restart as long as the override files are present at the | ||
specified locations. | ||
|
||
```sh | ||
systemctl daemon-reload | ||
|
||
# Restart services | ||
systemctl restart matrix-synapse.target | ||
``` | ||
|
||
In order to see their effect, you may run `systemd-analyze security | ||
matrix-synapse.service` before and after applying the hardening options to see | ||
the changes being applied at a glance. |