mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 20:26:48 +00:00
feat(console): the console daemons' systemd units run sandboxed
webvirt-novncd and webvirt-socketiod get read-only system directories, no access to /home and /root, no new privileges, no kernel tunables, modules or cgroups, and only Unix, IPv4 and IPv6 sockets; socketiod also a private /tmp. novncd keeps the shared /tmp, where a VM's VNC Unix socket may be. They keep what they need: a pty and its console worker, TCP and Unix sockets, ssh with its configuration, writes under /srv/webvirtcloud and the service user's ~/.ssh. The units installed by the update steps bring this.
This commit is contained in:
parent
554e3a7995
commit
69ddbbdc94
3 changed files with 25 additions and 0 deletions
|
|
@ -11,6 +11,18 @@ EnvironmentFile=-/etc/default/webvirtcloud
|
|||
ExecStart=/srv/webvirtcloud/venv/bin/python3 /srv/webvirtcloud/console/novncd
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
# Sandbox: what the console daemons need (TCP and Unix sockets, ssh,
|
||||
# writes under /srv and the user's ~/.ssh) and no more. No private /tmp:
|
||||
# a VM's VNC Unix socket may be there.
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=full
|
||||
ProtectHome=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||
RestrictSUIDSGID=yes
|
||||
LockPersonality=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
|||
|
|
@ -13,6 +13,18 @@ ExecStart=/srv/webvirtcloud/venv/bin/python3 /srv/webvirtcloud/console/socketiod
|
|||
KillMode=mixed
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
# Sandbox: what the console daemons need (a pty and its worker, TCP and
|
||||
# Unix sockets, ssh, writes under /srv and the user's ~/.ssh) and no more
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
ProtectSystem=full
|
||||
ProtectHome=yes
|
||||
ProtectKernelTunables=yes
|
||||
ProtectKernelModules=yes
|
||||
ProtectControlGroups=yes
|
||||
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
|
||||
RestrictSUIDSGID=yes
|
||||
LockPersonality=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue