]> git.proxmox.com Git - qemu-server.git/commit
vncproxy: allow to request a generated VNC password
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 18 Jun 2020 16:20:10 +0000 (18:20 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 22 Jun 2020 10:01:55 +0000 (12:01 +0200)
commit3c5bdde815c503f2461d24db0caddaac37527a14
tree085ae2b726c98e5281e2e1bf0c85f53cd461d250
parent1b7824d349de6025c75f00b068ff42c952918e4c
vncproxy: allow to request a generated VNC password

We used the VNC API $ticket as password for VNC, but QEMU limits the
password to the first 8 chars and ignores the rest[0].
As our tickets start with a static string (e.g., "PVE") the entropy
was a bit limited.

For Proxmox VE this does not matters much as the noVNC viewer
provided by has to go always over the API call, and so a valid
ticket and correct permissions for the requested VM are enforced
anyway.

This patch helps external users, which often use NoVNC-Websockify,
circumventing the API and relying solely on the VNC password to avoid
snooping on VNC sessions.

A 'generate-password' parameter is added, if set a password from good
entropy (using libopenssl) is generated.

For simplicity of mapping random bits to ranges we extract 6 bit of
entropy per character and add the integer value of '!' (first
printable ASCII char) to that. This way we get 64^8 possibilities,
which even with millions of guesses per second one would need years
of guessing and mostly just DDOS the server with websocket upgrade
requests.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Qemu.pm