mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
fix(console): disable the unauthenticated serial console by default
socketiod does not validate the console token, keeps a single global PTY and broadcasts its output to every connected client, so anyone who can reach port 6081 can read and write a serial console that someone opened. It is also broken for legitimate users, since console/views.py now writes signed tokens that socketiod cannot parse. Until it is rewritten, turn the serial console off by default: - Add SERIAL_CONSOLE_ENABLED = False to the settings template; installs whose settings.py lacks it are treated as disabled. - The console view shows an error instead of the xterm page for pty consoles while the setting is off. - socketiod refuses to start unless SERIAL_CONSOLE_ENABLED is True. - Supervisor: autostart=false for socketiod; drop -d (debug) from the supervisor and systemd definitions; fix the systemd unit description; conf/systemd/install.sh no longer suggests enabling socketiod. - README: stop opening port 6081 and document how to enable the serial console on a trusted network.
This commit is contained in:
parent
b1ab1d47fa
commit
1547e58e55
9 changed files with 127 additions and 9 deletions
|
|
@ -14,10 +14,13 @@ autostart=true
|
|||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
||||
# Serial console daemon. Disabled by default because it does not authenticate
|
||||
# connections yet; set SERIAL_CONSOLE_ENABLED = True in settings.py and
|
||||
# autostart=true here only on a trusted network.
|
||||
[program:socketiod]
|
||||
command=/srv/webvirtcloud/venv/bin/python3 /srv/webvirtcloud/console/socketiod -d
|
||||
command=/srv/webvirtcloud/venv/bin/python3 /srv/webvirtcloud/console/socketiod
|
||||
directory=/srv/webvirtcloud
|
||||
user=www-data
|
||||
autostart=true
|
||||
autostart=false
|
||||
autorestart=true
|
||||
redirect_stderr=true
|
||||
|
|
|
|||
|
|
@ -4,4 +4,7 @@ SCRIPTPATH=$(dirname "$FILEPATH");
|
|||
cd "$SCRIPTPATH"
|
||||
cp webvirt-* /lib/systemd/system/
|
||||
cp webvirt /etc/default/
|
||||
echo Run to start services \"systemctl daemon-reload\; systemctl enable --now $(ls webvirt-* | tr "\n" " ")\"
|
||||
# webvirt-socketiod (serial console) is not enabled by default: it does not
|
||||
# authenticate connections yet and refuses to start unless
|
||||
# SERIAL_CONSOLE_ENABLED = True is set in settings.py.
|
||||
echo Run to start services \"systemctl daemon-reload\; systemctl enable --now $(ls webvirt-* | grep -v socketiod | tr "\n" " ")\"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Webvirt Cloud NOVNCD
|
||||
Description=Webvirt Cloud serial console (socketiod; requires SERIAL_CONSOLE_ENABLED = True)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ LimitNOFILE=64000
|
|||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
EnvironmentFile=/etc/default/webvirt
|
||||
|
||||
ExecStart=/bin/bash -c "cd ${WEBVIRT_PATH};${WEBVIRT_PATH}/venv/bin/python3 ${WEBVIRT_PATH}/console/socketiod -d"
|
||||
ExecStart=/bin/bash -c "cd ${WEBVIRT_PATH};${WEBVIRT_PATH}/venv/bin/python3 ${WEBVIRT_PATH}/console/socketiod"
|
||||
|
||||
# Make sure stderr/stdout is captured in the systemd journal.
|
||||
StandardOutput=journal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue