archrelease: copy trunk to community-any
[ArchLinux/community.git] / matrix-synapse / repos / community-x86_64 / override-hardened.conf
blob19b04e73f21c1e110123710f456784a9d15af7ae
1 [Service]
2 # The following directives give the synapse service R/W access to:
3 # - /run/synapse
4 # - /var/lib/synapse
5 # - /var/log/synapse
7 RuntimeDirectory=synapse
8 StateDirectory=synapse
9 LogsDirectory=synapse
11 ######################
12 ## Security Sandbox ##
13 ######################
15 # Make sure that the service has its own unshared tmpfs at /tmp and that it
16 # cannot see or change any real devices
17 PrivateTmp=true
18 PrivateDevices=true
20 # We give no capabilities to a service by default
21 CapabilityBoundingSet=
22 AmbientCapabilities=
24 # Protect the following from modification:
25 # - The entire filesystem
26 # - sysctl settings and loaded kernel modules
27 # - No modifications allowed to Control Groups
28 # - Hostname
29 # - System Clock
30 ProtectSystem=strict
31 ProtectKernelTunables=true
32 ProtectKernelModules=true
33 ProtectControlGroups=true
34 ProtectClock=true
35 ProtectHostname=true
37 # Prevent access to the following:
38 # - /home directory
39 # - Kernel logs
40 ProtectHome=tmpfs
41 ProtectKernelLogs=true
43 # Make sure that the process can only see PIDs and process details of itself,
44 # and the second option disables seeing details of things like system load and
45 # I/O etc
46 ProtectProc=invisible
47 ProcSubset=pid
49 # While not needed, we set these options explicitly
50 # - This process has been given access to the host network
51 # - It can also communicate with any IP Address
52 PrivateNetwork=false
53 RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
54 IPAddressAllow=any
56 # Restrict system calls to a sane bunch
57 SystemCallArchitectures=native
58 SystemCallFilter=@system-service
59 SystemCallFilter=~@privileged @resources @obsolete
61 # Misc restrictions
62 # - Since the process is a python process it needs to be able to write and
63 #   execute memory regions, so we set MemoryDenyWriteExecute to false
64 RestrictSUIDSGID=true
65 RemoveIPC=true
66 NoNewPrivileges=true
67 RestrictRealtime=true
68 RestrictNamespaces=true
69 LockPersonality=true
70 PrivateUsers=true
71 MemoryDenyWriteExecute=false