mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
infinoted: Use systemd sandboxing features
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
b4e00d2574
commit
1498a9ae83
@ -94,6 +94,24 @@ After=network.target
|
|||||||
User=infinoted
|
User=infinoted
|
||||||
Group=infinoted
|
Group=infinoted
|
||||||
ExecStart=/usr/bin/infinoted
|
ExecStart=/usr/bin/infinoted
|
||||||
|
ConfigurationDirectory=infinoted
|
||||||
|
ConfigurationDirectoryMode=0750
|
||||||
|
LockPersonality=yes
|
||||||
|
NoNewPrivileges=yes
|
||||||
|
PrivateDevices=yes
|
||||||
|
PrivateMounts=yes
|
||||||
|
PrivateTmp=yes
|
||||||
|
PrivateUsers=yes
|
||||||
|
ProtectControlGroups=yes
|
||||||
|
ProtectHome=yes
|
||||||
|
ProtectKernelLogs=yes
|
||||||
|
ProtectKernelModules=yes
|
||||||
|
ProtectKernelTunables=yes
|
||||||
|
ProtectSystem=full
|
||||||
|
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||||
|
RestrictRealtime=yes
|
||||||
|
StateDirectory=infinoted
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@ -130,11 +148,10 @@ def subcommand_setup(_):
|
|||||||
with open(CONF_PATH, 'w') as file_handle:
|
with open(CONF_PATH, 'w') as file_handle:
|
||||||
file_handle.write(CONF)
|
file_handle.write(CONF)
|
||||||
|
|
||||||
if not os.path.isfile(SYSTEMD_SERVICE_PATH):
|
with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle:
|
||||||
with open(SYSTEMD_SERVICE_PATH, 'w') as file_handle:
|
file_handle.write(SYSTEMD_SERVICE)
|
||||||
file_handle.write(SYSTEMD_SERVICE)
|
|
||||||
|
|
||||||
subprocess.check_call(['systemctl', 'daemon-reload'])
|
subprocess.check_call(['systemctl', 'daemon-reload'])
|
||||||
|
|
||||||
# Create infinoted group if needed.
|
# Create infinoted group if needed.
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -31,7 +31,7 @@ from plinth.views import AppView
|
|||||||
|
|
||||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||||
|
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
managed_services = ['infinoted']
|
managed_services = ['infinoted']
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user